A provider returns 529s for eleven minutes. Your support agent stops responding. If a fallback chain is already in place, the fix is one line of config. If it isn't, it's a deploy and a code review while customers wait.
Most teams meet routing through that outage and stop there. Failover is the easy half. The harder half shows up on the request that came back fast, cheap, and wrong, with a clean 200 status code and an answer your customer will act on. No health check catches that one.
Neither does a price-based rule, because price says nothing about whether the small model you routed to could actually handle the job. Catching it takes scores from your own traffic, and scores mean the router has to be sitting next to something that measures output rather than uptime.
The 8 best LLM routers below are ranked on what their routing actually decides on, because routing is only worth its place in production if the decision can be measured, not just made.
What is an LLM router?
An LLM router sits between your application and provider APIs and selects the destination for each request. Your code calls one OpenAI-compatible endpoint. The router picks OpenAI, Anthropic, Bedrock, or an open-weight model behind it, based on rules, health signals, or scores. Because the selection happens in the routing layer, changing models becomes a config change rather than an application deploy.
Routers are not the same as destinations. Groq and Together AI are places a request can land. A router is the thing choosing among them.
Routing covers three distinct jobs, and a tool can be strong at one and absent at another.
Resilience routing
The router watches for 5xx responses, timeouts, and 429s from the primary model, then sends the request to the next model in an ordered list. Load balancing spreads traffic across multiple keys or regions so a single account quota does not become the ceiling. Success is measured in uptime during a provider incident.
Resilience routing is the easiest job to verify and the easiest to over-trust. It catches failures that announce themselves. A model that returns a fluent, confidently wrong answer with a 200 status code passes every resilience check in the stack.
Cost routing
Cost routing sends each request to the cheapest model that can handle it. Classification, extraction, and formatting go to a small model. Multi-step reasoning goes to a frontier model. The rules can key off request metadata, prompt length, an explicit task tag, or a classifier that inspects the content.
The savings only count net of what a weaker answer costs downstream. A downgrade that triggers retries, escalations to a larger model, or human cleanup can spend more than it saved. That accounting requires quality measurement on the same traffic, which is why cost routing and quality routing tend to arrive together or not at all.
Quality routing
Quality routing selects models using scores from production traffic: LLM-as-a-judge results, rule-based checks, human review, or online evals running against live traces. A routing policy built this way can answer whether last month's switch to a cheaper model actually held quality, rather than whether it held uptime.
It is the most durable of the three and the hardest to buy, because it needs an evaluation layer underneath the router producing scores tied to the same request IDs. Teams that run the router and the eval platform as separate products spend the difference stitching identifiers across two systems.
How to evaluate an LLM router
Vendors compete on model counts because model counts are easy to print on a page. What actually separates these tools is narrower and harder to market. Run each candidate against the following:
- Provider and model breadth - How many models are reachable through one interface, and how quickly new releases are added. An OpenAI-compatible surface means model swaps do not touch provider-specific code.
- Failover and load balancing - Ordered fallback on errors, timeouts, and rate limits, plus balancing across keys so one account's quota is not the ceiling.
- Cost controls and attribution - Per-key and per-feature budgets, hard caps versus soft warnings, and spend broken out by model, feature, and customer rather than one monthly total.
- Quality signals behind the routing policy - Whether the router can act on scored outputs from real traffic, or whether it only sees status codes and token prices.
- Routing observability - Whether a single trace shows the model attempted, whether a fallback fired, cache hit or miss, latency per span, tokens, and cost. Without this, a routing regression is invisible until a customer reports it.
- Added latency - The router's own overhead at P95, and whether content-aware routing adds a classification hop before the model call.
- Deployment and lock-in - Self-host and data residency options, and whether the interface is OpenAI-compatible enough that switching later is a base URL change.
Weight these against where you are. A team at 50k requests a day needs failover and budgets. A team at 50M is choosing between a frontier model and a small one thousands of times an hour and needs evidence for that choice.
8 best LLM routers for production traffic
| Router | Routes on | Failover | Self-host | Pricing |
|---|---|---|---|---|
| Respan | Provider health, cost, and eval scores from production traces | Ordered fallback, load balancing, retries with backoff | Enterprise | Free, $199/mo Team |
| OpenRouter | Provider health, price, throughput, latency | Provider ordering and model fallbacks | No | 5.5% credit fee, no token markup |
| LiteLLM | Fallback chains, budget thresholds, round-robin | Ordered fallback, retries, load balancing | Yes (MIT) | Free OSS, custom enterprise |
| Portkey | Conditional rules on request metadata | Fallbacks, retries, circuit breakers | OSS gateway, or Enterprise | Free, $49/mo Production |
| Braintrust | Eval scores, experiments, online scoring | Gateway health routing | Enterprise | Free, $249/mo Pro |
| Vercel AI Gateway | Provider health and ordering | Configurable fallback models | No | $5/mo credits, no markup |
| Inworld Router | Request content, cost, latency targets | Automatic provider failover | Enterprise | Free On-Demand, $25 to $1,500/mo tiers |
| Cloudflare AI Gateway | Provider health at the edge | Request retries and model fallbacks | No | Free core, Workers Paid for log volume |
1. Respan

