LLM routers explained: cost, capability, and reliability policies
An LLM router picks a model for each request by applying policies: which models are eligible, which one to try first, and what to do when it fails. How LiteLLM implements those policies, and how a strict-zero router adds a cost gate.
An LLM router is the piece of code that decides which model and provider serve each request your application sends. It does that by applying three kinds of policy in order: an eligibility policy that removes models that cannot or must not take the request, a selection policy that ranks the models left, and a failure policy that says what happens when the chosen one errors, times out, or rate-limits. Comparing routers is mostly comparing those three policies and who keeps them correct over time.
This guide takes each policy in turn, uses LiteLLM’s routing documentation as the reference implementation, and then shows what changes when cost is a hard gate instead of a ranking signal, as in Ficelle’s strict-zero routing.
What does an LLM router decide on each request?
A model router sits behind one endpoint and answers four questions per request:
- Which models are allowed? Price, region, context window, and required capabilities such as tool calling or JSON output.
- Which allowed model goes first? Random with weights, lowest latency, lowest usage, fewest in-flight calls, or lowest cost.
- What counts as a failure, and for how long? A 429, a timeout, a 404 on a retired model ID, a context-length error.
- Where does the request go next? Another deployment of the same model, a different model, or an explicit error.
An LLM gateway usually wraps a router with compatibility, analytics, and governance layers; the LLM gateway guide maps those layers. This article stays on the routing decision itself.
Selection strategies: how LiteLLM ranks candidates
LiteLLM’s routing documentation is one of the clearest public descriptions of AI model routing strategies, and its Router is a good fit if you want to own and host the routing logic yourself. On the page as read on 10 November 2026, the strategies are:
| Strategy | How it picks a deployment |
|---|---|
simple-shuffle | The default, described as “Default and Recommended for Production.” Weighted by rpm/tpm or an explicit weight, random if none is set. |
Usage-based (usage-based-routing-v2) | Drops deployments over their tpm/rpm limits, then picks the one with the lowest TPM usage for that minute. The page advises against it in production because of the Redis overhead. |
| Latency-based | “Picks the deployment with the lowest response time”, averaged over a time window, with a buffer that widens the candidate set. |
| Least-busy | The deployment with the fewest calls in flight. |
| Cost-based | The lowest-cost deployment among those under their limits. |
| Custom | Your own selection function. |
One detail of the cost-based strategy shows why cost-aware LLM routing needs accurate data: deployments missing from LiteLLM’s cost map are treated as costing $1, so a model with an unknown price is ranked as expensive rather than excluded. Cost here is a ranking signal. If every cheap deployment is cooling down, the router still sends the request to whatever is left, including a paid one.
Eligibility gates: what removes a model before ranking
Ranking only works on candidates that can do the job. LiteLLM’s enable_pre_call_checks=True filters out deployments whose context window is smaller than the request and deployments outside a required region such as eu. That covers two gates. Agents usually need more:
- Capability gates. A request that carries tools should only reach models that call tools; a request that asks for a schema should only reach models that return valid JSON. Catalog metadata often claims capabilities a model does not deliver, so a gate based on measured behavior is stricter than one based on the provider’s model list.
- Cost gates. A request can be restricted to models with free pricing. This is a filter applied before ranking, which is different from ranking by cost.
- Account gates. A model ID in a provider catalog does not prove your key can call it. Quotas are often scoped to an organization or project, so a second key may add no capacity.
Ficelle’s model profiles list the gates each virtual model applies, and a request picks a profile by ID, for example ficelle/auto-tools, ficelle/auto-json, or ficelle/auto-fast.
Failure policy: cooldowns, retries, and fallbacks
The failure policy is where most of the reliability of a router lives. LiteLLM documents three mechanisms:
- Cooldowns. With
allowed_failsunset, a deployment goes on cooldown after a 429, after more than 50% of its calls fail in the current minute, or after a 401, 404, or 408. The defaultcooldown_timeis 5 seconds, and both values can be overridden per deployment. - Retries.
num_retriessets the attempt count; rate-limit errors are retried with exponential backoff and other errors immediately. ARetryPolicysets retry counts per error type. - Fallbacks. Generic
fallbacksapply once a model group’s deployments are exhausted. Deployments can be ordered so that order 1 is tried before order 2, andcontext_window_fallbacksroute context-length errors to models with more room.
Two points are worth checking in any router. First, a 5-second cooldown suits a per-minute throttle but not a daily quota that resets hours later; the LLM fallback guide shows how Groq, Gemini, and OpenRouter signal the difference. Second, a fallback list is only as safe as its last entry. If that entry is a paid model, an exhausted free tier becomes a bill.
Providers also change underneath the policy: models are retired, quotas tighten, and capabilities drift. Provider breakage is why a router configured once and never revisited slowly fills with dead routes.
Cost as a hard gate: strict-zero routing
Ficelle is a local, OpenAI-compatible LLM router for free models. It runs on your machine, exposes an endpoint at http://127.0.0.1:8646/v1 (a local endpoint, not a hosted public API), keeps provider keys local, and sends prompts directly to the chosen provider.
Its cost policy removes paid models before any ranking happens. Under strict-zero routing, paid fallback is hardcoded off in the code: allow_paid_fallback is false, the core refuses to start if its configuration claims otherwise, and any model reporting billing is quarantined out of the free pool. The failure policy follows from that gate:
- On a rate limit, the model is marked as cooling down, the best working free alternative is tried, and the limited model is probed until it recovers.
- When another eligible model is available, the agent receives that model’s response instead of the 429.
- When no eligible free model can serve the request, Ficelle returns an error rather than spending money.
That last behavior is a trade-off you should weigh. Your agent has to handle an explicit error when the free pool is exhausted, where a router with a paid tail would have answered. Quota providers also remain subject to their own account billing settings, so keep those accounts within their free allocation.
Quality limits a router cannot fix
A router chooses among models; it does not make them equal. In Ficelle’s 76-task benchmark against gpt-5, free routing was quality-safe on 100% of classification tasks, 95% of JSON extraction tasks, and 94% of reasoning and code tasks. Polished long-form writing was the exception: paid models won 50% of those tasks. Keep customer-facing writing on a paid model or edit it by hand, whichever router you use.
How to choose an LLM router
Match the router to the policy you need to enforce:
- You need central policy across teams and providers you pay for. A self-hosted router such as LiteLLM gives you the selection strategies above, per-deployment cooldowns, and ordered fallbacks under your control.
- You need every request to stay free, with failover across free providers. Look for a cost gate enforced in code, capability gates based on measured behavior, and a clear error when nothing eligible remains.
- In both cases, ask who maintains the provider list. Model IDs, quotas, and pricing change continuously, and the policy is only as good as the data it runs on.
Ficelle’s routing core is free and source-available under the Business Source License 1.1, with OpenRouter and Nous as reference providers. Ficelle Pro adds the full curated provider pool, with fixes when a provider breaks and one-command updates of the provider pack. If keeping that list current is the part you would rather not own, see Ficelle Pro pricing.