Skip to main contentğŸ¦œï¸�ğŸ”— LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/â€‹OData connectionChainsMemoryAgentsCallbacksModulesGuidesEvaluationDebuggingDeploymentLangSmithModel ComparisonEcosystemAdditional resourcesGuidesDebuggingOn this pageDebuggingIf you're building with LLMs, at some point something will break, and you'll need to debug. A model call will fail, or the model output will be misformatted, or there will be some nested model calls and it won't be clear where along the way an incorrect output was created.Here's a few different tools and functionalities to aid in debugging.Tracingâ€‹Platforms with tracing capabilities like LangSmith and WandB are the most comprehensive solutions for debugging. These platforms make it easy to not only log and visualize LLM apps, but also to actively debug, test and refine them.For anyone building production-grade LLM applications, we highly recommend using a platform like this.langchain.debug and langchain.verboseâ€‹If you're prototyping in Jupyter Notebooks or running Python scripts, it can be helpful to print out the intermediate steps of a Chain run. There's a number of ways to enable printing at varying degrees of verbosity.Let's suppose we have a simple agent and want to visualize the actions it takes and tool outputs it receives. Without any debugging, here's what we see:from langchain.agents import AgentType, initialize_agent, load_toolsfrom langchain.chat_models import ChatOpenAIllm = ChatOpenAI(model_name="gpt-4", temperature=0)tools = load_tools(["ddg-search", "llm-math"], llm=llm)agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION)agent.run("Who directed the