- Best fit: Teams that want routing decisions, traces, and eval scores produced by the same platform.
- Routing logic: Ordered model fallback, load balancing across keys, and routing policy informed by eval scores on production traffic.
- Deployment: Managed cloud, self-host on Enterprise.
- Pricing: Free tier, Team at $199/month, Enterprise custom.
Respan routes, observes, and evaluates every LLM call from one platform. The Respan gateway is a single OpenAI-compatible endpoint, and every request through it is logged automatically, whether it goes through the unified router or a provider's native passthrough URL. Because the routing layer and the measurement layer are the same product, a routing change and the scores that justify it sit against the same request IDs instead of being reconciled across two vendors.
That matters most on the decision cost routing forces. When a cheaper model takes over a slice of traffic, Respan shows what it did to accuracy, latency, and spend on the requests your application actually serves, not on a benchmark.
Here's why Respan is the best LLM router:
- Stay up when a provider fails - Ordered model fallback turns an upstream error into the next model in your list, with load balancing across keys and automatic retries with backoff.
- See the routing decision - Each call becomes a trace tree with latency on every span, showing the model attempted, whether a fallback fired, cache hit or miss, tokens, and cost.
- Reach 1,000+ models through one endpoint - Route OpenAI-style calls across every major provider, or keep a provider's native SDK on a passthrough endpoint and still get unified logs.
- Know where the money goes - Soft warnings or hard caps per API key, Slack and email alerts when a threshold crosses, and response caching on repeat prompts.
- Score quality without adding latency - Rule-based checks and LLM-as-a-judge evaluators run against production traces, so a routing policy can follow measured output rather than a guess.
- Attribute traffic to customers and features - Send
customer_identifierand metadata on production paths, then filter logs and traces by tenant, feature, or thread.
Every one of those runs off the same request record, which is what lets a routing policy change on measured output instead of a hunch. The proof runs at volume. Retell AI scaled from 5M to 500M+ monthly API calls on Respan and runs over 1M hourly LLM calls through it, with CTO Zexia Zhang crediting the debugging layer with resolving production issues 10x faster.
Pricing starts at $0 with 100k logs, 1k scores, and 412 requests per minute of proxy throughput, which is enough to run a real workload rather than a demo. Team is $199 per month billed yearly and raises throughput to 8,400 requests per minute with 30-day retention, unlimited prompts, datasets, and evaluators. Enterprise is custom and adds self-hosting, SAML, custom retention, a 99.99% uptime SLA, and a dedicated support engineer.
Stop guessing why your LLM app broke
See what your agents actually did in one place. Respan traces every prompt, tool call, and response, tracks cost and latency, and runs evals so you can go from a bad output to the exact step that caused it.
2. OpenRouter

