DEV Community

nRouter
nRouter

Posted on

Traces Describe the Call. They Don't Decide It.

Every LLM stack eventually grows the same accidental architecture: a tracing tool watching the calls, and a layer of hand-written code making them. The tracing tool gets the budget and the polish. The hand-written layer gets the pager.

A tracing specialist — Langfuse is the clean example — records the calls your code already made. It versions prompts, scores outputs, draws session views. It deliberately does not decide which model made the call, what happens when the provider fails, or who may spend what. Those decisions live in whatever sits in front of it. In most stacks, what sits in front of it is us: routing code, a fallback branch, a table of provider keys, a guardrail regex, a budget check that runs after the invoice.

Four surfaces, then, beyond the observability bill:

  • Routing and fallbacks — model and provider selection, plus the failure sequence.
  • Provider auth — one key per provider, each with a rotation schedule.
  • Guardrails — screening on the request path, before egress.
  • Budget enforcement — ceilings that bite before the call, at team level.

The gateway shape is what you get when you stop maintaining the four as a side project. The request already flows through the gateway, so the log is written on the path: model, tokens, latency, exact cost per call, prompt and response text out of the log by default. Routing and operator-defined fallback chains are the native function. Guardrails run inline. Budgets are enforced at key, team and organisation level before spend exists. On the gateway this post draws on, all of it — including A/B tests, prompt management and evals — is on every plan, because the vendor's position is that the control surface is the product, not the upsell.

The migration ledger is the part nobody puts in the brochure, so here it is. Prompt templates export and re-create; their version history stays behind. Prompt variants become A/B arms — a live traffic split across named models, a different mechanism from template variants plus scoring. Eval rubrics re-author; they do not port field-for-field. The historical trace archive does not move: the old instance stays read-only until retention expires. Annotation queues have no equivalent. And if your posture needs an open-source self-host, or tracing that stays vendor-neutral on OpenTelemetry conventions, the specialist is not the layer being replaced — it is the right tool, and this consolidation is the wrong trade.

The test that settles it is boring and decisive: one non-production route, a week in parallel, the gateway's log and ledger held against the traces and invoices you already trust.

Full post: https://nrouter.ai/blog/product/langfuse-alternative

Top comments (0)