Rate Limiting, Degradation and Multi-Model Routing: Make Failover a Process, Not Improvisation
LLM services fail differently from traditional web apps: instances start slowly, requests are heavy, and failure modes are many (timeouts, 429, quota, OOM, full KV cache). If failures are handled by a human scrambling to switch models, recovery time depends entirely on who is on call. The right move is to write the "signal to action" decision tree in advance and let the gateway and router execute it automatically.
This article is organized in three layers: classification (what kind of failure), execution (rate limiting, circuit breaking, retry, routing) and fallback (cache, cheaper model). For the related steady-state model-tiering, see LLM cost optimization; this piece focuses on what to do when things break. Parameters and endpoints follow the vLLM documentation.
Classification: Tell Three Failures Apart; Actions Differ
Switching wrongly is worse than not switching. Spend a few seconds reading the signal:
Symptom -> what to check -> classification -> action
Request timeout / connection refused (single instance)
|-- check /v1/models health probe + per-instance error rate
`-- classification: single-instance fault -> circuit-break it out, retry a healthy replica
Many 429s / slower responses with queueing (whole chain)
|-- check global QPS, gateway queue, error rate across all replicas
`-- classification: chain-wide overload -> shed load, reject excess, stop full retries
402 / quota alerts / provider-side quota exhaustion
|-- check billing/quota APIs and provider status page
`-- classification: quota exhausted -> switch to backup model or cache, stop retrying provider
The three signals come from different layers: instance-level uses /v1/models probes and per-instance error rate; chain-level uses global QPS and queueing; quota-level uses billing and provider status. Put them on one dashboard and read this layer first during an incident instead of diving into a single error.
Execution One: Timeouts, Retry Budget and Circuit Breaking
Timeouts are the first backstop: without one, a stuck request holds a connection and a concurrency slot forever. Set an explicit timeout on every downstream call and a retry budget cap (at most two retries and a total duration under the SLA). Unbounded retry is an avalanche amplifier.
Retries only make sense for idempotent, transient faults: a single-replica timeout or connection refused can be retried; a 429 depends on whether it is one replica or the whole chain; a 402 or exhausted quota has nothing to retry. Use exponential backoff so retries do not re-flood the downstream.
Circuit breaking means "temporarily stop calling a sick downstream": when an instance's error rate or latency crosses a threshold continuously, the breaker opens and later requests go straight to the degradation path, then half-opens after a cooldown to probe recovery. The division of labour: rate limiting controls how much comes in, circuit breaking controls whether we keep calling this downstream.
Execution Two: Primary-Backup Routing and Multi-Model Split
The routing layer has two jobs: transparent to callers and dynamic by health. The trick is registering several backend instances under one external model name:
vllm serve <primary-model> --served-model-name prod-llm --port 8001
vllm serve <backup-model> --served-model-name prod-llm --port 8002
Callers always request the logical name prod-llm (exposed on the OpenAI-compatible /v1/models), and the gateway sends traffic to primary or backup according to health. Verify the configuration:
The switch decision is driven by the classification signals, not by whim: switch only after the primary has repeated timeouts or a failed health probe. After recovery, send a small trickle of traffic first before fully switching back, to avoid flapping between primary and backup.
Multi-model routing also has a steady-state use: route by task difficulty, small models for simple tasks and large models for hard ones. That uses the same routing machinery as failover — the difference is routing by request features versus switching by health. Good steady-state splitting also means the degradation path already exists when a fault hits.
Fallback: Cache and Degradation Models
When both primary and backup are down, two levels remain:
- Cache fallback: for deterministic, repetitive requests (fixed knowledge Q&A, templated summaries), a cache hit can be returned directly; label the response "from cache, possibly stale". Disable cache fallback for time-sensitive requests — returning a stale but confident answer is more dangerous than an explicit failure.
- Degradation model: switch to a cheaper or smaller but adequate model, label the model actually used so degradation share and quality regressions can be measured. Validate a minimum quality bar by task type before relying on it. Degradation is an emergency lane, not a cost-saving channel.
Both levels must be pre-drilled: regularly pull the primary out in a chaos test and watch whether traffic shifts to backup, whether cache hits as expected, and whether labels are present. An undrilled degradation path is effectively unavailable on incident day.
Three Failure Cases (Built from Typical Production Scenarios)
Case one: primary returned 429 and unbounded gateway retries took down the backup too. An internal assistant's provider limited a single replica with 429, and the gateway's retry logic had no cap. Retry traffic flooded primary and backup together, taking the whole chain down. The cause was retry amplification: a transient fault turned into sustained overload. The fix was a retry budget (at most two retries, exponential backoff) and, on chain-wide 429, stopping retries in favour of load shedding and priority drops. Lesson: retry must be bounded or it becomes the fault source.
Case two: switching backup broke callers because the external model name changed. A team replaced the primary with a different model during an incident but forgot to unify --served-model-name; callers kept asking for the old name, which no longer existed in /v1/models, and requests 404ed. The fix was registering the backup under the same logical name at startup. Lesson: the model name is a contract; failover must not change the contract.
Case three: cache fallback returned a stale answer and misled a user. A question about current stock levels hit cache fallback and returned data from half an hour earlier; the user acted on it. The cause was not distinguishing request time-sensitivity in the fallback policy. The fix was per-request-type degradation rules: time-sensitive requests fail explicitly with a retry hint rather than returning a stale fact. Lesson: degrade honestly — a clear failure beats a stale fact.
Quick Reference
| Signal | Classification | First action | Fallback |
|---|---|---|---|
| Single-instance timeout/refused | Instance fault | Circuit-break out, retry healthy replica | Degradation model |
| Many 429s + queueing | Chain overload | Shed load, stop full retries | Cache (non-time-sensitive) |
| 402 / quota exhausted | Quota out | Stop retrying provider | Switch backup provider/model |
| Primary + backup down | Total outage | Circuit-break all downstreams | Cache + explicit degrade notice |
Related
- LLM serving engine selection decision tree and throughput vs latency: stabilize the instance before planning failover.
- LLM cost optimization: steady-state model tiering (shares the routing machinery with failover).
- LLM serving OOM and avalanche recovery decision tree and LLM observability and tracing: where failure signals come from.
- vLLM serving deployment and vLLM production tuning: instance-side configuration detail.
Originality statement: The classification framework, configuration approach and cases in this article are the author's own synthesis from the official vLLM documentation and hands-on production resilience work. The three cases are built from typical production scenarios, not records of a specific customer site.