LLM Service Outage Postmortem and Fault-Tolerant Design for AI Applications

    A technical postmortem of repeated large language model service outages, covering error semantics (429, 529, 503/504), cascading failure chains, why status pages do not prove availability, and five architecture defenses: multi-provider routing, bulkheads, circuit breakers with fallback chains, idempotency, and asynchronous checkpoints. Includes observability metrics, retry budget configuration, and user-facing recovery UX.

    1. Framing the Incident: When “Model Service Unavailable” Becomes a Standing Risk

    A large language model service platform recorded multiple incidents within a single month. On one day alone, it went down three times in a row: the status page turned red three times, the provider announced recovery three times, yet community feedback showed that a significant share of requests still failed after the page turned green. The impact covered model inference APIs, the web app, an AI coding assistant, and collaborative features; only a few strongly isolated entry points, such as console-style interfaces, stayed available.

    For consumers of these services, the point is not to watch one particular outage unfold. The point is to accept an engineering premise: an external LLM service is a dependency that is probabilistically unavailable. Designing as if it were always-on infrastructure is where most business-wide collapses begin.

    2. Error Semantics: How 429, 529, and 503 Actually Differ

    • 429 (rate limited): Capacity still exists; you simply arrived too fast. This is a “back off in a controlled way” signal.
    • 529 (overloaded): Overall server-side capacity has been breached, like a kitchen fire. Retrying is often useless and can make congestion worse.
    • 503/504: Service temporarily unavailable or gateway timeout, usually accompanied by upstream queuing and connection pile-up.

    The engineering implication is direct: 429 calls for exponential backoff with jitter; 529 calls for fast failure and switching paths, not more pressure. Treating a 529 as a 429 is the most common cause of retry storms.

    3. The Cascading Failure Chain: From One Overload to Your Entire Business Going Down

    The typical propagation path is: capacity breached → gateway queuing and connection pile-up → client threads/coroutines saturated by long-running requests → caller exhausts its own ports → upstream health checks fail → more traffic is judged as failed and retried → secondary amplification.

    Illustrative pseudocode (fast fail plus bounded concurrency):

    1. async def call_model(prompt):
    2. async with semaphore: # cap in-flight requests to protect ourselves
    3. try:
    4. return await client.generate(prompt, timeout=8)
    5. except OverloadedError: # 529 semantics
    6. metrics.incr("model_overload")
    7. raise FastFail() # do not retry here

    The key point: retries must happen in a scheduling layer that has circuit breaking and budgets, not scattered across business code.

    4. A Status Page Is Not Proof of Availability

    A green status page only means core components have recovered. Residual authentication state, frontend assets, and configuration-read failures can still leave settings, usage, and skills pages unusable for some accounts. The reliable approach is multi-dimensional probing: synthetic checks (login, authentication, one minimal inference), multi-region probes, and success criteria based on your own success rate and P99 latency rather than on official announcements.

    5. Five Lines of Defense at the Architecture Level

    1. Multi-provider and multi-model routing: Abstract a unified gateway by capability tags, with support for weights and failure-domain isolation.
    2. Bulkheads and bounded concurrency: Give each business line its own connection pool and semaphore so a single point cannot drag down the whole system.
    3. Circuit breaking and a fallback chain: primary model → backup model → cached result → rules/templates as a last resort → an explicit failure message.
    4. Idempotency and deduplication: use a business key plus a content hash as the idempotency key to prevent duplicate billing and duplicate writes caused by retries.
    5. Asynchrony and checkpoints: turn long tasks into queue-driven work, persist intermediate state in stages, and resume from the checkpoint after a failure instead of losing nine hours of work.

    6. Observability and Capacity Governance

    Collect the following at the same time: request volume, error-code distribution (429/529/5xx viewed separately), queueing time, token throughput, cost per request, and retry amplification factor. Set alerts based on an “error budget,” and put a token budget on retries, for example:

    1. retry_budget:
    2. max_ratio: 0.1 # retries must not exceed 10% of normal traffic
    3. backoff: exponential
    4. jitter: true
    5. retry_on: [429, 503, 504]
    6. no_retry_on: [529]

    7. User-Facing Experience Design

    Failures should be “understandable and recoverable”: show remaining quota and an estimated recovery window, offer one-click conversion to an asynchronous task with results pushed back, and save drafts and context snapshots so input is not lost with the session. For long workflows, enable staged saving and resume-from-checkpoint by default.

    8. Composing General-Purpose Capabilities on Baidu AI Cloud

    You can combine a container platform to host a stateless gateway, a message queue to smooth and replay tasks, object storage to hold intermediate task state, and logging plus monitoring and alerting services to build an error-budget dashboard — turning an uncontrollable external dependency into an observable, degradable, recoverable internal process.

    9. Conclusion

    Multiple outages in a single day expose not a problem with one vendor but a service characteristic shared across the industry. Making retries, circuit breaking, idempotency, asynchronous checkpoints, and multi-path redundancy default capabilities is what keeps model-service volatility at “degraded experience” rather than “business stopped.”