MODULE 8 ยท LESSON 2

Free โ€” no login required

Sign in to track progress, save quiz attempts and enrol in the full course.

Sign in to track progress / enrol

Reliability Engineering for AI Products

The failure modes you must handle

Model APIs fail in ways ordinary services do not, and each needs explicit handling:

๐Ÿ“… Timeline
Rate limitingYou exceeded your allocation. Common, predictable, and should never reach the user as an error. Back off, queue, or fall back.
TimeoutThe request took too long. Requires a decision: retry, degrade, or fail โ€” and retrying a slow request often makes congestion worse.
Partial generationThe response began and stopped. Distinctive to streaming, and the user has half an answer that may be misleading on its own.
Refusal or safety filteringThe model declined. Not an error, and must not be presented as one.
Malformed outputThe model returned something that does not match the structure you required. Needs validation and a retry or repair path.
Degraded qualityEverything succeeds and the answers are worse. The hardest, because nothing signals it.

The last is where module 3's scheduled evaluation earns its cost โ€” it is the only mechanism that detects the failure with no error attached.

The fallback ladder

A single fallback is usually insufficient. Build a ladder, descending gracefully:

  1. Retry with backoff. For transient failures and rate limits. Bounded โ€” retries amplify congestion during an incident.
  2. Failover to a second region or endpoint of the same provider.
  3. Failover to a different model, possibly smaller or cheaper. Quality drops; the product works. This requires your evaluation to have measured the fallback model, or you are shipping unknown quality under stress.
  4. Non-AI fallback. The rules-based path, cached responses, templates โ€” the pre-AI mechanism module 2 warned against deleting.
  5. Honest unavailability. A clear message and a preserved user context, so nothing is lost.

Descend explicitly, and tell the user when quality is degraded where it materially affects them. A silently worse answer is worse than an acknowledged one.

Retry, carefully

Retries are the most commonly mishandled part of this, and mishandling them turns a partial degradation into a full outage.

  • Always bound them. Unlimited retries during a provider incident generate load exactly when the provider is struggling.
  • Use exponential backoff with jitter. Without jitter, every client retries in synchronised waves.
  • Do not retry non-retryable failures. A refusal or a malformed request will fail identically the second time and costs money each attempt.
  • Budget retries against the user's patience, not only against the provider's limits. Three retries within a latency budget the user will not wait through is a failure with extra steps.

What counts as an AI incident

Broader than conventional outage definitions, and worth writing down before you need it:

  • The service is unavailable or materially degraded โ€” conventional.
  • Output quality has dropped materially โ€” detected by scheduled evaluation or by a spike in edit and override rates.
  • The system produced something harmful or seriously wrong that reached a user.
  • A safety or scope boundary was breached โ€” the system did something it should refuse.
  • Data went somewhere it should not โ€” module 6.

The middle three have no conventional equivalent and are frequently missing from incident definitions, which means nobody declares them, which means they persist.

Response requires the same shape as any incident practice: a way to detect, a way to report, a decision on whether to disable the feature, an assessment of who was affected, and a record. Disabling the AI feature while keeping the product working is exactly why the degradation design above matters.

Commitments you can meet

Be careful what you promise:

Availability is promisable, because it depends on your architecture and your fallbacks.

Latency is promisable at a percentile, if you have measured it and control the path.

Accuracy or quality is not promisable as a guarantee, and you should resist pressure to do so. What you can offer is what the managers course recommended asking of vendors: measurement and reporting against an agreed metric, with a remedy if it degrades materially. That is honest, deliverable, and more useful to a customer than a guarantee nobody could enforce.

Where a customer insists on a quality commitment, the productive move is to define it narrowly and measurably on a fixed evaluation set you both agree to โ€” which turns an unbounded promise into a specific, testable one.

โ“ Knowledge Check

Why must retries be bounded and use backoff with jitter?

๐Ÿ“š Flashcards1 / 6
Term

The six model-API failure modes

Click to flip
Definition

Rate limiting, timeout, partial generation, refusal or safety filtering, malformed output, and degraded quality โ€” the last having no error attached and detectable only by scheduled evaluation.

Click to flip back
๐Ÿ’กKey Takeaway

Model APIs fail in six distinctive ways, and the worst is degraded quality with no error attached โ€” detectable only by scheduled evaluation. Build a fallback ladder rather than a single fallback, measure the model you fail over to, and tell users when quality is degraded. Bound and jitter your retries, because unbounded retries convert a provider's bad hour into your outage. And commit to availability and latency, never to accuracy โ€” offer measurement and reporting instead.