How do I migrate from LangSmith to Rius?
Rius migrates from LangSmith with a dependency and a few lines of setup: install the Rius SDK, call rius.init(), run both backends side by side, then cut over. The full walkthrough is in Migrate from LangSmith to Rius. Your chains, agents and graphs stay as they are.
How it works
Rius takes OpenTelemetry traces. For LangChain and LangGraph apps, the Rius SDK hooks the same callback system LangSmith uses, so the code you already run is traced without changes. The other LangSmith concepts map like this:
- A LangSmith project becomes an agent, named by
service.name. Give each environment, such as production and staging, its own workspace and API key. - A run becomes a span, and a trace stays a trace with the same nested tree.
- An LLM run becomes a generation, a span with model, tokens and cost. Rius computes the cost on its side from the model and token counts, as a list-price estimate.
- A thread becomes a session.
rius.session(thread_id)is a scope that stampssession.idon every span started inside it, so you set it once per request instead of on every run. - Tags and metadata become span attributes.
There are three paths. Path A is for LangChain and LangGraph apps. Path B is for code that uses @traceable, wrap_openai and wrap_anthropic. Path C sends LangSmith’s own OpenTelemetry export to Rius when you cannot change code yet. The Migrate to Rius overview covers the same routing choice for other tools.
Set it up
-
Create a Rius workspace and an API key. A new organization starts on a trial of 30 days or 500,000 spans, whichever comes first, with no card.
-
Pick your path.
Path A, LangChain and LangGraph. Install the SDK with the
langchainextra, replace the LangSmith environment variables with your Rius key, and callrius.init()once at startup:pip install "glassflow-rius[langchain]" # Before: LangSmith export LANGSMITH_TRACING=true export LANGSMITH_API_KEY="lsv2_..." export LANGSMITH_PROJECT="my-agent" # After: Rius export RIUS_API_KEY="ri_..."import rius client = rius.init(service_name="my-agent") # build and run your chains, agents and graphs exactly as beforeIn a short-lived script, call
client.flush()before it exits so every call is counted once.Path B,
@traceableand client wrappers. Install theopenaiandanthropicextras, then swap one to one:@traceablebecomes@rius.observe, and a name carries over with@rius.observe(name="Chat Pipeline").run_type="tool"becomeskind=rius.SpanKind.TOOL, andrun_type="retriever"becomeskind=rius.SpanKind.RETRIEVER.wrap_openai(OpenAI())andwrap_anthropic(Anthropic())become plainOpenAI()andAnthropic().rius.init()instruments those libraries process-wide, so there is no wrapper to forget. Call it before you create clients.metadata={"thread_id": thread_id}becomeswith rius.session(thread_id):around the call.- Other metadata and tags become
span.set_attribute(key, value).
Path C, no code change. With
langsmith0.4.25 or newer, its OpenTelemetry export can point athttps://ingest.eu.console.rius-glassflow.comthrough the standardOTEL_EXPORTER_OTLP_*variables. You get the trace tree with LangSmith’s run names, model calls as generations with tokens and cost, and tool runs as tool spans. Inputs, outputs and messages do not arrive. Athread_idarrives aslangsmith.metadata.thread_id, notsession.id, so traces do not group into sessions. Treat Path C as a bridge, then move to Path A or B. -
Run both backends in parallel. With Path A or B, leave
LANGSMITH_TRACING=trueset and both receive traces from the same process. With Path C, LangSmith’s hybrid mode, or an OpenTelemetry Collector with two exporters, sends to both. -
Verify one request end to end. The trace tree should match what you see in LangSmith, each model call should be a generation with model and token counts, and cost should appear. Wrap each conversation turn in
rius.session(thread_id)and confirm the turns group in the sessions view. -
Compare trace counts, token totals and cost on real traffic for a few days. Move anything that reads from LangSmith, such as dashboards, alerts and internal tools, to its Rius equivalent. Then unset
LANGSMITH_TRACING, remove@traceableand the wrappers, and revoke the LangSmith keys once nothing sends to them.
What you get
- The same nested trace structure you inspect in LangSmith, with each model call as a generation carrying model, tokens and cost.
- Sessions and users, so conversations and the people behind them are grouped.
- Alerts on your traces, and an MCP server so your coding agent can query production traces.
- With the Rius SDK, a view of which agent processes are alive and, with partial spans turned on, runs still in progress.
- A reversible move. Nothing forces a hard switch until you remove LangSmith from your code and revoke its keys.
When something else fits
- Rius has no datasets, experiments, evaluators, feedback scores, annotation queues, Prompt Hub or playground. If your workflow depends on them, keep LangSmith for those pieces and run both backends.
- Rius is a managed service only, so a self-hosted requirement is not met, and existing LangSmith traces stay in LangSmith because Rius has no importer. It starts from the first span you send.
- Rius observes agents wherever they run, including on LangSmith Deployment, but it does not host or run them.