Rate Limiting and High Availability for LLM Inference Under Compute Constraints

    This article examines why large language model services are structurally prone to overload, and how engineering teams can respond. It breaks down the root causes—GPU memory as a hard constraint, high per-request cost variance, slow scale-out, and long dependency chains—then presents a four-layer protection model spanning resource, admission, scheduling, and experience layers. It includes a token bucket rate limiter that charges requests by cost weight, a queue-based peak-shaving and asynchronous execution flow, and a data-driven capacity planning loop built on core metrics, watermark thresholds, load testing, and degradation drills. Role-specific recommendations are provided for platform operators, enterprise integrators, and application developers.

    1. The Signal: What Free Tier Tightening Reveals About Compute Supply and Demand

    A large model platform was recently reported to be tightening usage limits for free users on both its web and client applications due to insufficient compute—the first time it has restricted its free entry point since launch. Public status data over the same period showed multiple service interruptions since October, affecting the chat service and two model APIs; a lightweight API recorded roughly 99.46% availability from August to October, which annualizes to tens of hours of downtime; and the year saw dozens of outages or performance degradations.

    Abstracted one level up, this is not operations news about a single vendor. It is a problem every team running online inference will face: the structural conflict between rigid compute supply and elastic demand. Inference compute cannot scale almost without limit the way storage can. GPU and accelerator procurement and cluster delivery have lead times, while user traffic is bursty, long-tailed, and tidal. When free traffic makes up too large a share and per-request cost cannot be recovered, a platform inevitably moves to admission control—rate limiting and quotas.

    2. Root Causes: Why LLM Services Are Easier to Overwhelm Than Traditional Services

    The bottlenecks in a traditional web service are usually CPU, memory, and connection counts, and scaling is relatively linear. LLM inference has several distinct characteristics:

    1. GPU memory is a hard constraint. Batching improves throughput, but it requires reserving memory for the KV cache, and memory consumption grows non-linearly as context length and concurrency increase.
    2. Per-request cost is very high and highly variable. A single long-context generation can consume tens of times the compute of a short question-and-answer exchange, so capacity planning based on averages gets punctured by long-tail requests.
    3. Scale-out lags. Bringing a new node online requires environment setup, model weight loading, and warm-up; minute-level or longer cold starts cannot absorb second-level spikes.
    4. The dependency chain is longer. Beyond the inference cluster, there are gateways, authentication, session storage, logging, and monitoring and alerting components. A bottleneck anywhere shows up as “the model service is unavailable.”

    Capacity governance therefore has to cover two layers at once: shaping traffic at the entry point and protecting backend resources.

    3. Overall Design: A Four-Layer Protection Model

    The protection model can be organized into four layers, taking effect from the bottom up:

    • L1 Resource layer: compute pool partitioning, priority queues, GPU memory and batching parameter constraints.
    • L2 Admission layer: identity tiers, quotas and token bucket rate limiting, separating free from paid traffic.
    • L3 Scheduling layer: queue-based peak shaving, asynchronous execution, cache reuse, and result deduplication.
    • L4 Experience layer: degradation strategies, queue notifications, retry on failure, and a closed observability loop.

    Reference Implementation of the Admission Layer

    The core of admission control is rate limiting based on identity tiers and cost-based accounting. The sample code below is a generic pseudo-implementation:

    1. class RateLimiter:
    2. def __init__(self, capacity: int, refill_per_sec: float):
    3. self.capacity = capacity
    4. self.tokens = capacity
    5. self.refill = refill_per_sec
    6. self.last = now()
    7. def allow(self, cost: int = 1) -> bool:
    8. self._refill()
    9. if self.tokens >= cost:
    10. self.tokens -= cost
    11. return True
    12. return False
    13. def _refill(self):
    14. t = now()
    15. self.tokens = min(self.capacity, self.tokens + (t - self.last) * self.refill)
    16. self.last = t

    The key design point is that cost is no longer a fixed 1, but a cost weight tied to the request’s input length, expected output length, and model size. Tightening limits for free users is, in essence, lowering their capacity and refill while giving paid users a higher weight.

    4. Peak Shaving and Asynchronous Execution: Turning Synchronous Waiting into Controlled Queuing

    When instantaneous concurrency exceeds the compute ceiling, rejecting outright hurts the user experience and admitting everything drags down the cluster. The better option is to introduce a message queue as a buffer:

    1. The gateway handles only authentication and lightweight validation, then writes the inference task to a queue.
    2. Backend inference instances pull tasks according to their own remaining GPU memory, providing back-pressure.
    3. For short question-and-answer requests, enable result caching and semantic deduplication so repeated requests with the same prefix hit the cache directly.
    4. Split long-context tasks into “summarize first, then generate” to lower the per-call GPU memory peak.

    Sample flow:

    1. Client -> Gateway(auth/quota) -> Queue(priority: paid > free) -> InferencePool
    2. |-> Cache(return directly on hit)
    3. |-> Degrade(return fallback result on timeout)

    5. Availability and Capacity Planning: Data-Driven Rather Than Guesswork

    The availability figure above carries an important reminder: 99.46% monthly availability translates to tens of hours of downtime per year, which is not acceptable for an online service. Capacity planning should establish the following loop:

    • Metrics first: define five core metrics—throughput (tokens/s), time to first token, queue time, GPU memory utilization, and rejection rate—and wire them into monitoring and alerting.
    • Watermark management: a soft watermark (for example 70%) triggers scale-out and tighter rate limiting; a hard watermark (for example 90%) triggers forced degradation.
    • Routine load testing: build a capacity baseline with a traffic model that closely matches the real distribution, including the long-context ratio, rather than using average requests only.
    • Degradation plan drills: periodically verify that queue notifications, static fallback responses, and feature switches work.

    6. Practical Recommendations by Role

    • Platform operators: prioritize identity tiers and cost-weighted rate limiting, then queue-based peak shaving and cache reuse; set clear, transparent rules for the free entry point to reduce the gap in user expectations.
    • Enterprise integrators: design retries with backoff for critical workloads, set timeouts and circuit breakers to avoid amplifying upstream jitter; make long tasks asynchronous and retrieve results via callback or polling.
    • Application developers: control context length, streamline prompts, and cache cacheable content locally—these are the most direct ways to reduce per-request cost.

    7. Conclusion

    Tightening free quotas is not an isolated event but an inevitable adjustment under a compute supply-demand imbalance. What is genuinely reusable for engineering teams is the methodology: admission control centered on cost weights, peak shaving built on queues and caches, capacity planning driven by watermarks and load testing, and stability assurance grounded in degradation and observability. As compute constraints become the norm, the team that puts limited compute to work on the highest-value requests is the one that holds both the experience line and the cost line.