route-switch

Multi-provider failover

route-switch fronts six providers behind one OpenAI-compatible endpoint and falls back to the next eligible combination when a provider's success rate drops below a threshold — turning provider switching from a deploy into a policy.

For: Platform & reliability engineers

A single provider is a single point of failure. When OpenAI has a bad hour, an application wired directly to its SDK has a bad hour too. route-switch makes provider redundancy a configuration property instead of a code path.

The shape

Register the same prompt against multiple providers as separate combinations, mark resilient ones as fallback: true, and let the load balancer route. When a combination’s recent success rate drops below its threshold, the balancer moves to the next eligible combination — see choosing a routing strategy.

combinations:
  - prompt: support-reply
    provider: openai
    model: gpt-4
    weight: 3
  - prompt: support-reply
    provider: anthropic
    model: claude-3-5-sonnet
    weight: 1
    fallback: true

Why a gateway, not an if-tree

A hand-rolled if (openaiDown) branch welds fallback logic into every service, scatters provider credentials, and requires a deploy to change. The gateway lifts all three: fallback is a policy, credentials live in one place, and switching providers is a config edit. Pair it with trace capture so you can see which combination actually carried traffic during an incident.

route-switch is self-hosted and MIT-licensed, built by Skelf Research.

Frequently asked questions

How does failover trigger?

Each combination has a success-rate threshold. When a combination's recent success drops below it, the load balancer redirects to the next eligible combination automatically — no deploy, no code change.

Do I need accounts with every provider?

Only the ones you route to. route-switch is bring-your-own-key: you supply credentials per provider in config.yaml for the providers you actually use.

Related

Run route-switch today

Open source, MIT licensed. One binary, one endpoint, your providers.