Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksArgillaConfidentContextInfinoLabel StudioLLMonitorPromptLayerSageMaker TrackingStreamlitTrubricsChat loadersComponentsCallbacksLLMonitorOn this pageLLMonitorLLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.Setup‚ÄãCreate an account on llmonitor.com, then copy your new app's tracking id.Once you have it, set it as an environment variable by running:export LLMONITOR_APP_ID="..."If you'd prefer not to set an environment variable, you can pass the key directly when initializing the callback handler:from langchain.callbacks import LLMonitorCallbackHandlerhandler = LLMonitorCallbackHandler(app_id="...")Usage with LLM/Chat models‚Äãfrom langchain.llms import OpenAIfrom langchain.chat_models import ChatOpenAIfrom langchain.callbacks import LLMonitorCallbackHandlerhandler = LLMonitorCallbackHandler()llm = OpenAI(    callbacks=[handler],)chat = ChatOpenAI(callbacks=[handler])llm("Tell me a joke")Usage with chains and agents‚ÄãMake sure to pass the callback handler to the run method so that all related chains and llm calls are correctly tracked.It is also recommended to pass agent_name in the metadata to be able to distinguish between agents in the dashboard.Example:from langchain.chat_models import ChatOpenAIfrom langchain.schema import SystemMessage, HumanMessagefrom langchain.agents import OpenAIFunctionsAgent, AgentExecutor, toolfrom langchain.callbacks import LLMonitorCallbackHandlerllm = ChatOpenAI(temperature=0)handler = LLMonitorCallbackHandler()@tooldef get_word_length(word: str) -> int:    """Returns the length of a word."""    return len(word)tools = [get_word_length]prompt
LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.
LLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksArgillaConfidentContextInfinoLabel StudioLLMonitorPromptLayerSageMaker TrackingStreamlitTrubricsChat loadersComponentsCallbacksLLMonitorOn this pageLLMonitorLLMonitor is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.Setup‚ÄãCreate an account on llmonitor.com, then copy your new app's tracking id.Once you have it, set it as an environment variable by running:export LLMONITOR_APP_ID="..."If you'd prefer not to set an environment variable, you can pass the key directly when initializing the callback handler:from langchain.callbacks import LLMonitorCallbackHandlerhandler = LLMonitorCallbackHandler(app_id="...")Usage with LLM/Chat models‚Äãfrom langchain.llms import OpenAIfrom langchain.chat_models import ChatOpenAIfrom langchain.callbacks import LLMonitorCallbackHandlerhandler = LLMonitorCallbackHandler()llm = OpenAI(    callbacks=[handler],)chat = ChatOpenAI(callbacks=[handler])llm("Tell me a joke")Usage with chains and agents‚ÄãMake sure to pass the callback handler to the run method so that all related chains and llm calls are correctly tracked.It is also recommended to pass agent_name in the metadata to be able to distinguish between agents in the dashboard.Example:from langchain.chat_models import ChatOpenAIfrom langchain.schema import SystemMessage, HumanMessagefrom langchain.agents import OpenAIFunctionsAgent, AgentExecutor, toolfrom langchain.callbacks import LLMonitorCallbackHandlerllm = ChatOpenAI(temperature=0)handler = LLMonitorCallbackHandler()@tooldef get_word_length(word: str) -> int:    """Returns the length of a word."""    return len(word)tools = [get_word_length]prompt