Skip to content

Fallbacks and availability

What happens when a model fails, is slow, or is taken away, and how your route keeps answering.

Applies to EngineCloud
View as Markdown
On this page
  1. When the next model takes over
  2. What you are charged
  3. When a model goes away

When the next model takes over

A route’s fallbacks are tried in order when the model:

  • answers with a provider error or is overloaded;
  • has not started answering after 20 seconds (change it with params.first_token_timeout_s);
  • refuses for lack of capacity.

Fallbacks are not tried when the request itself is the problem: an invalid schema, a blocked content check, a context too long for every model. You get that error at once.

When answering in a stream, a fallback can only take over before the first words are sent. After that, a failure arrives as an error event in the stream, so your app can say «something went wrong, try again».

What you are charged

Only the attempt that answered is charged. A failed attempt that had already produced some tokens is charged those tokens. Every attempt is a step in the trace, so you can see which model answered and why the others did not.

When every model fails, you get 503 provider_unavailable with each attempt and its reason.

When a model goes away

Providers retire models. The catalog shows a model’s retirement date, and every project with a route using it gets a notice 30 days before. On the day, a route still on that model moves to the task’s default (Cloud) or to its first fallback (self-hosted), and the change is recorded in the routes’ history.

  1. When the next model takes over
  2. What you are charged
  3. When a model goes away

    Search pages, sections and terms