LLM failover: keep AI features up when a provider goes down
When an AI provider has an outage or rate-limits you, every app on it breaks. How LLM failover works, what to fail over to, and where to put it.
LLM failover means automatically sending a request to a different provider, model or server when the first one fails, is overloaded or rate-limits you. Without it, a provider outage takes down every app that depends on that provider. With it, users see a slightly different model or a slightly slower answer instead of an error. The simplest place to set it up is a gateway in front of all your models.
Updated 3 December 2026.
What can fail
| Failure | What you see | Good response |
|---|---|---|
| Provider outage | 5XX errors or timeouts | Retry on another provider |
| Rate limit on your account | 429 errors | Move to another provider or key, or wait |
| Overloaded self-hosted server | Slow responses, queueing | Send to another server or a vendor |
| Unhealthy server | Errors or no response | Take it out of rotation |
Three kinds of fallback
- Same model, different provider. Many open models are served by several providers. If one is down, another serves the same model.
- Different model. If your first-choice model is unavailable, fall back to a comparable one. Check that answers are good enough for the feature.
- Different location. Your own GPUs first, then a vendor. Or one vendor's region, then another.
How gateways handle it
Most gateways let you define an ordered list of destinations and try the next one on failure. A few examples from vendor docs:
- Databricks' legacy AI Gateway falls back on 429 or 5XX errors to the next external model listed, up to two fallbacks (Databricks).
- Vercel AI Gateway supports provider ordering and model fallbacks, and logs every routing attempt (Vercel).
- Cloudflare AI Gateway offers retries, model fallbacks and dynamic routes (Cloudflare).
- Kong AI Gateway fails over to another provider or model when one is slow or unavailable (Kong).
- AI Gateway by LayerX checks every provider on a schedule. If one is down, overloaded or rate-limited, requests move to the next one automatically and unhealthy providers are taken out of rotation (product page).
Health checks beat retries
Retrying after a failure costs the user time. Checking providers in the background, and removing unhealthy ones before requests reach them, avoids the failed attempt altogether. Look for a gateway that does both: health checks to steer traffic, and retries for the failures that slip through.
Things to decide up front
- Which models are acceptable substitutes for each feature.
- How long to wait before giving up on a provider. Long timeouts on streaming responses need care.
- Whether to retry on 429. Sometimes waiting is better than switching to a more expensive model.
- How to record what happened. Log which provider actually served each request, so cost reports and debugging are accurate.
Failover with your own GPUs
If you run models on your own servers, failover works in both directions: your GPUs first, a vendor when they're busy or down. That keeps paid tokens for the moments you need them. More in use your GPUs first and vLLM router for balancing many replicas of one model.
Questions
What is the difference between failover and load balancing?
Load balancing spreads normal traffic across healthy destinations. Failover moves traffic away from a destination that fails. Most gateways do both.
Should I fail over to a different model?
Only to models you've tested for that feature. Same-model fallback across providers is safer when it's available.
Can I fail over from OpenAI to my own models?
Yes, if your own models are behind the same gateway and good enough for the task. The reverse, own GPUs first and OpenAI as backup, saves more money if you already own the hardware.
Does failover change my costs?
It can. A fallback provider or model may cost more. Track which provider served each request.