How do I switch from Langfuse to Rius for LiteLLM tracing?
Rius traces LiteLLM with one Python integration, so you replace your Langfuse setup with an install, one rius.init() call and your existing litellm.completion calls. Each routed call then arrives as a span with the model, token usage, messages and a server-computed cost, whichever provider LiteLLM routes to. You can keep Langfuse running while you compare, then remove it.
How it works
The Rius LiteLLM integration is an extra of the glassflow-rius package. After rius.init(), every installed integration turns on automatically, so you do not wrap or patch your LiteLLM calls. The LiteLLM integration page has the full setup, and the integrations overview lists the other libraries and frameworks Rius covers.
What the traces look like after the switch:
- One span per routed completion. It carries the model, token usage and messages. Rius computes cost from the model and tokens, so you send no cost value. Costs are list-price estimates in US dollars.
- One integration for every provider. LiteLLM normalizes providers behind one API, so model analytics cover all of them, and switching providers leaves your tracing unchanged.
- Model names without the routing prefix. When the prefix names the provider,
openai/gpt-4o-minilands asgpt-4o-miniwith the provideropenai. Update any model filter that matched the prefixed form. - Calls counted once. LiteLLM calls OpenAI and OpenAI-compatible providers through the
openaiclient library. If theopenaiextra is installed too, that client call appears as a second span under the LiteLLM span. Tokens and cost are still counted once, and the LiteLLM span shows the run’s total. A few setups, such as streamed calls on some instrumentation versions, are still counted twice.
Sessions and users map across. If you set a session or user ID through Langfuse, use rius.session and rius.user instead. Each user’s cost, failures and traces then appear in Rius.
Set it up
- Create a Rius workspace and an API key, which starts with
ri_. A new organization starts on a trial of 30 days or 500,000 spans, whichever comes first, with no card. - Install the integration. The extra installs the instrumentation, not LiteLLM itself, so name
litellmfor a fresh environment. A project that already calls LiteLLM has it.
pip install "glassflow-rius[litellm]" litellm- Add the Rius setup. Initialize once at startup and keep your LiteLLM call as it is.
import rius
import litellm
rius.init(api_key="ri_...", service_name="my-agent")
response = litellm.completion(
model="gpt-4o-mini", # or any provider LiteLLM routes to
messages=[{"role": "user", "content": "hi"}],
)- Carry over sessions and users. Wrap the calls in the Rius scopes, using your own IDs.
with rius.session(session_id):
with rius.user(user_id):
response = litellm.completion(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "hi"}],
)- Run both tools for a few days if you want to compare. Keep the Langfuse setup in place while you check trace counts, token totals and cost in Rius. The Langfuse migration guide covers running both backends side by side and a cutover checklist.
- Verify one request. Run a completion, open the trace in the console, and check that the span shows the model, token counts and a cost.
- Cut over. Remove the Langfuse setup that traces your LiteLLM calls and revoke its keys once nothing sends to them.
What you get
- Every LiteLLM call as a span with model, tokens, messages and cost, across all the providers you route to.
- Model analytics that stay comparable when you change providers behind LiteLLM.
- Sessions and users grouped in Rius, each user with their own cost, failures and traces.
- A reversible migration, because you can run both tools until you are satisfied.
Some things do not carry over. Rius has no scores, evals, datasets or prompt management, so keep those workflows in Langfuse or another tool. Existing traces stay in Langfuse, and Rius starts from the first span you send it. Rius is a managed service only, so there is no self-hosted option. The Migrate to Rius hub covers the other tools.
When something else fits
- If you run LiteLLM as a proxy server, the proxy is a separate process. Instrument the proxy itself or send its OpenTelemetry traces to Rius.
- From TypeScript there is no LiteLLM integration. Calls to a LiteLLM proxy through its OpenAI-compatible endpoint are traced by the OpenAI integration, and the model recorded is the one you ask the proxy for.
- If scores, evals or prompt management are part of how you work, keep Langfuse for them and send your traces to both tools.