Ai Instructure

How We Designed Request Failover

Outages happen. Here's how FeatDev keeps a request alive when a provider goes down — and how we kept failover from becoming its own source of bugs.

Introduction

Every model provider has a bad day eventually — elevated latency, a spike of errors, a region going dark. If your product calls one provider directly, their bad day becomes your incident.

At FeatDev, request failover is how we keep a call alive when a provider goes down. This is how we designed it — what we detect, how we reroute, and the guardrails that stop failover from creating new problems of its own.

The Problem

Failover is well understood for stateless HTTP. Model calls break several of the assumptions that make it simple.

Common bottlenecks include:

  • Requests are long. Streaming responses run for seconds, so you can't wait for a client failure before reacting.

  • Retries are expensive. Re-running a frontier model isn't free — a blind retry can double your cost.

  • Side effects exist. Tool calls and writes mean "just try again" can repeat work that already happened.

  • "Slow" isn't "down." The hardest case is a provider that's degraded but still answering — you have to decide when to give up.

As context demand grows, these repetitive tasks become the biggest barrier to scaling.

How Failover Works

FeatDev puts a lightweight routing layer in front of every provider, so a failed request moves on without your code noticing. The layer does four things:

  • Tracks provider health from real metrics — error rate, latency percentiles, and timeout over rolling windows.

  • Trips a circuit breaker when a provider crosses a threshold, so we stop routing to it before users feel it.

  • Falls through a chain of healthy models on failure, skipping any provider whose breaker is open.

  • Retries safely with idempotency keys and a per-request budget, so a retry never produces duplicate work.

The result is that the request still completes — just on a different model.


Why It Works

The biggest improvement doesn't come from retrying faster — it comes from never sending traffic to a provider that's already failing.

Because health is measured from real requests and capped by a retry budget, a single slow provider can't back up the whole queue. And every route is logged with its reason and the model it landed on, so failover stays visible to users but fully validated.

What Changed

After rolling this out across production traffic, the outcomes were consistent:

  • Provider outages stopped reaching users — requests completed on a fallback model instead of erroring.

  • Latency stayed stable during provider incidents rather than spiking with the failing provider.

  • Every failover became traceable, so incidents were diagnosable after the fact.

  • Teams stopped hand-writing retry and fallback logic in application code.


"Automatic failover turned a provider outage into a non-event for our users. That alone justified the move."

Elena Brandt

Elena Brandt

Conclusion

Failover isn't a feature you should have to build twice. By putting health detection, fallback chains, and safe retries into the platform, a provider's bad day becomes an operational footnote instead of an incident.

Failover is built into every route on FeatDev by default — you can start free and define your first fallback chain in a few minutes.

Whether you're a solo creator or a growing marketing team, adopting an AI-powered workflow can help you publish faster, stay consistent, and scale without adding complexity.

Author
SR
Sofia Reyes

Staff Engineer, FeatDev

Staff Engineer, FeatDev

Share Article
Share Article

Create a free website with Framer, the website builder loved by startups, designers and agencies.