Active-active vs active-passive failover for LLM traffic

Comparison · Gateways

Active-active and active-passive are the two standard ways to build failover: in active-active, every target serves live traffic at the same time, and in active-passive, one primary serves all traffic while a standby waits for it to fail. The active-active vs active-passive decision applies to LLM traffic as directly as it does to databases and load balancers, except that the targets are API keys, deployments, and providers. This comparison defines both models, weighs their quota, latency, cost, and failure-mode trade-offs for model calls, and shows each configured in Bifrost, an open-source AI gateway by Maxim AI.

The guide focuses on the architecture choice and leaves routing strategies, fallback error handling, and load-balancing algorithms to the LLM routing guide. It belongs to the AI gateways and LLM routing hub.

What do active-active and active-passive mean?#

Active-active is a high-availability design in which every node or endpoint serves live traffic at once, so losing one only shifts its share to the others. Active-passive is a design in which one primary serves all traffic and a standby takes over only after the primary fails.

In an active-passive setup, failover is a sequence: detect that the primary failed, select or promote the standby, and redirect traffic. Its speed depends on the standby: a hot standby can serve at once, a warm one needs warming or scaling first, and a cold one has to be started.

An active-active architecture removes the switchover step, but it needs a rule for splitting traffic, such as fixed weights or measured latency, and spare capacity on the remaining targets to absorb a failed target's share. Databases also need conflict resolution for concurrent writes, which is why many database teams choose active-passive. Model API calls carry no shared write state, so that obstacle does not apply to LLM traffic.

Two setups side by side: in active-active a gateway splits live traffic 70/30 between two providers; in active-passive the primary takes all traffic and a standby waits. Active-activeActive-passiveGatewayWeighted selectionProvider AWeight 0.7Serving trafficProvider BWeight 0.3Serving trafficGatewayOrdered fallback chainPrimaryAll trafficRetried on errorsStandbyNo trafficuntil failover70%30%100%after retries fail
Figure 1: Active-active splits live traffic across targets by weight; active-passive sends everything to the primary and uses the standby only after the primary fails.

Active-active vs active-passive compared#

Active-active uses all paid-for capacity all the time and fails over without a switchover step, at the cost of more complex traffic splitting. Active-passive is simpler to operate and rehearse, but it pays for standby capacity that serves nothing in normal operation, and it fails over only after detecting the failure.

Active-active Active-passive
Backup capacity Serving traffic Idle until failover
Failover step None; traffic already flows to every target Detect the failure, then redirect to the standby
Capacity needed after a failure Remaining targets absorb the failed share The standby absorbs 100% of traffic
Proof that the backup works Continuous, from live traffic Only during drills or real incidents
Operational complexity Higher: splitting rules and consistency across targets Lower: one active path
Cost profile Pays for every target and uses all of them Pays for standby capacity as insurance

The two models are not exclusive: large systems often run active-active at one layer and active-passive at another, which is where most LLM setups end up.

What changes when the targets are LLM providers#

For LLM traffic, the targets are API keys, provider accounts, cloud deployments, regions, and whole providers, and the team running the application operates none of them. That changes four assumptions from classic high availability: whether replicas are identical, where capacity limits sit, how the system learns that a target has failed, and where state lives.

Most teams make the active-active vs active-passive choice in an AI gateway, the layer covered in what an AI gateway is. The differences that matter for failover:

  • Targets are not always identical. The same model name on two providers can differ in version, defaults, or content filters, and a fallback to another model family changes the output. Microsoft's gateway architecture guide advises load balancing or failing over only between endpoints that run the same model at the same version.
  • Capacity is quota, not hardware. A standby endpoint on a multi-tenant API never has to boot, but the account's rate limits decide whether it can absorb the primary's load.
  • Health is hard to probe. The same Microsoft guide notes that many AI services offer no dedicated health check endpoint and that synthetic test requests consume model capacity, so it recommends treating 429, 500, and 503 responses as the signal to stop sending traffic to a backend for a while.
  • State lives in caches and conversations. Prompt caching is scoped to a provider and usually to an account, so a conversation spread across targets misses the cache it warmed on the previous turn.

Active-active load balancing for LLM traffic#

Active-active load balancing for LLM traffic sends each request to one of several endpoints that serve the same model, chosen by weight, latency, or remaining quota. A failed endpoint loses only its share of requests, and the gateway retries that share on the others. It works at two levels: keys within one provider, and providers that serve the same model.

