Skip to main content
Every reply tries the agent’s own model first. That is the model in llm.model or llm.custom on the configuration. Fallback decides what happens when that attempt produces no reply:
  • The provider returns an error.
  • The model takes too long.
  • The response stream breaks off with nothing in it.
Instead of the call going silent, the platform retries the reply on another model. A switch only affects the reply that failed. The next reply tries the agent’s own model again.

Modes

llm.fallback.mode picks the behavior: With manual you choose which models back up the agent, in what order, and with what timing.

Configure manual fallback

On your agent’s Configuration page, open Fallback models in the Model section and pick Custom. Select Add fallback and choose a model for each one, then select Save.The agent’s own model appears as Primary model. Every model has a First token timeout (s) and a Total timeout (s), entered in seconds.
Changes take effect for new sessions after you publish.

models

1 to 3 entries, tried in the order you list them. Each entry names one model: Rules:
  • An entry carries model or custom, not both. Anything else is 422.
  • No duplicates. The main model and every entry must be different models or endpoints. A duplicate is 422.
  • A custom main model can fall back to platform models.
  • A platform main model can fall back to a custom endpoint.
  • api_key is write-only. Reads and version snapshots return null.
  • Omit api_key on a later patch to keep the stored key for the same base_url and model.

Timeouts

Each entry in models can set two timeouts. primary sets the same two for the agent’s own model. The defaults apply to every model in manual mode. That includes the agent’s own model when you leave primary out. Both timeouts count from the moment a request goes to the model. A reply that calls a tool and then answers is two requests, and each has its own count. These numbers are starting points, not thresholds. A shorter ttft_timeout_ms reaches a fallback sooner. It also switches away from a model that was about to answer.

When a reply has started

ttft_timeout_ms stops counting at the first of these.
  • The first text of the reply.
  • A tool call whose name and arguments have arrived in full. The beginning of a streamed tool call does not stop the count.

What total_timeout_ms covers

total_timeout_ms measures the model’s generation, tool call arguments included.
  • It does not measure playback. A reply can still be playing after the model has finished generating it.
  • It does not include the time a tool takes to run.
  • It keeps counting after the reply has started.
When it runs out, the reply has usually started, because ttft_timeout_ms comes first.
  • What the model generated so far is still spoken. The rest is lost.
  • The reply counts as a failed reply. It does not move to the next model.
If the model had not started its reply yet, the reply moves to the next model.
A short total_timeout_ms cuts replies that are simply long. On a platform model, a reply cut this way is generated again from the start, so the caller can hear its first words twice. Leave it unset unless you need a hard cap, and then keep it well above the time your longest reply takes to generate, tool call arguments included. To move away from a model that is slow to start, use ttft_timeout_ms.

Run a fallback in parallel

The first fallback can run alongside the agent’s own model, so a slow start does not hold the reply.
In Fallback models, turn on Run with the primary model on Fallback 1, then set Switch after (ms).
The switch-over time is 300 to 10,000 ms, 1500 by default. On every reply, the platform requests the agent’s own model and this fallback at the same time. Parallel trades cost for latency. Both requests bill their own tokens, whichever reply is used. The request that was not used is cancelled.

What triggers a switch

A reply moves to the next model on:
  • A provider error.
  • A model that has not started its reply within ttft_timeout_ms. Outside manual, within the platform’s own limit.
  • total_timeout_ms reached before the model started its reply.
  • A response stream that breaks off with no output.

What doesn’t switch

  • The agent choosing silence. A model that finishes normally with an empty reply is the agent staying quiet on purpose. Nothing switches.
  • A reply that has started. Once a model has started its reply, a problem finishing it counts as a failed reply.

When a reply fails

A reply fails when no model produced it, or when a problem cut it after it had started. What the caller hears depends on the agent’s own model.
  • A platform model. The agent generates the reply again. If that fails too, it asks the caller to repeat. After three failed replies in a row it apologizes and hangs up.
  • A custom LLM. See Failure behavior.

Per-session override

A session can replace the agent’s fallback configuration for that conversation only. See overrides.llm.fallback.

See which model answered

The session detail endpoint reports every switch and which model wrote each reply. See Conversation History. The console’s Conversations view shows the same: each switch in the timeline, and which model answered each turn.

Billing

  • Each reply is billed by the model that answered it, at that model’s rate.
  • A request that a timeout cut is still billed for the tokens it used.
  • A reply from a custom LLM endpoint has no LLM charge. Main model or fallback.

Going further

Custom LLM

Point the agent, or a fallback entry, at your own endpoint.

Configuration

Where llm.fallback sits among the rest of the agent’s settings.

Authenticated sessions

Override the fallback configuration for a single session.

Conversation history

Inspect every switch after the call.