Model fallback configuration
Model fallback lets a backup language model take over automatically if your primary model fails, so the call can keep going. You can configure fallback models for the OpenAI and Anthropic Bedrock providers. Vapi models fall back automatically, so you don’t configure fallback models for them.
How it works
When a model failure occurs, Vapi will:
- Detect the failure of the primary model.
- If
fallbackModelsis configured, choose a fallback model.
Fallback models stay on the same provider as your primary model. To protect against a provider-wide outage, pair model fallback with voice fallback and transcriber fallback on the other two pipeline components, which do support cross-provider fallback.
Configure via Dashboard
You can configure a fallback model for Anthropic Bedrock in the Dashboard. To configure OpenAI fallback models, use the API.
Configure via API
Add the fallbackModels field directly to your assistant’s model object, next to model.model. Models don’t use a fallbackPlan wrapper like voice.fallbackPlan.voices and transcriber.fallbackPlan.transcribers.
OpenAI
Set model.fallbackModels to an array of OpenAI model IDs. If the primary model fails, these models are tried, starting with the one expected to respond fastest. Configured fallback models might not be enabled for every account. See fallbackModels for OpenAI in the API reference.
Most assistants don’t need fallbackModels. The fastest fallback models that suit your primary model are found automatically.
Anthropic Bedrock
Set model.fallbackModels to an array with one Claude model ID available through Bedrock. Bedrock accepts at most one fallback model. See fallbackModels for Anthropic Bedrock in the API reference.
Verify the configuration
Retrieve the assistant with Get Assistant and confirm that model.fallbackModels lists your fallback models.
FAQ
Can I fall back from one provider to a different provider, like voice and transcriber fallback do?
Not yet. fallbackModels only lets you specify backup models from the same provider as your primary model. Use voice fallback and transcriber fallback to protect those two pipeline components against a provider-wide outage.
Does fallback affect pricing?
Each model is billed at its normal rate. If the primary model uses tokens before it fails, that usage can be included in the call’s cost along with the fallback model’s usage.
Why am I not seeing a fallbackModels option for my provider?
fallbackModels is currently only available on OpenAIModel and AnthropicBedrockModel.
Can I use model fallback with GPT-Live?
No. GPT-Live doesn’t support model fallbacks, and a GPT-Live model can’t be a fallback model. See GPT-Live configuration.