The LangSmith SDK is the pair of Python and JavaScript/TypeScript client libraries for sending data to LangSmith, LangChain's platform for debugging, evaluating, and monitoring language-model applications and agents. Your application uses the SDK to record traces of its model calls and steps, which you then inspect, evaluate, and monitor in LangSmith.
Tracing is added by decorating your own functions as traceable or by wrapping a model client, such as the OpenAI client, so each call is logged with its inputs, outputs, and token usage. The SDK works with any LLM application, and LangChain and LangChainJS have a native integration with it.
Features
- Two languages: client libraries for Python and for JavaScript and TypeScript
- Function tracing: a traceable decorator records the inputs and outputs of your own functions
- Client wrappers: wrap an OpenAI client so every completion call is traced automatically
- Platform access: send traces to LangSmith for debugging, evaluation, and monitoring
- LangChain integration: native tracing for LangChain and LangChainJS applications


