Reliability patterns for LLM calls
For engineers
Fallback models and providers, timeouts for long and streamed generations, circuit breakers, idempotent retries for side effects and graceful degradation during outages
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
Which failure should normally trigger a switch to the fallback model?
Check yourself · 2 of 5
What does an idle-stream timeout catch that a total timeout does not catch early?
Check yourself · 3 of 5
What does a breaker do in the half-open state?
Check yourself · 4 of 5
A tool call times out. Why can retrying it be dangerous?
Check yourself · 5 of 5
Which feature is a good candidate for queueing work until the model is back?
Topics
- Fallback models and providers5 min read · A second model or provider behind the first, prompts that work on both, evals that cover the fallback path, and the behaviour change users notice when it takes over
- Timeouts for streamed and long generations5 min read · Connect, first-token, idle-stream and total timeouts, longer budgets for reasoning models, per-step limits in agents and passing a deadline down the call chain
- Circuit breakers and load shedding for providers5 min read · Opening the circuit when a provider's error rate spikes, probing before closing it, avoiding retry storms and shedding low-priority traffic first
- Idempotent retries for tool calls and side effects5 min read · Retrying a model call is cheap, but retrying a tool that sends an email or charges a card is not; idempotency keys, deduplication and at-most-once side effects
- Graceful degradation when the model is down5 min read · Cached or static answers, queueing work for later, switching the feature off with an honest message, and showing status instead of a generic error
Start here
- Timeouts, retries and backoff with jitter (AWS Builders' Library) (opens in a new tab)ArticleFree
How to choose timeouts, cap retries and add jitter so retries do not pile onto a struggling service.
- Making retries safe with idempotent APIs (Amazon Builders' Library) (opens in a new tab)ArticleFree
The client-token pattern that makes a retried request produce one effect, not two.
- Circuit Breaker (Martin Fowler) (opens in a new tab)ArticleFree
The closed, open and half-open states in one short page.
110 questions · last verified 2026-12