- Best fit: Reaching the widest model catalog through one account and one balance.
- Routing logic: Provider ordering, model fallbacks, and sorting by price, throughput, or latency.
- Deployment: Managed cloud, no self-host.
- Pricing: 5.5% fee on credit purchases, no token markup.
OpenRouter exposes 400+ models from 60+ providers behind one OpenAI-compatible endpoint. Its routing controls are the most granular in the operational category: explicit provider ordering, model fallback lists, price-based selection, throughput and latency sorting, and data policy filters that keep requests away from providers whose retention terms you have not accepted.
Every one of those inputs is observable before the request lands. None of them is observable after. A fallback fires on a 500 and stays silent on a fluent wrong answer, so anything resembling quality-based selection means running an eval platform alongside and joining its results back to OpenRouter request IDs yourself. There is no self-host option and no way to read the routing code.
The fee sits on credit purchases at 5.5% with an $0.80 minimum, which works out to 8% on a $10 top-up and a rounding error at $10,000. Tokens pass through at provider list price. Bring-your-own-key traffic is free to 1M requests a month and 5% beyond, so splitting volume across accounts costs more than consolidating it.
3. LiteLLM

- Best fit: Platform teams that want the routing layer on their own infrastructure.
- Routing logic: Ordered fallback chains, budget thresholds, round-robin load balancing.
- Deployment: Self-hosted only, MIT-licensed.
- Pricing: Free open source, custom enterprise license.
LiteLLM normalizes 100+ providers into OpenAI request and response format, as a Python SDK or a proxy server. Fallback chains are declarative, so an ordered list across Azure OpenAI, OpenAI direct, and Anthropic is config rather than application code. Virtual keys, per-project budgets, rate limits, and spend tracking all live in the proxy.
Everything routes on rules you write and maintain. Nothing inspects request content or scored output, so cost routing has to be expressed as static thresholds that go stale as model prices move. Observability with tools like LiteLLM arrives through callbacks into an external tool, which puts the trace and the routing decision in different systems by default.
One thing is worth knowing before it spreads through your org: SSO, JWT auth, audit logs with retention, RBAC, and model-specific budgets all sit behind a custom-priced enterprise license. Teams routinely find this out mid-rollout, after the free proxy is already load-bearing.
4. Portkey

- Best fit: Rule-driven routing under governance and compliance constraints.
- Routing logic: Conditional routing on request metadata, with fallbacks, retries, and circuit breakers.
- Deployment: Managed cloud, self-host via the open-source gateway or managed VPC on Enterprise.
- Pricing: Free Developer tier, $49/month Production, Enterprise custom.
Palo Alto Networks has completed its acquisition of Portkey, and Portkey is becoming the AI gateway inside Prisma AIRS. That points the roadmap at enterprise runtime security, which is good news if your buying committee includes a CISO and a reason to check the release notes if it does not.
The gateway itself is well-supplied: universal API, conditional routing on metadata and user attributes, automatic fallbacks, retries, request timeouts, circuit breakers, load balancing, simple and semantic caching, budget and rate limits. Guardrails and PII redaction run before requests reach providers. The core routing engine is open source and self-hostable.
Conditional routing in tools like Portkey is only as current as the rules someone last wrote, and there is no measured-output signal feeding the policy. Evaluation is thin next to a dedicated eval platform. If failover is the whole requirement, the volume of governance controls is setup work you did not ask for.
The Developer tier is free for 10k logs a month with 3-day log retention, and Portkey's own pricing page says it is not suitable for production. Production is $49 a month for 100k recorded logs at 30-day retention, plus $9 per additional 100k requests up to 3M. Enterprise is custom and covers 10M+ logs, VPC hosting, SSO, granular budgets, custom retention, and BAA signing.
5. Braintrust