LLM load balancing across keys or deployments of one provider changes nothing about the model, so it is the cheapest form of active-active. Keys in one account usually share that account's limits, as the trade-offs section shows, so they spread credential risk, such as a revoked key, more than they add capacity. Deployments in separate quota pools, such as separate Azure subscriptions, add both.

Load balancing across providers that serve the same model, such as OpenAI models on OpenAI and Azure OpenAI, or Claude models on Anthropic's API, Amazon Bedrock, and Google Vertex AI, adds a second vendor's capacity and incident history to normal traffic. An hour of errors at one provider then affects only its weighted share. The LLM routing layer picks each request's target; the routing guide covers algorithms such as least-busy and latency-based routing.

Active-passive failover for LLM traffic#

Active-passive failover for LLM traffic is an ordered fallback chain: the gateway sends every request to the primary, retries it there, and moves to the next target only after the primary has failed. The standby can be another key, a pay-as-you-go deployment behind reserved capacity, a different provider, or a different model family.

LLM stacks use two kinds of passive standby:

  • Capacity spillover. Reserved capacity serves first, and a pay-as-you-go deployment takes the overflow. Microsoft's guide describes slightly underprovisioning an Azure provisioned deployment and letting the overflow burst to a standard deployment.
  • Survival fallback. A different provider or model family sits behind the primary for incidents that affect one vendor. It changes the tokenizer, the price, and the style of the answer, which is acceptable for an hour and a poor fit for steady traffic.

A cold standby has a quota problem of its own. Anthropic's rate limit documentation describes ramp limits: an organization's per-minute usage of a model can grow only a step above its recent peak, so a sharp increase can return 429 errors even while usage is under the organization's rate limits. A standby that sees no traffic until an incident starts near its floor and then receives the primary's full load, which is the pattern ramp limits slow down. Check each standby provider's limits before sizing a passive chain.

Which errors should send a request down the chain is a model failover design question that the LLM routing guide covers in its section on fallback chains.

Trade-offs: quota, latency, cost, and failure modes#

Active-active spends capacity evenly and finds broken targets early, but mixes several providers' latency, prices, and behavior into normal traffic. Active-passive keeps normal traffic uniform, but fails over late, slowly, and onto capacity that has not served real requests. The table and subsections cover each trade-off.

Dimension Active-active (weighted load balancing) Active-passive (fallback chain)
Rate limits and quota Uses several quota pools at once, if they are separate The standby's quota sits unused until the primary fails
Latency during an incident Only the failed target's share waits for retries Every request waits for the primary's retries and backoff
Cost per token Blended across targets by weight The primary's price, except during incidents
Output consistency Varies if targets differ in model version or filters Uniform until failover
Prompt cache hit rate Lower unless sessions stick to one target Highest, on the primary
Confidence in the backup Proven by live traffic Unknown until an incident or a drill

Rate limits and quota#

Provider rate limits sit at the account level, not the key level. As of November 2026, OpenAI sets its rate limits per organization and project for each model, and Anthropic sets them per organization for each model class. Microsoft's guide notes that Azure standard quota is scoped to the subscription, so balancing across standard deployments in one subscription adds no throughput. Extra keys add headroom only when they draw on separate pools.

Active-active across separate pools uses several rate limits at once and reaches 429 errors later. Active-passive leaves the standby's pool idle while the primary is throttled, and the fallback starts only after the primary's 429 responses have used up its retries.

Latency during failover#

Active-passive adds its latency at the worst moment. A request that fails over pays for every attempt on the primary, including backoff, before the first fallback starts. In Bifrost, with max_retries set to 3 and the default backoff of 500 ms doubling toward a 5,000 ms cap, the backoff alone comes to about 3.5 seconds. A timeout costs more than an error, because each attempt waits out the request timeout.

Timeline of one request: four failed primary attempts separated by backoff waits of 500, 1,000, and 2,000 milliseconds, then a successful fallback attempt starting after 4.7 seconds. 0ms1500ms3000ms4500ms6000msPrimary attempt 1503BackoffPrimary attempt 2503BackoffPrimary attempt 3503BackoffPrimary attempt 4503Fallback attempt200Fallback starts
Figure 2: An illustrative active-passive failover with three retries on the primary, using Bifrost's default backoff without jitter and assuming each failed attempt takes 300 ms.

Active-active limits that delay to the failed target's share. If a provider with a 0.3 weight starts returning 503 errors, the other 70% of requests see no change, while the 30% pay the same retry path. Lowering max_retries on a provider that has fallbacks trades recovery from brief errors for faster failover.

