How model calls fail
What it is
A model call can fail in more ways than an ordinary service call:
- Rate limited (HTTP 429): you are over your per-minute allowance.
- Overloaded or erroring (HTTP 5xx): the provider is having trouble.
- Timed out: no answer, or no first token, in the time allowed.
- Refused: the provider's content filter blocked the request or the answer.
- Malformed: an answer arrived but is cut off or not in the format asked for.
- Wrong: a fluent, well-formed, incorrect answer, with no error at all.
Why it matters
Each kind needs a different response.
- Retrying a rate limit immediately makes it worse; retrying a refusal never works; a malformed answer may be fixed by asking again; a wrong answer is not detected by any of this and needs the checks in the Guardrails and Evaluation modules.
- A design that treats 'the call failed' as one case handles most of them badly.
In the real world: An incident review finds that a storm of blind retries during a brief provider slowdown tripled the traffic and turned a two-minute blip into a twenty-minute outage.
Visual example
FailuresThe first question is always: which kind is it?
Catching every exception and retrying. That hammers a rate-limited provider, repeats a request that will always be refused, and can double an action that actually succeeded. Classify the failure first.