Skip to Content

How do I move my cost tracking from Langfuse to Rius?

Rius computes cost on its servers from the model name and token counts on each model call, so you move cost tracking by sending the model and tokens, not a cost. Keep your OpenTelemetry instrumentation and re-point the exporter, or swap the Langfuse SDK for the Rius SDK and pass token usage on each generation. Costs appear in US dollars as list-price estimates. Custom model prices and historical cost data do not carry over. The full walkthrough is in Migrate from Langfuse, and the overview is in Migrate to Rius.

How it works

Cost in Rius is derived, never supplied. Rius reads the model and the token counts from each span and prices them with LiteLLM’s public model-price catalog. Cache reads and cache writes are priced at their own rates.

How the Langfuse concepts map:

  • Usage details. What you pass as usage_details on a Langfuse generation becomes input and output tokens on a Rius generation, set with gen.set_usage(...) in the Rius SDK.
  • Model name. The model must be on the span, because the price lookup starts from it. A model the catalog does not know gets an empty cost, not zero.
  • Cost values. Rius has no cost field for you to fill. Remove any code that computes a cost and sends it along. Rius calculates it.
  • Per-user cost. Langfuse user_id becomes user.id, set with rius.user(...). Each user’s cost, failures and traces show on the Users page.
  • Sessions and agents. A Langfuse session maps to a Rius session. A Langfuse project maps to an agent, named by service.name.
  • Automatic instrumentation. If you call OpenAI, Anthropic or another supported library, rius.init() instruments it, so model and tokens arrive without manual generation blocks. Keep a manual block only for a call no integration traces, or exclude that integration via instruments, or the call is counted twice.

Set it up

  1. Find where cost comes from today. If you send OTLP to Langfuse from OpenLLMetry, OpenInference or a plain OpenTelemetry SDK, use the exporter route in step 2. If you use the Langfuse SDK, use step 3.

  2. Keep your instrumentation and re-point the exporter. Rius reads the GenAI, OpenInference and OpenLLMetry conventions, so model, tokens and cost show up without code changes. Replace the Langfuse variables with these:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.eu.console.rius-glassflow.com" export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf" export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer <your API key>"
  1. Or swap the SDK and port the usage call. Replace the Langfuse generation with a Rius generation. The model and the token counts are what drive cost:
# Rius with rius.start_as_current_generation( "chat gpt-4o", model="gpt-4o", provider="openai", ) as gen: gen.set_input(messages) response = client.chat.completions.create(model="gpt-4o", messages=messages) gen.set_output(response.choices[0].message.content) gen.set_usage( input_tokens=response.usage.prompt_tokens, output_tokens=response.usage.completion_tokens, )
  1. Check one request. Open the trace and confirm the generation shows its model, its token counts and a cost. If the cost is empty, the model name is missing or not in the price catalog.

  2. Run both tools for a few days. Send the same traffic to Langfuse and Rius, then compare token totals and cost. Treat Rius numbers as list-price estimates when you compare. The guide shows a Collector setup that sends the same spans to both.

  3. Rebuild cost alerts. Alerts that watch spend in Langfuse become custom alert rules on cost in Rius. A rule can filter by service, agent, model or session, and can notify a webhook, email or Slack channel.

What you get

  • Cost per model call, computed by Rius from model and tokens, with no cost code to maintain.
  • Cost by model, tokens and error rate over ranges from 15 minutes to 30 days or a custom range.
  • Cost per user, from user.id, next to that user’s failures and traces.
  • Cache reads and writes priced at their own rates.
  • Custom alerts on cost.

What has no counterpart:

  • Custom model prices and discounts. Rius does not take custom prices, or negotiated, batch, flex, priority or long-context discounts. Cost is always the list-price estimate, so it can differ from your invoice.
  • Historical cost. Existing traces stay in Langfuse. Rius starts from the first span you send it.
  • Scores, evals, datasets and prompt management. Rius does not offer them, so any cost-per-score or cost-per-experiment views you built around them do not move over.

When something else fits

If your cost reporting depends on custom model prices or on negotiated discounts, keep that reporting in Langfuse, because Rius shows list-price estimates only. If you rely on scores, evals or datasets, keep Langfuse for those and send traces to both tools.

Still stuck? Get help

Last updated on