Technical Reflections on Building Stable LLM Inference Services

    This article examines why large language model inference services are more prone to instability than traditional web services, how to measure AI service reliability across multiple dimensions, and what reliability engineering practices—monitoring, circuit breaking, multi-cluster disaster recovery, capacity planning, and blameless postmortems—engineering teams should establish. It also offers practical guidance for developers integrating LLM APIs into production systems.

    Introduction: A Typical LLM Service Disruption Event

    Recently, a large language model platform experienced a series of service anomalies within a short period, triggering a wave of feedback from users and developers. According to its public status page, the platform’s primary inference endpoints, code generation models, vision models, and deep reasoning and research models have now recovered, with request success rates holding above 99.9% over the past 24 hours. Only a few high-speed inference variants remain partially interrupted.

    Looking back over the past 30 days, however, the picture is far less reassuring: 46 service incidents of varying severity occurred—more than one per day on average. On the worst day, overall availability dropped to roughly 64%, and model response generation speed fell sharply. There were also periods when search request error rates exceeded 20%, login verification failed, and response latency rose significantly. Notably, many of these failures occurred during peak working hours—between 2 and 6 p.m., or after 9 p.m.—precisely when users are researching, drafting proposals, running batch API calls from business systems, or writing code. Even a single outage lasting only a few dozen minutes can multiply the real-world impact during these windows.

    This event is not an isolated case; it reflects a challenge commonly faced in the engineering of LLM services today. Setting aside specific products, this article explores from a technical perspective: how to measure the stability of AI inference services, what the root causes of common failures are, and what reliability assurance system engineering teams should build.

    Why LLM Services Are More Fragile Than Traditional Web Services

    To understand frequent partial failures, we first need to recognize the architectural differences between LLM inference services and traditional web services.

    1. Extremely high per-request resource consumption. A traditional HTTP endpoint typically requires only milliseconds of CPU computation per request. A single LLM inference, by contrast, occupies expensive accelerator memory, and generation may take seconds to minutes. This inherently limits per-node concurrency, and any traffic spike directly impacts queue depth and time to first token.

    2. Uncontrollable request duration. In generative endpoints, output length is determined by the model. With long contexts or deep reasoning modes, a single request may last several minutes. Once connections are saturated by large numbers of long-running requests, new requests queue and time out—manifesting as “the page won’t load” or “the connection dropped,” the symptoms users notice most acutely during peak hours.

    3. Long and heterogeneous service chains. A complete model service typically involves gateways, authentication, session management, retrieval augmentation, search calls, inference clusters, and streaming output. Jitter in any one link propagates to the final availability rate. For example, a rising search request error rate may not indicate a problem with the model itself but rather a failure in an external retrieval dependency.

    4. Difficult capacity elasticity. Accelerator resources are expensive and have long procurement cycles, making second-level elastic scaling like that of ordinary container services impractical. When user growth is rapid and usage shifts from casual chatting to hard dependencies in production business systems, capacity planning easily falls behind actual demand.

    Measuring Stability Scientifically

    Evaluating whether an AI service is reliable cannot rely solely on instantaneous metrics such as “99.9% success rate over the last 24 hours.” A multi-dimensional measurement system is needed.

    1. Request success rate vs. time-based availability. Success rate measures the proportion of successful requests; time-based availability measures the proportion of time the service is in a normal state. The two are different: if failures cluster during off-peak hours, the success rate may still look good while the peak-hour user experience has already degraded. An overall availability of 96.43% over 30 days is insufficient for a production-grade service—by industry standards, this implies more than 24 hours of cumulative unavailability per month, far below the “three nines” threshold (roughly 43 minutes of monthly downtime) or even “four nines.”

    2. Incident classification and impact assessment. The industry typically classifies incidents by scope: P0 for full unavailability, P1 for severe impairment of core functionality, P2 for partial functional degradation, and P3 for minor impact. Assessment must consider both duration and timing—a half-hour outage during peak hours may cause more real business loss than four hours of jitter during off-peak periods.

    3. Experience metrics. Beyond availability, teams should monitor time to first token (TTFT), token generation rate (TPS), P99 latency, and other experience indicators. “The service is up but too slow to use” is effectively unavailable as well.

    From “Fix Fast” to “Fail Less”: The Core Proposition of Reliability Engineering

    The median resolution time for each incident on the aforementioned platform was about 13 minutes, with severe failures recovering within half an hour—recovery speed (MTTR) alone looks solid. But the classic reliability engineering formula tells us that user experience depends on the relationship between MTBF (mean time between failures) and MTTR. When failures occur as often as once a day, no amount of fast repair can restore user trust.

    To achieve fundamental improvement, the following systems need to be established:

    1. Full-link monitoring and intelligent alerting. Instrument gateways, inference clusters, and external dependencies layer by layer. Build multi-dimensional alerts for error rates, latency, and queue depth, and combine them with traffic baselines for anomaly detection—aiming to detect anomalies within seconds rather than waiting for users to ask, “Is it down?”

    2. Circuit breaking, degradation, and rate limiting. When downstream dependencies (such as search or login verification) fail, circuit-break immediately and return fallback results to prevent failure propagation. When capacity is insufficient, prioritize core business traffic and rate-limit non-critical requests. An illustrative degradation logic is shown below:

    1. def chat_completion(request):
    2. try:
    3. return primary_model.generate(request, timeout=30)
    4. except (TimeoutError, ServiceUnavailable):
    5. # After circuit breaking, automatically switch to the standby inference cluster
    6. if circuit_breaker.is_open("primary"):
    7. return fallback_cluster.generate(request)
    8. raise

    3. Multi-cluster disaster recovery and canary releases. Inference services should be deployed across data centers and clusters, supporting rapid traffic switching. Model version updates must pass small-traffic canary validation to prevent defects in new versions from hitting all users at once—frequent failures are often correlated with frequent changes.

    4. Capacity stress testing and peak-hour playbooks. For known peak periods (weekday afternoons and evenings), conduct capacity stress tests and resource reservations in advance, and set reasonable queuing and timeout policies for long requests to avoid cascading failures.

    5. Blameless postmortem culture. Every P2-or-above incident should have a blameless postmortem, producing root cause analysis and improvement items with tracked closure. Without systematic reviews, 46 incidents in 30 days can easily trap a team in a “fix one, another appears” cycle.

    Recommendations for Developers on the User Side

    Teams integrating LLM APIs into business systems should also design their own fault tolerance: add timeouts and retries to model calls (exponential backoff is recommended); prepare backup inference options for critical business functions with automatic switching when the primary service fails; use asynchronous queues to smooth peaks for non-real-time tasks; and monitor API success rates on the business side, building alerts linked to the provider’s status page. Not putting all eggs in one basket is the most basic responsibility for production systems.

    Conclusion

    LLM capabilities matter, but when they become the infrastructure for the daily work of millions of users, “stable” determines reputation more than “powerful.” The journey from 96% to 99.99% availability tests not a single-point technical breakthrough but systematic engineering capabilities: monitoring, disaster recovery, change management, capacity planning. This is a lesson every model service provider must learn—and the dimension enterprises should weigh most heavily when selecting and integrating AI services.