LLM Capacity Planning Under Compute Constraints: Engineering Practices for AI Inference
As large language model adoption accelerates, compute supply is growing more slowly than demand. This article breaks down why LLM inference capacity planning is harder than traditional web service planning, and lays out a layered engineering approach: token-level observability, request shaping, cache reuse, elastic scheduling, and graceful degradation. It also covers cost control, rate limiting as a product capability, and a practical action checklist for technical teams.
1. The Signal Behind the News: From “Not Enough Compute” to “Capital Accelerating”
A recent industry episode is worth revisiting. A large-model development team published a notice on Monday announcing usage limits due to tight inference capacity, restricting long-context sessions that had been inactive for an extended period. The next day, the team closed a large new funding round with dozens of external investors, while the founding team retained control through an equity holding platform.
Treated as pure capital news, this has limited value. For developers and enterprise technical decision-makers, the signal worth extracting is this: the commercialization of large-model capability is now moving faster than the decline in compute cost per unit. The timing of the notice and the funding round shows that “resource pressure” is not a capability problem but a capacity and delivery-cadence problem. Setting the specific parties aside, this article discusses only the general engineering question: under real compute constraints, how to turn limited resources into stable, predictable, and measurable service capacity.
2. Why LLM Capacity Planning Is Harder Than Traditional Services
Traditional web service capacity models are relatively mature: request arrival rate, average response time, and per-instance throughput are enough to derive the required instance count. LLM inference breaks all three assumptions.
First, per-request cost variance is enormous. A 200-token input and a 200,000-token input are not in the same cost range; a 50-token output and an 8,000-token output differ even more sharply. Capacity planning based on average token counts will inevitably be overwhelmed by long-tail requests.
Second, resource consumption accumulates over time. Long sessions must continuously maintain context state; the real memory and bandwidth pressure is session count multiplied by average context length. This is the technical rationale behind policies like “restricting long-inactive long conversations”: what gets reclaimed is not CPU time, but context caches and associated state held for extended periods.
Third, the peak-to-trough ratio is extreme. Traffic peaks during working hours or driven by events can be tens of times the trough. Keeping hardware resident for the peak pushes average utilization to unacceptable levels; not preparing for the peak means user experience collapses during high-traffic periods.
A rough capacity estimation logic can illustrate the difference:
# Illustrative: coarse-grained capacity estimation, only to show the modeling approachdef estimate_capacity(req_per_sec, avg_in, avg_out,p95_in, p95_out, safety=1.3):avg_tokens = avg_in + avg_outp95_tokens = p95_in + p95_out# Use the mean as a baseline and the percentile as headroombaseline = req_per_sec * avg_tokenspeak = req_per_sec * p95_tokensreturn baseline * safety, peak * safety
The conclusion is straightforward: capacity planning must report both a baseline value and percentile headroom. Reporting only an average is unreliable in engineering.
3. A Layered Approach: Breaking “Not Enough” Into Five Solvable Problems
3.1 Measurement First: No Token-Level Observability, No Optimization
Most resource waste comes from “not knowing where the money goes.” A minimum viable observability system should cover at least: input/output token counts per request, queue time, time to first token, end-to-end latency, cache hit rate, and failure and degradation counts. Tagging these metrics by business unit, scenario, and model tier is what makes an attributable cost view possible. Without this step, all subsequent optimization is guesswork.
3.2 Request Shaping: Turning Uncontrollable Load Into Controllable Load
- Context governance: apply sliding windows and summary compression to overly long sessions, keeping only recent segments and structured summaries essential to the task, to avoid unbounded context growth.
- Output constraints: explicitly cap maximum output length where the business allows; output length is one of the most cost-sensitive variables.
- Batching and prioritization: pool offline, deferrable tasks separately from online interactive tasks; the online pool protects latency, the offline pool protects throughput.
- Admission control: queue at the entry point by quota and priority; better to make low-priority requests wait than to let high-priority requests time out alongside them.
3.3 Cache Reuse: The Highest-ROI Layer
More is reusable in LLM services than one might expect: instructions and knowledge fragments with identical prefixes, high-frequency Q&A, and structured extraction templates. In practice this usually splits into three layers—exact result caching, prefix state reuse, and retrieval result caching. Raising the hit rate from 10% to 30% is equivalent to increasing total capacity, with almost no added hardware.
3.4 Elastic Scheduling: Making Resources Follow Load
Practical general approaches include: autoscaling based on queue length and time to first token rather than CPU alone; deploying interactive and throughput workloads onto resource pools of different specifications; and tiered handling across public cloud elastic resources, dedicated resources, and self-built resources, with low-cost resident resources for the baseline and elastic resources for the peak. Describing this with generic capability categories such as container platforms, message queues, object storage, logging services, and monitoring and alerting is sufficient; no specific implementation needs to be bound.
3.5 Graceful Degradation: Turning “Unavailable” Into “Available but Limited”
A usage-limit notice is essentially a public degradation. A mature degradation ladder should be designed and rehearsed in advance:
L0 full capabilityL1 reduced max output length, non-essential deep reasoning disabledL2 forced summarization for long sessions, shorter context retentionL3 low-priority requests queued or rejected with a retryable responseL4 switch to a smaller model tier or rule-based fallback answers
The key principle is predictability: clients should receive a clear rate-limit signal and retry guidance, not random timeouts.
4. Cost Control: From “Buy More” to “Use Less”
When resource expansion is constrained by procurement and delivery cycles, efficiency is capacity. Ranked roughly by return on investment, actionable measures are: caching and prefix reuse, output length constraints, context compression, model tiering (simple tasks on smaller tiers, complex tasks on larger ones), batching to raise throughput per unit of resource, and setting token budgets by business margin with quota governance. It must be emphasized that any optimization should be premised on quality regression testing; otherwise the saved cost will be repaid in the form of experience and trust.
5. Stability and Governance: Making Rate Limiting a Product Capability
Rate limiting should not be an emergency action but a long-term mechanism: set dual-dimension quotas of tokens and concurrency for each business unit; expose clear rate-limit responses and quota query capability externally; build a capacity watermark dashboard with alert thresholds; and prepare plans for burst traffic with regular load testing. When customers know in advance “how much quota is left and when it resets,” the negative perception caused by resource pressure drops significantly.
6. Action Checklist for Technical Teams
- Within one week, complete token-level metering and a cost attribution dashboard;
- Within two weeks, ship output length constraints, context compression, and prefix caching;
- Within one month, complete online/offline pooling and autoscaling policies;
- Establish a four-level degradation plan and rehearse it in a staging environment;
- Write quota, rate-limiting, and retry specifications into external API documentation;
- Every quarter, review unit token cost and quality regression as paired metrics.
7. Conclusion
Rhythms like “not enough compute on Monday, funding secured on Tuesday” will keep recurring. What developers can control is not the timing of funding, but output efficiency per unit of resource and user experience during degradation. Doing these five things—measurement, shaping, reuse, elasticity, and degradation—solidly means that even if resource growth lags demand growth, the service can remain predictable, measurable, and sustainable. That is also the most reliable technical moat in an era of compute constraints.