- Best fit: Teams that will build the eval layer first and route from it second.
- Routing logic: Experiments, online scoring, and production traces feeding model selection.
- Deployment: Managed cloud, self-host on Enterprise.
- Pricing: Free Starter, $249/month Pro, custom enterprise.
Braintrust comes at routing from the opposite end of this list. It is an evaluation and observability platform, and the gateway is the newer attachment: one API across OpenAI, Anthropic, Google, Bedrock, and custom endpoints, with project-level provider keys, caching, and logging that ties routed requests to traces. Scoring covers LLM-as-a-judge, autoevals, custom code scorers, classifiers, and human review, and online scoring runs against production traces without adding request latency.
That ordering has consequences. Routing policies do nothing until the evaluation setup exists, so time-to-first-fallback is longer than on any gateway-first tool here. The gateway is in beta by Braintrust's own description, which is a live question for a component sitting in the request path of production traffic. Self-host is Enterprise only.
Starter is free with 1GB of processed data, 10k scores, and unlimited users. Pro is a flat $249 a month rather than per seat, which takes seat-count negotiation out of procurement. The gateway carries no charge during beta, so today's bill tells you nothing about what routing through it will cost once it ships.
6. Vercel AI Gateway

- Best fit: Applications already deployed on Vercel that need failover and spend visibility without new infrastructure.
- Routing logic: Provider ordering and configurable fallback models.
- Deployment: Managed cloud, no self-host.
- Pricing: $5/month in credits, then provider list price with no markup.
Vercel AI Gateway puts one key and one dashboard in front of hundreds of models across 40+ provider organizations. Fallback models are configured in the gateway instead of application code, and a degraded provider fails over to the same model served by a different one. The dashboard reports pricing, latency, throughput, tokens, and spend per model, which is table stakes among Vercel AI Gateway alternatives but well executed here.
The no-markup headline is accurate and incomplete. Tokens genuinely pass through at provider list price, including on BYOK, but three add-ons bill separately: Custom Reporting at $0.075 per 1,000 tag or user ID writes and $5 per 1,000 reporting queries, a team-wide Provider Allowlist at $0.10 per 1,000 successful requests on Pro and Enterprise, and team-wide Zero Data Retention at the same rate. At volume, those per-thousand lines are the gateway bill. Every team account gets $5 in credits a month before any of it starts.
Routing decisions come from config and operational metrics, with no scoring layer behind them. Provider credentials scope to the Vercel team, which is worth checking against stricter isolation requirements. Self-hosting is not offered.
7. Inworld Router

- Best fit: Cost-per-quality routing without writing or maintaining the rules.
- Routing logic: Request content analysis against cost, latency, and task complexity targets.
- Deployment: Managed cloud, on-prem on Enterprise.
- Pricing: Free On-Demand tier, then $25 to $1,500/month.
Inworld Router inspects each request and picks the model itself. It reads query complexity, your latency target, and your cost constraint, then routes across 220+ third-party models or Inworld's own optimized open-source models. Your application never names a model. Traffic splitting for A/B tests and multimodal routing across text, image, and audio come with it.
The classification step happens before the model call, so measure the added P95 yourself. Inworld defines what "acceptable quality" means for that decision, since there are no scorers, traces, or evals in the product for you to define it with. Source is closed and on-prem is Enterprise-only.
LLM tokens bill at provider cost on every tier, including the free one, which also includes full router access. What the subscription buys is headroom: On-Demand allows 5 concurrent requests, Creator at $25/month and Builder at $100 raise that to 10 and 50, Developer at $300 reaches 150, and Growth at $1,500 reaches 500.
8. Cloudflare AI Gateway

