Skip to content

AI Agent Fallback

One fallback chat model an agent moves to when its primary model fails.

An AI Agent runs on one primary model. An operator who keeps a backup model records it here, in advance, so the built agent moves to it on its own. Nobody has to edit the agent by hand during an outage.

Fields

Field Type Required Description
agent AI Agent Yes If you delete the agent, you also delete its fallbacks.
model AI Model Yes A chat model, protected from deletion while bound.
weight Integer Yes The order models are tried in. Lower comes first.

An agent can have each fallback model only once. The built agent tries the primary model, then each fallback in weight order.

The order and the skip rule

fallback_models() returns the available fallbacks in weight, pk order. It skips a fallback whose model or provider is disabled, the same as a disabled tool. A model that cannot answer would fail the same way the primary did.

The rules

A fallback has to be a chat model, and it cannot be the agent's primary model. If the agent binds tools or subagents, the app refuses a fallback with a recorded no for tool calls.

Usage records

The usage record names the model that answered. If a fallback answered a call, the record says so. An operator can then tell which model cost what.