Cost per token#

Active-passive is cheapest when the primary is the cheapest option the team trusts, because the standby's price applies only during incidents. Active-active pays a blend set by the weights: splitting one model across keys of one provider costs nothing extra, while splitting it across two providers that price it differently moves the average toward the more expensive one.

Output consistency and caching#

Active-passive is more consistent in normal operation, because every request reaches one model on one provider, so evals and prompt tuning reflect one system. If code parses the output, for example through structured outputs, keep active-active within one model version and reserve other models for the passive chain, so format drift appears only during incidents.

Failure modes#

Two failure modes deserve planning. A fallback with an expired key or a deleted deployment fails only when it is needed, while active-active finds the same fault from a small share of normal traffic. Retries also multiply across a chain: in Bifrost, a primary and two fallbacks that each allow three retries can make up to 12 attempts for one request, adding load to providers that are already failing.

Active-active vs active-passive: how to choose#

Choose active-active where targets are interchangeable, meaning the same model at the same version, and where quota or availability is the constraint. Choose active-passive where the backup differs in model, price, or data handling, so that it should serve traffic only when the primary cannot. Most production setups need both, at different layers.

Situation Choose Reason
Keys or deployments of one model in separate quota pools Active-active Same model, and the quota pools add up
Several keys in one provider account Active-active, for credential resilience The account's rate limits are shared
The same model and version on two providers Active-active, if mixed latency is acceptable Each provider holds only part of the traffic during its incidents
A backup from a different model family Active-passive Output changes only during incidents
Data residency or a contract limits providers Active-passive among compliant providers The backup must meet the same terms

The layered setup that follows from these rules has three parts:

  1. Active-active across keys or deployments within each provider, ideally in separate quota pools.
  2. Active-active across providers that serve the same model version.
  3. A short active-passive chain to a different provider or model family.

Microsoft's guide describes a comparable layering for Azure: active-active gateways in two regions, each with an active-passive path from a provisioned model deployment to a standard one.

Configuring active-active in Bifrost#

Bifrost implements active-active at two levels. Provider keys carry weights and are chosen by weighted random selection, and a virtual key's provider configs carry weights that split one model's traffic across providers. Both are part of the open-source gateway and can be set in the web UI, through the API, or in config.json.

Weighted keys within one provider#

A weighted key configuration in config.json splits OpenAI traffic 70/30 between two keys:

{
  "providers": {
    "openai": {
      "keys": [
        {
          "name": "openai-key-1",
          "value": "env.OPENAI_API_KEY_1",
          "models": ["*"],
          "weight": 0.7
        },
        {
          "name": "openai-key-2",
          "value": "env.OPENAI_API_KEY_2",
          "models": ["*"],
          "weight": 0.3
        }
      ]
    }
  }
}

The key load balancing rules decide which keys are eligible and how one is picked:

  • A key whose models list does not include the requested model is excluded. An empty list denies every model, and ["*"] allows all of them.
  • A key with weight 0 is not picked while another eligible key has a positive weight, but still serves when it is the only key left, which makes 0 a way to drain a key before removing it.
  • A retry after a per-key failure, such as a rate limit, draws from the keys not yet tried; a retry after a network error or a 5xx response reuses the same key.

Weighted providers on a virtual key#

Provider-level weights live on a virtual key. This virtual key with weighted provider configs sends gpt-4o traffic 80% to Azure and 20% to OpenAI:

{
  "governance": {
    "virtual_keys": [
      {
        "id": "vk-prod-main",
        "provider_configs": [
          {
            "provider": "openai",
            "allowed_models": ["gpt-4o", "gpt-4o-mini"],
            "key_ids": ["*"],
            "weight": 0.2
          },
          {
            "provider": "azure",
            "allowed_models": ["gpt-4o"],
            "key_ids": ["*"],
            "weight": 0.8
          }
        ]
      }
    ]
  }
}

Weights are normalized across the providers that allow the requested model, so gpt-4o splits 80/20 while gpt-4o-mini goes only to OpenAI. Before the weighted pick, Bifrost filters out providers that have reached the budget or rate limit set on their provider config. key_ids: ["*"] allows every key for that provider; an empty or omitted list blocks all of them.

Weighted selection applies only to a bare model name such as "gpt-4o". A request for "openai/gpt-4o" bypasses the weights, so application code that hardcodes provider prefixes gets no active-active behavior from this config. A provider whose weight is omitted stays out of weighted selection but can still serve direct requests and explicit fallbacks, which makes it a passive standby.

