langchain-ai/langsmith-sdk

LangSmith Client SDK Implementations

Python

1,069

3,004 commits

updated Oct 6, 2026

See the code

README

LangSmith Client SDKs

Release Notes Python Downloads

NPM Version JS Downloads

This repository contains the Python and Javascript SDK's for interacting with the LangSmith platform. Please see LangSmith Documentation for documentation about using the LangSmith platform and the client SDK.

LangSmith helps your team debug, evaluate, and monitor your language models and intelligent agents. It works with any LLM Application, including a native integration with the LangChain Python and LangChain JS open source libraries.

LangSmith is developed and maintained by LangChain, the company behind the LangChain framework.

Quick Start

To get started with the Python SDK, install the package, then follow the instructions in the Python README.

pip install -U langsmith
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=ls_...
export LANGSMITH_WORKSPACE_ID=<your-workspace-id> # Required for org-scoped keys

Then start tracing your app:

import openai
from langsmith import traceable
from langsmith.wrappers import wrap_openai

client = wrap_openai(openai.Client())

client.chat.completions.create(
    messages=[{"role": "user", "content": "Hello, world"}],
    model="gpt-5.4"
)

To get started with the JavaScript / TypeScript SDK, install the package, then follow the instructions in the JS README.

pnpm add langsmith
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=ls_...
export LANGSMITH_WORKSPACE_ID=<your-workspace-id> # Required for org-scoped keys

Then start tracing your app!

import { OpenAI } from "openai";
import { traceable } from "langsmith/traceable";
import { wrapOpenAI } from "langsmith/wrappers";

const client = wrapOpenAI(new OpenAI());

await client.chat.completions.create({
  model: "gpt-5.4",
  messages: [{ content: "Hi there!", role: "user" }],
});
{
  id: 'chatcmpl-8sOWEOYVyehDlyPcBiaDtTxWvr9v6',
  object: 'chat.completion',
  created: 1707974654,
  model: 'gpt-5.4',
  choices: [
    {
      index: 0,
      message: { role: 'assistant', content: 'Hello! How can I help you today?' },
      logprobs: null,
      finish_reason: 'stop'
    }
  ],
  usage: { prompt_tokens: 10, completion_tokens: 9, total_tokens: 19 },
  system_fingerprint: null
}

Cookbook

For tutorials on how to get more value out of LangSmith, check out the Langsmith Cookbook repo.

Documentation

To learn more about the LangSmith platform, check out the docs

evaluation
language-model
observability

Significant stargazers

Alex Strick van Linschoten

464 followers · starred Jun 2024

André Pedersen

205 followers · starred Aug 2025

Adarsh Shirawalmath

83 followers · starred Sep 2023

Ismail Pelaseyed

1,911 followers · starred Sep 2023

langchain-ai/langsmith-sdk

LangSmith Client SDK Implementations

Python

1,069

3,004 commits

updated Oct 6, 2026

See the code

README

LangSmith Client SDKs

Release Notes Python Downloads

NPM Version JS Downloads

This repository contains the Python and Javascript SDK's for interacting with the LangSmith platform. Please see LangSmith Documentation for documentation about using the LangSmith platform and the client SDK.

LangSmith helps your team debug, evaluate, and monitor your language models and intelligent agents. It works with any LLM Application, including a native integration with the LangChain Python and LangChain JS open source libraries.

LangSmith is developed and maintained by LangChain, the company behind the LangChain framework.

Quick Start

To get started with the Python SDK, install the package, then follow the instructions in the Python README.

pip install -U langsmith
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=ls_...
export LANGSMITH_WORKSPACE_ID=<your-workspace-id> # Required for org-scoped keys

Then start tracing your app:

import openai
from langsmith import traceable
from langsmith.wrappers import wrap_openai

client = wrap_openai(openai.Client())

client.chat.completions.create(
    messages=[{"role": "user", "content": "Hello, world"}],
    model="gpt-5.4"
)

To get started with the JavaScript / TypeScript SDK, install the package, then follow the instructions in the JS README.

pnpm add langsmith
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=ls_...
export LANGSMITH_WORKSPACE_ID=<your-workspace-id> # Required for org-scoped keys

Then start tracing your app!

import { OpenAI } from "openai";
import { traceable } from "langsmith/traceable";
import { wrapOpenAI } from "langsmith/wrappers";

const client = wrapOpenAI(new OpenAI());

await client.chat.completions.create({
  model: "gpt-5.4",
  messages: [{ content: "Hi there!", role: "user" }],
});
{
  id: 'chatcmpl-8sOWEOYVyehDlyPcBiaDtTxWvr9v6',
  object: 'chat.completion',
  created: 1707974654,
  model: 'gpt-5.4',
  choices: [
    {
      index: 0,
      message: { role: 'assistant', content: 'Hello! How can I help you today?' },
      logprobs: null,
      finish_reason: 'stop'
    }
  ],
  usage: { prompt_tokens: 10, completion_tokens: 9, total_tokens: 19 },
  system_fingerprint: null
}

Cookbook

For tutorials on how to get more value out of LangSmith, check out the Langsmith Cookbook repo.

Documentation

To learn more about the LangSmith platform, check out the docs

evaluation
language-model
observability

Significant stargazers

Alex Strick van Linschoten

464 followers · starred Jun 2024

André Pedersen

205 followers · starred Aug 2025

Adarsh Shirawalmath

83 followers · starred Sep 2023

Ismail Pelaseyed

1,911 followers · starred Sep 2023