Automatic failover between AI providers and models. When your primary provider fails, Bifrost seamlessly switches to backup providers without interrupting your application.
Fallbacks provide automatic failover when your primary AI provider experiences issues. Whether it’s rate limiting, outages, or model unavailability, Bifrost automatically tries backup providers in the order you specify until one succeeds.When a fallback is triggered, Bifrost treats it as a completely new request - all configured plugins (caching, governance, logging, etc.) run again for the fallback provider, ensuring consistent behavior across all providers.
When you configure fallbacks, Bifrost follows this process:
Primary Attempt: Tries your main provider/model first
Automatic Detection: If the primary fails (network error, rate limit, model unavailable), Bifrost detects the failure
Sequential Fallbacks: Tries each fallback provider in order until one succeeds
Success Response: Returns the response from the first successful provider
Complete Failure: If all providers fail, returns the original error from the primary provider
Each fallback attempt is treated as a fresh request, so all your configured plugins (semantic caching, governance rules, monitoring) apply to whichever provider ultimately handles the request.
Certain provider-specific errors marked as non-retryable
Plugin Execution:
When a fallback is triggered, the fallback request is treated as completely new:
Semantic cache checks run again (different provider might have cached responses)
Governance rules apply to the new provider
Logging captures the fallback attempt
All configured plugins execute fresh for the fallback provider
Plugin Fallback Control:
Plugins can control whether fallbacks should be triggered based on their specific logic. For example:
A custom plugin might prevent fallbacks for certain types of errors
Security plugins might disable fallbacks for compliance reasons
When a plugin determines that fallbacks should not be attempted, it can prevent the fallback mechanism entirely, ensuring the original error is returned immediately.This ensures consistent behavior regardless of which provider ultimately handles your request, while giving plugins full control over the fallback decision process. And you can always know which provider handled your request via extra_fields.