High Availability Practices for Large Model APIs: A Practical Guide

    This article examines the real cost of downtime in large language model (LLM) APIs and explains how to build resilient systems around them. It covers how to measure availability correctly using service-level objectives (SLOs), error budgets, and latency percentiles, followed by four layers of client-side protection: timeouts and retries, circuit breaking, graceful degradation, and isolation. It then outlines architecture-level strategies such as multi-zone deployment, multi-provider routing, asynchronous processing, caching, and externalized state, along with observability and incident response mechanisms. A pre-launch stability checklist is included to help teams validate long-tail failure handling before release.

    1. The Real Cost of Downtime

    A cloud provider’s large model service experienced several disruptions between August and October. One outage lasted more than four hours and simultaneously affected web and mobile chat capabilities along with two APIs (labeled V4 Pro and V4.1 Flash), making it the widest and longest incident. The platform later offered credit-based compensation to API users and pledged to prevent similar issues. Most other incidents lasted only minutes to tens of minutes, and some affected only search-related add-on tools while core chat remained available.

    The official status page reported interval availability of roughly 99.46% for the lightweight API tier and 99.74% for the high-performance tier. Converted to annual downtime (8,760 hours per year), that is about 47.3 hours and 22.8 hours respectively. These numbers highlight the most overlooked point in engineering: availability percentages are a statistical measure, but user experience is a distribution problem. The damage from a four-hour tail failure far exceeds the combined impact of multiple 30-second blips throughout the year.

    The first principle of stability work is therefore: do not fixate on SLA numbers alone; design fallback paths specifically for long-tail failures.

    2. How to Measure Availability Correctly

    Distinguish three perspectives

    • Infrastructure availability: nodes, network, and data center level;
    • Service availability: end-to-end success rate from gateway to inference cluster;
    • Business availability: the proportion of users who actually complete a valid session.

    These three often diverge. Inference services may be healthy but severely queued—infrastructure is “available,” yet the business is not.

    Drive decisions with error budgets

    Error budget = 1 − target availability. For a quarterly target of 99.9%, the budget is about 43 minutes. When the budget is ample, prioritize feature iteration; when it is nearly exhausted, freeze changes and focus on stability. This turns stability from a “feeling” into a quantifiable constraint.

    Focus on percentiles, not averages

    Monitor P50/P95/P99 time-to-first-token latency and overall latency. Normal averages with degraded P99 are an early signal of capacity and queuing problems.

    3. Four Layers of Client-Side Protection

    Timeouts and retries

    Timeouts must be set in layers: connection timeouts should be short, while read timeouts must cover long-text generation. Enable retries only for idempotent requests that can be safely replayed, using exponential backoff with jitter to avoid retry storms.

    1. import random, time
    2. def call_with_retry(fn, max_attempts=3, base=0.5):
    3. for i in range(max_attempts):
    4. try:
    5. return fn(timeout=30)
    6. except TimeoutError:
    7. if i == max_attempts - 1:
    8. raise
    9. time.sleep(base * (2 ** i) + random.uniform(0, 0.3))

    Circuit breaking

    Track failure rates over a sliding window and fail fast once a threshold is exceeded; allow a small amount of probe traffic in the half-open state to test recovery. Circuit breaking converts “slow failures” into “fast failures,” protecting thread pools and upstream capacity.

    Graceful degradation

    Prepare a multi-level degradation chain: downgrade from the high-performance tier to the lightweight tier, switch from streaming to non-streaming, fall back from generative answers to retrieval-based or cached responses, and return templated fallback messages when necessary. Degradation must be defined as part of the product in advance, not decided on the fly.

    Isolation

    Partition independent quotas and connection pools by business line to prevent a sudden traffic spike in one scenario from exhausting global resources; separate core and non-core paths physically or logically.

    Example routing configuration for a unified gateway:

    1. routing:
    2. primary: { model: "pro", weight: 70, timeout_ms: 30000 }
    3. secondary: { model: "flash", weight: 30, timeout_ms: 15000 }
    4. fallback: { mode: "cached" }

    4. Architecture-Level Disaster Recovery

    • Multi-zone deployment: cross-zone redundancy with health checks that automatically remove unhealthy instances;
    • Multi-provider / multi-model routing: abstract a unified inference gateway to hide underlying differences and route dynamically based on availability, latency, and cost;
    • Asynchronous processing: convert long-running tasks to submit–callback or polling patterns, use message queues to smooth peaks, and avoid long-lived connections being killed by a single point of failure;
    • Result caching and idempotency: apply semantic caching to high-frequency similar requests, reducing cost while improving availability during failures;
    • Externalized state: store session context in external storage so instances can be replaced at any time.

    5. Observability and Incident Response

    The three pillars of observability are all essential: metrics (success rate, latency percentiles, rate limiting and queue length), logs (structured records with request IDs and degradation flags), and distributed tracing (to pinpoint whether time is spent at the gateway, in queuing, or in generation). Alerting should be based on user impact rather than resource thresholds alone, with on-call rotations and escalation paths configured.

    An incident response plan should include: severity classification criteria, one-click traffic switching and degradation switches, change-freeze windows, and verifiable improvement items produced from post-incident reviews. Compensation mechanisms can only repair commercial relationships, not trust; the real solution is to compress long-tail failure durations to the minute level.

    6. Pre-Launch Stability Checklist

    1. Are SLOs and error budgets defined and integrated into dashboards?
    2. Are timeouts, retries, circuit breaking, and degradation all in place and tested through drills?
    3. Is cross-zone and cross-model switching capability available, and is the switch automated?
    4. Are long-running tasks asynchronous, with queue buffering?
    5. Do alerts point to user impact, with clear owners assigned?
    6. Have fault injection and capacity stress tests been conducted, including long-text and peak-concurrency scenarios?

    7. Conclusion

    The gap between 99.46% and 99.74% is 0.28 percentage points on paper, but translates to roughly 24 additional hours of unavailability per year in business terms. Stability is not a metric you purchase; it is an engineering capability built from timeouts, retries, circuit breaking, degradation, disaster recovery, and observability. Treating long-tail failures as first-class design concerns is what keeps intelligent applications continuously available through volatility.