Keeping sessions on one target#

Active-active spreads a conversation across targets unless something keeps it in place. Session affinity keeps a conversation or agent run on the provider and key that served its previous turn, so it keeps hitting the prompt cache it warmed. Bifrost reads the session from an x-bf-session-id header or from the session headers that coding agents such as Claude Code already send.

Configuring active-passive in Bifrost#

Bifrost implements active-passive with fallback chains. A request can name its standby targets in a fallbacks array, or a virtual key with weighted providers builds the chain automatically. Each target gets its own retry budget, set per provider, so the retry settings decide how long the primary holds a request before the standby sees it.

Retries are set per provider in network_config: max_retries defaults to 0, and the backoff starts at retry_backoff_initial (500 ms) and doubles up to retry_backoff_max (5,000 ms), with up to 20% jitter. Each extra retry on the primary protects against brief errors and delays failover by one more backoff step.

An explicit fallback chain#

The fallbacks array lists provider/model strings in order. The model names in this request are older examples, so substitute current ones:

curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "Explain quantum computing in simple terms"
      }
    ],
    "fallbacks": [
      "anthropic/claude-3-5-sonnet-20241022",
      "bedrock/anthropic.claude-3-sonnet-20240229-v1:0"
    ],
    "max_tokens": 1000,
    "temperature": 0.7
  }'

The rules that matter when planning a passive chain:

  • Bifrost tries each fallback in order and returns the first success. If every target fails, it returns the primary's error, not the last fallback's.
  • Fallbacks do not run when the caller cancels the request or when a plugin sets AllowFallbacks = false on the error.
  • Routing runs once, before the primary attempt. Per-attempt plugins run again on each fallback, so virtual key budgets and rate limits, semantic caching, and logging all apply to the standby.
  • A fallback drops key pins and caller-supplied direct keys, and runs on the fallback provider's own stored keys.

Automatic fallbacks from provider weights#

A request to a virtual key with weighted providers and no fallbacks array gets a chain built from the providers that have a weight, sorted from highest weight to lowest. With the 80/20 config above, a request routed to Azure becomes azure/gpt-4o with openai/gpt-4o as its fallback, so one config gives both behaviors.

An explicit fallbacks array replaces the automatic chain. For the layered setup, send a bare model name so the weights pick the primary, then list the same model on the other provider first and a different model family after it. If the weighted pick already landed on that provider, the first fallback repeats it, so keep the chain short.

Capacity spillover with the circuit breaker#

Bifrost Enterprise adds a circuit breaker for planned active-passive spillover. A policy watches one provider and model's response headers and, when a signal matches, opens the circuit for a cooldown (30 seconds by default), sending later requests straight to the fallback. This policy moves traffic from an Azure provisioned deployment to a pay-as-you-go one when Azure reports spillover:

{
  "circuit_breaker_config": {
    "policies": [
      {
        "name": "azure-gpt4o-ptu-spillover",
        "enabled": true,
        "primary_provider": "azure",
        "primary_model": "gpt-4o-ptu",
        "fallback_provider": "azure",
        "fallback_model": "gpt-4o-paygo",
        "condition": {
          "operator": "OR",
          "signals": [
            {
              "source": "response_header",
              "header_name": "X-Ms-Is-Spilled-Over",
              "header_value": "true"
            }
          ]
        },
        "default_cooldown": "30s"
      }
    ]
  }
}

After the cooldown, the next request to the primary acts as a probe. While the circuit is open, requests skip the retry delay that a plain fallback chain charges each request.

Adaptive routing and active-active gateway clusters#

Static weights treat a failing target the same as a healthy one until someone edits the config. Bifrost Enterprise adds adaptive routing, which chooses providers and keys from live traffic, and cluster mode, which runs the gateway itself as an active-active cluster so that the failover layer is not a single point of failure.

Adaptive routing picks the healthiest provider for requests that name none and picks keys by live health, latency, and load. While adaptive key selection is on, configured key weights are not used, so a key leaves rotation by being disabled. Adaptive routing sends no health checks or test calls of its own; everything it knows comes from live traffic, which works around the missing health endpoints described earlier. Each node scores providers from its own traffic and recalculates every few seconds, while a key that a provider refused is held on every node.