- Best fit: Cloudflare-resident stacks that want edge routing and spend controls at no platform cost.
- Routing logic: Provider health at the edge, with retries and model fallbacks.
- Deployment: Managed edge, no self-host.
- Pricing: Core features free on all plans.
Cloudflare AI Gateway runs the control plane on Cloudflare's edge, so the routing hop happens near the user rather than in one region. Caching, rate limiting, analytics, retries, and model fallbacks are included, and DLP scanning is free on every plan, with two predefined profiles available without a Zero Trust subscription.
Routing is health-based and config-driven, with no cost-per-quality or content-aware selection. Observability is request-level rather than token-level tracing, which is thin when you are reconstructing why an agent took a particular path.
Pricing is the strongest argument. There is no per-call gateway fee beyond your Cloudflare plan. Workers Free stores 100,000 logs total across all gateways, and Workers Paid raises that to 10,000,000 per gateway. When the cap is reached, new logs stop saving rather than generating an overage, so log volume needs active management at scale.
Route on evidence, not guesswork
Respan puts the router and the eval layer in the same platform, so a routing change and the scores that justify it live on the same request IDs. Point your client at one endpoint and see which model handled what, whether a fallback fired, and what it cost.
Common routing mistakes
Most routing failures are not exotic. They come from treating the router as solved once the first fallback works, and they surface weeks later as a cost spike, a stale answer, or a quality regression nobody can date. These seven account for most of them.
- Treating failover as the whole job. A fallback chain covers errors that return an error. It does nothing about a model that answers fluently and wrongly with a 200, which is the failure mode that reaches customers.
- Moving routing logic into gateway config. Business rules about which model serves which feature belong in application code where they are reviewed, versioned, and tested. Gateway config is the right home for provider ordering, retries, and budgets, and the wrong home for product decisions nobody can find later.
- Shipping a cost downgrade without a quality baseline. Measure the current model on real requests before routing a slice away from it. Without that number, a regression looks identical to a successful saving on the cost dashboard.
- Enabling semantic caching by default. A near-match cache hit returns a stale answer to a question that was not quite the same. Start with exact-match, validate semantic behavior against real traffic, then enable it.
- Ignoring the router's own latency. Content-aware routing adds a classification hop before the model call. Measure the added P95 against your own budget rather than the vendor's benchmark.
- Running budgets as a monthly total. One runaway agent loop drains a monthly cap in hours. Per-key and per-feature limits with alerts at a soft threshold catch it while the bill is still small.
- Leaving traffic outside the router. Calls that bypass the routing layer miss unified logs, which means the cost attribution and the quality scores describe a subset of production while reading like the whole of it.
The common thread is measurement. A router changes what your application does on every request, and without traces and scores attached to those requests, every one of these failures looks like normal operation right up until a customer finds it.
FAQ
Is an LLM router the same as an LLM gateway?
They overlap and are not identical. A gateway is the shared interface: one endpoint, authentication, key management, caching, and logging across providers. The router is the decision logic choosing where each request goes. Most production platforms ship both, which is why the terms get used interchangeably, and the difference shows up when a gateway offers only static provider ordering and calls it routing. If the interface and deployment model matter more to you than the routing decision, the best LLM gateways sort the same vendors on that basis instead.
Does model routing actually save money?
Routing cheap-capable work to a small model saves real money, but the number that counts is savings net of quality cost. A downgrade that causes retries, escalations, or human cleanup can spend more than it saved on tokens. The saving is only measurable if the same system scores output on the traffic the routing change affected.
How much latency does a router add?
A well-built router adds roughly 5 to 15ms at P95, and Respan measures around 10ms. With caching enabled, median latency often drops below the direct call because cache hits return in single-digit milliseconds. Content-aware routing is the exception, since a classification step before the model call adds its own time.
How do I route on quality instead of guesswork?
Start by scoring the current model on representative production requests so there is a baseline. Define the scorers before the routing change, run the candidate model against the same inputs, and compare. After the change ships, keep online scoring against live traces so a regression surfaces in hours rather than at the next quarterly review.
How does routing interact with caching?
A cache hit short-circuits the routing decision, so a semantic match can return an answer from a model the router would no longer have chosen. Scope caches per model or per routing policy rather than globally, and check cache status on the trace when a response looks stale relative to a recent routing change.
Can I switch routers later?
Usually, and the cost depends on how much you built against proprietary interfaces. An OpenAI-compatible router is a base URL change. Provider-specific SDK features, gateway-native config, and prompt storage inside a vendor's system are what actually take time, so keep routing rules in your own code where you can.
Should I self-host the routing layer?
Self-host when data residency or air-gapped requirements rule out cloud, and take the ops burden knowingly: deployment, scaling, patching, and dependency review on a component holding every provider key you own. Cloud is the right default otherwise, and Respan offers self-hosting on Enterprise for teams that need both.




