What to Do When Your LLM API Is Suddenly Unavailable

    This article explains why online LLM services can become unavailable during DDoS attacks, what end users should do first, and how teams can design for resilience. You will learn a safe retry order, exponential backoff with jitter, multi-provider redundancy, tiered degradation, client-side circuit breaking and rate limiting, data persistence fallbacks, and the observability metrics and post-incident review steps needed to contain the impact.

    1. Root Cause: Why an Online AI Service Suddenly Stops Responding

    Many developers calling hosted LLM APIs recently ran into request timeouts, unusually long queue times, and status codes clustered around rate limiting and gateway errors. This is usually not a degradation of the model’s reasoning ability. The service entry bandwidth and connection resources have been saturated by a large-scale distributed denial-of-service (DDoS) attack, so legitimate requests cannot be scheduled in time.

    That distinction matters: the failure is in the traffic entry and scheduling layer, not the algorithm layer. The service provider owns the fix, and end users can do only so much — but they are not helpless.

    From an engineering standpoint, a DDoS exhausts a target’s quota of compute, bandwidth, or connection-table capacity. On a platform serving online inference, the components typically hit are the ingress gateway, the authentication service, the session scheduling queue, and the queuing buffers in front of the backend inference cluster. Once the entry point is saturated, even healthy nodes look “down” because they cannot accept new connections — which is exactly why ordinary users perceive the service as completely unusable.

    2. What End Users Should Do, in Order

    The worst response to a sudden outage is high-frequency retrying. Dense retries amplify pressure on the entry point, stretch out recovery, and may get your account classified as abnormal traffic and throttled more aggressively.

    The recommended order:

    1. Confirm whether it is a service-side issue: switch networks, switch devices, and send a minimal request to rule out local network and client problems.
    2. Retry with exponential backoff plus random jitter, so retries do not synchronize into a thundering herd.
    3. Move non-real-time work to an offline queue and consume it once the window recovers.
    4. Follow the provider’s official status channels and treat them as authoritative; do not trust “recovery time” claims from unofficial sources.

    A sketch of the backoff logic (pseudocode):

    1. import random, time
    2. def call_with_backoff(fn, max_retry=5, base=1.0, cap=30.0):
    3. for i in range(max_retry):
    4. try:
    5. return fn()
    6. except TransientError:
    7. if i == max_retry - 1:
    8. raise
    9. sleep = min(cap, base * (2 ** i))
    10. time.sleep(sleep + random.uniform(0, sleep * 0.3))

    The jitter term spreads out retry moments across concurrent clients — a standard practice for reducing secondary impact in distributed environments.

    3. Turning an Uncontrollable External Risk into a Design Problem You Own

    For companies and teams, pinning all stability on a single online service is itself an architectural flaw. The more mature approach starts by accepting that external dependencies will go down, and leaves an escape route in the system design.

    3.1 Multi-Provider, Multi-Channel Redundancy

    Define a unified model-invocation interface at an abstraction layer, and pull authentication, parameter wrapping, and result parsing inside an adapter so the underlying channel becomes replaceable. When one channel misbehaves, you switch configuration to restore service instead of touching business code.

    1. Business logic
    2. ↓
    3. Unified inference abstraction layer (interface definition + result normalization)
    4. ↓ ┌────────────┬────────────┐
    5. Channel A Channel B Local small model

    3.2 Tiered Degradation

    Classify requests by business value: protect the core path first, and degrade long-tail requests to a rules engine, templated replies, or cached results. Degradation is not failure — it trades a controlled loss of quality for availability.

    3.3 Circuit Breaking and Rate Limiting as Self-Protection

    Clients need circuit breakers too: when the error rate crosses a threshold, fail fast and enter a cooldown period rather than holding threads and connections in useless waits. Paired with a local token bucket, this keeps your own traffic in a reasonable range, protecting both the upstream and yourself.

    4. Data and State Fallbacks

    Session-based applications need to account for lost context. Persist conversation history and structured intermediate results to local or self-owned storage, then replay them on demand after the service recovers, instead of relying on remote session affinity. For generated output, write it to disk with version and source tags so it can be traced and reprocessed later.

    At the data layer, a common combination of general-purpose capabilities covers most fallback needs: object storage for raw artifacts, a message queue for asynchronous compensation and peak shaving, a logging service for call chains and error distribution, and monitoring plus alerting to notify on-call staff before error-rate and latency metrics cross their bounds. These are all standard categories in the industry; evaluate specific choices against your own scale and compliance requirements.

    5. Observability: Making the Failure Explainable

    During an outage, what drains a team most is often not the failure itself but the inability to say what happened. Collect at least three metrics: request volume, error and timeout rates, and end-to-end latency percentiles; also retain request identifiers so events can be correlated across components. With baseline data you can tell whether the cause is your own code defect, a quota limit, or an upstream entry problem — avoiding misdiagnosis and wasted remediation.

    6. Post-Incident Review Checklist

    After recovery, run a short review: confirm the impact window and the affected business scope, verify that degradation triggered as expected, check whether retries added extra pressure, and update the runbook and alert thresholds. Filing every external shock as an architecture improvement item is how passive waiting turns into long-term resilience.

    In short, when an online AI service goes down under attack traffic, end users should rely on low-frequency backoff retries and offline queuing, while teams should use a unified abstraction layer, multi-channel redundancy, tiered degradation, circuit breaking and rate limiting, and solid observability to keep an uncontrollable external event within a tolerable business impact.