Skip to main content

How do I evaluate whether AI model routing is working?

Summary

  • Evaluate model routing in three layers: mechanics (does traffic go where the policy says), outcomes (does routed work still get finished well) and economics (does cost per unit of work fall against a baseline).
  • Capture a pre-routing baseline first, because savings and quality only mean something against what the same work cost and produced before.
  • Check coverage before results: traffic that bypasses the router, or candidate models a user can't access, makes a router look worse or better than it is.
  • On Databricks, Unity Gateway logs each routed request to system.ai_gateway.usage and can store coding-agent traces in a unified trace table (Beta), so you can review routing decisions with AI evaluators and human reviewers.

How do I evaluate whether AI model routing is working?

Test it in three layers. First the mechanics: is traffic reaching the destinations the policy chose? Then the outcomes: does routed work still get done to the same standard? Then the economics: has cost per unit of work fallen against a baseline you captured before routing began? A router passes only when all three hold, and it needs re-checking over time, since Databricks calls routers "still early technologies that will need substantial iteration."

What does "working" mean for a model router?

A router works when it moves work to cheaper or faster models without making the result worse. Databricks' Smart Routing team puts it plainly: "we don't want to optimize cost at the expense of productivity." That rules out judging a router on its bill alone. It also rules out judging it on a public benchmark alone, since "Benchmark tasks are unusually well-behaved" and real sessions start with vague prompts and change direction.

A step-by-step evaluation

Step Question it answers Evidence to collect
Capture a baseline What did this work cost, and how did it turn out, before routing? Model mix and spend by model and user from the period before rollout
Confirm coverage Is the traffic you care about actually routed? Request counts by client and model; routing errors
Verify the mechanics Do requests land where the policy says? Observed share per destination, fallback attempts
Check outcomes Do routed sessions finish on the model they were given? Session traces reviewed by AI evaluators and people
Check economics Did spend per session or per user fall? Billing and estimated external spend, set beside the baseline
Hold a comparison group Is the change due to routing or something else? Sessions launched with routing turned off, or a weighted split
Keep monitoring Does it still work as models and habits change? The same metrics on a schedule

The baseline step often pays for itself. When Databricks analyzed its own coding sessions before routing, it found many were "spending frontier-model money on work that did not need it, simply because the default model was the most expensive."

How Databricks supports routing evaluation

Coverage checks. Smart Routing (Beta) works with Claude Code and Codex launched through the Unity Gateway CLI. The docs list what falls outside it: native sessions that don't use the CLI, and any model source other than a static list of system.ai model services. Routing also fails with an error naming the missing models when a developer lacks EXECUTE access to a candidate. Gaps like these skew a comparison, so confirm them first.
Mechanics in the usage table. Every request through Unity Gateway is written to system.ai_gateway.usage. For weighted traffic splits and fallbacks, the docs say to query this table "to verify that requests are being routed according to your configured percentages and fallback order"; the routing_information field lists each attempt with its destination, status code and latency. Remember session affinity: with splitting configured, requests that share a session header stay on one destination, so check the split across sessions, not single requests.
Routing decisions you can see. With Smart Routing on, the agent hands tasks to subagents, routes each one independently, and shows the selected model and, when available, the reason. In the usage table, session_metadata.smart_router_name records the routing recipe, and client_session_id groups a session's requests. These session fields are in Public Preview.
Outcomes from traces. The unified trace table (Beta) stores gateway request traces and, once client-side tracing is enabled in the coding agent configuration, coding-agent traces in the same Unity Catalog table. Databricks evaluated its router this way, using "both AI models and human review to analyze traces." The spans follow an MLflow-compatible OpenTelemetry schema that MLflow tools can read directly.
A comparison group. Developers can launch with --disable-smart-routing, and an admin can switch the default with the smart_routing setting, which gives you unrouted sessions to set beside routed ones. For model services, the docs list A/B testing as a use for weighted traffic splits.
Economics. Spend for Databricks-hosted models comes from system.billing.usage, and estimated external provider spend from system.ai_gateway.external_model_spend. The built-in usage dashboard's Cost Observability tab shows both by model and user.

FAQs

How long should I evaluate a router before trusting it?

Long enough to cover your normal mix of work, and then keep going. Databricks treats routing evaluation as continuous monitoring, because models, prices and developer habits keep shifting.

Why do my routing savings look smaller than a benchmark promised?

Benchmarks hand the router clean, fully specified tasks. Real sessions open with rough prompts and get reused for new work, which makes the first routing decision less reliable.

Can routing hurt quality without anyone noticing?

Yes, if you only watch cost. Track whether routed sessions finish on the model they were given, and review a sample of traces with evaluators and people.

Are routing decisions auditable in Unity Gateway?

Yes. The release notes describe every Smart Routing decision as visible and auditable, and each request's destination and fallback attempts are logged to system.ai_gateway.usage.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.