The gateway needs its own redundancy, which is a separate layer from provider failover. Bifrost's cluster mode runs the gateway as an active-active cluster of peer-to-peer nodes that synchronize state over a gossip protocol, so traffic keeps flowing when a node fails and deployments roll out without downtime.

Failover settings sit beside the rest of the gateway's policy. Bifrost applies governance and security controls, such as virtual keys, budgets, guardrails, and audit logs, centrally, and Bifrost Edge extends the same governance and security to AI traffic on employee machines, with endpoint enforcement on each device.

Testing and monitoring failover#

Both failover models need evidence that they work. Active-active produces that evidence from normal traffic, so the job is watching per-target error rates and latency. Active-passive produces it only during incidents, so the job is to send test traffic through every standby and to alert when the fallback rate rises above its baseline.

Signals worth tracking per route:

  • Fallback rate. On gateway routes, each Bifrost response carries extra_fields.routing_info with the serving provider and model, an is_fallback flag, and the primary provider and model; drop-in SDK routes report them in response headers. In a healthy active-passive setup the fallback share sits near zero, so a rise is the early sign of a failing primary.
  • Failure class per attempt. Each failed attempt is recorded with a failure_class, such as rate_limit, quota, credential, transient, or timeout. Rate-limit failures concentrated on one key suggest its weight is too high for its quota pool.
  • Per-target latency. In an active-active split, lower a degrading provider's weight before it fails outright.
  • Standby drills. Send a small scheduled request to each standby with an explicit provider/model prefix, which bypasses the weights, so an expired key or a missing deployment shows up before an incident does.

For LLM traffic, the active-active vs active-passive question has a layered answer: balance load across endpoints that are truly interchangeable, and keep a short passive chain for everything that is not. The AI gateways directory lists gateways that implement both models, the Bifrost vs LiteLLM comparison covers two open-source options in depth, and the LLM observability guide covers the tracing these signals feed into.

Teams evaluating Bifrost for either failover model can request a Bifrost demo or review its enterprise scalability features.

Frequently asked questions

What is the difference between active-active and active-passive?

In active-active, every node or endpoint serves live traffic at the same time, so a failure only shifts the failed target's share to the others. In active-passive, one primary serves all traffic and a standby takes over only after the primary fails, which requires detecting the failure and redirecting traffic. Active-active uses all capacity continuously, while active-passive is simpler to run but leaves standby capacity idle.

Which is better, active-active or active-passive?

Neither is better in general. Active-active suits interchangeable targets and workloads where capacity or fast failover matters, because healthy targets already carry traffic. Active-passive suits backups that differ from the primary, such as a different model family or a more expensive provider, because they should serve traffic only during incidents. Many production systems run active-active at one layer and active-passive at another.

Which has faster failover, active-active or active-passive?

Active-active usually fails over faster, because the remaining targets are already serving and only requests on the failed target need to move. Active-passive waits until the failure is detected, which in an LLM gateway means the primary's retries and backoff run first. With three retries and Bifrost's default backoff, the waits alone add about 3.5 seconds before the first fallback attempt.

Can you use active-active and active-passive together?

Yes, and most LLM setups should. A common layering runs active-active load balancing across keys or deployments that serve the same model version, then an active-passive fallback chain to a different provider or model family. Microsoft's Azure gateway guidance describes a similar pattern: active-active gateways across regions, each with active-passive failover from a provisioned model deployment to a standard one.

Is active-active more expensive than active-passive?

It depends on what the standby costs. For LLM APIs billed per token, an idle passive standby costs nothing, while active-active pays a blended price set by the weights. Splitting traffic across keys of one provider adds no cost, but splitting it across providers with different prices moves the average toward the more expensive one. Reserved capacity reverses the logic, because unused reservations are paid for anyway.

Do more API keys increase LLM rate limits?

Only when the keys draw on separate quota pools. As of November 2026, OpenAI applies rate limits at the organization and project levels, Anthropic applies them per organization, and Azure applies standard quota per subscription. Several keys inside one of those pools share its limits, so load balancing across them spreads the risk of a revoked or misconfigured key but does not add throughput.

Terms in this guide

Cite this guide

The AI Engineering Editors. "Active-active vs active-passive failover for LLM traffic." The AI Engineering, updated Nov 26, 2026. https://theaiengineering.com/articles/active-active-vs-active-passive

Title
Active-active vs active-passive failover for LLM traffic
Author
The AI Engineering Editors
Publisher
The AI Engineering
Published
Updated
View as Markdown

The AI Engineering Editors ·