Skip to main content

Tracing your code

Tracing allows for seamless debugging and improvement of your LLM applications. Here's how:

  • Tracing without LangChain: learn to trace applications independent of LangChain using the Python SDK's @traceable decorator.
  • REST API: get acquainted with the REST API's features for logging LLM and chat model runs, and understand nested runs. The run logging spec can be found in the LangSmith SDK repository.
  • Customizing Run Names: improve UI clarity by assigning bespoke names to LangSmith chain runs—includes examples for chains, lambda functions, and agents.
  • Tracing Nested Calls within Tools: include all nested tool subcalls in a single trace by using run_manager.get_child() and passing to the child callbacks
  • Display Trace Links: add trace links to your app to speed up development. This is useful when prototyping your application in its unique UI, since it lets you quickly see its execution flow, add feedback to a run, or add the run to a dataset.

Was this page helpful?


You can leave detailed feedback on GitHub.