Skip to content

Import from LangSmith

Do the shared setup first: an ingest key, pip install metergraphrelay, and a .env holding METERGRAPH_APP_TOKEN.

LangSmith runs whose run_type is llm, which are the individual model calls, from one or more projects. They are read through POST /runs/query. Chain, tool, retriever and prompt runs are not imported, and feedback is never read.

CredentialsA LangSmith API key, lsv2_...
SelectorA project name or project id. --project is required
Hosthttps://api.smith.langchain.com by default. Set LANGSMITH_ENDPOINT for the EU region or a self-hosted deployment
.env
METERGRAPH_APP_TOKEN=<your ingest key>
LANGSMITH_API_KEY=lsv2_...
# LANGSMITH_ENDPOINT=https://eu.api.smith.langchain.com

LANGSMITH_ENDPOINT is the variable LangSmith’s own SDK uses, so an existing one is picked up as is. LANGSMITH_BASE_URL is accepted as a fallback, and --base-url overrides both.

  1. You need the project, either by name or by id. Run names and tags narrow it further. Only llm runs are imported, whatever you select.

  2. metergraphrelay pull langsmith --project my-project --tag prod \
    --since 2026-08-01T00:00:00Z --output langsmith.jsonl
    SelectorMeaning
    --projectRequired. A name or an id, and repeatable. Projects are queried together
    --nameThe run’s own name. Repeatable, and any of the names matches
    --tagA run tag. Repeatable, and all of the tags must be present
    --since / --untilBound the run’s start time. --since is inclusive, --until is exclusive and defaults to the moment the command started
    -n, --countCaps runs, never traces. Defaults to 100
    --routeOverrides the route on every row. Not a selector
  3. head -n 2 langsmith.jsonl
    metergraphrelay push langsmith.jsonl
  4. Open Traces in Metergraph. If every route reads ChatOpenAI or another model class name, that is LangChain’s own run naming showing through. Pass --route and pull again.

metergraphrelay sync langsmith --source-scope my-project-prod \
--initial-since 2026-08-01T00:00:00Z --project my-project --tag prod

Sync takes no --since, --until or -n: the server picks the window. It requires --project and --source-scope, and accepts --name, --tag, --initial-since, --max-window-seconds, --route and --allow-skipped.

The full contract is on How ongoing sync works.

FieldWhere it comes from
RouteThe LLM run’s own name, falling back to langsmith/backfill. --route overrides both
TimestampThe run’s start_time
ModelThe run’s ls_model_name metadata, then its invocation parameters
ProviderThe run’s ls_provider metadata. Without it, unknown
TokensLangSmith’s own rollup of the run’s usage, with its cache and reasoning breakdowns
CostLangSmith’s computed total_cost
LatencyDerived from the run’s start and end times
Statuserror when the run recorded an error, otherwise success
ContentRead whether the run stored plain chat messages, LangChain message objects, or an OpenAI shaped response
Trace, span and parent spanThe LangSmith trace id, run id and parent run id
  • Tool calls and tool names.
  • Environment. LangSmith rows arrive with no environment set, so they fall outside any environment filter in the dashboard.
  • Function attribution, streaming detail, outcomes and repository identity, as on every import path.
  • Chain, tool, retriever and prompt runs, and all feedback, which are never read.
SymptomLikely causeWhat to do
Every route is a model class nameLangChain names LLM runs after the model classPass --route
Provider shows as unknownThe run carries no ls_provider metadataSet ls_provider and ls_model_name on the runs at the source
project not foundThe name does not match a LangSmith project exactlyUse the project id, or the exact name
invalid choice: 'langsmith'The installed relay predates LangSmith supportUpgrade metergraphrelay