LLM Capacity Planning: Forecasting Peak Token Demand | Hokstad Consulting

LLM Capacity Planning: Forecasting Peak Token Demand

LLM Capacity Planning: Forecasting Peak Token Demand

Size LLM capacity for peak token demand - not monthly averages. At 120 requests per minute, with 2,000 input tokens and 500 output tokens per request, demand reaches 300,000 tokens per minute. But token quotas alone do not prove that responses will meet latency targets.

A capacity plan needs to:

  • Measure demand: Track input and output tokens separately, using one-minute buckets and shorter windows for bursts.
  • Forecast peaks: Include growth, longer prompts, retries and extra agent calls without counting them twice.
  • Check capacity: Test request limits, token limits, concurrency and latency together. Keep burst headroom separate from failure reserves.
  • Control overload: Bound queues and retries, cap output lengths and defer batch work before interactive traffic.
  • Review demand and costs: Compare forecasts with actual usage, estimate spending in £ from traffic patterns - not constant peak demand - and assign owners and review dates.

The test is simple: can the planned capacity handle the forecast peak, including the agreed failure case, while meeting service targets?

::: @figure LLM Peak Token Demand: Three Forecast Cases{LLM Peak Token Demand: Three Forecast Cases} :::

2. Forecast Average and Peak Token Demand

Calculate Input and Output TPM

Use the one-minute buckets collected earlier to turn measured traffic into forecast demand. Calculate demand separately for chat, summarisation and agent tasks.

Input TPM = RPM × average prompt tokens; output TPM = RPM × average output tokens. Add input and output TPM to get total TPM, then add together workloads that share capacity. Use token and request data from matching time windows - not an average of workload averages.

Hypothetical UK SaaS calculation: 120 RPM × 2,000 prompt tokens gives 240,000 input TPM. With 500 output tokens per request, output demand is 60,000 TPM, giving 300,000 total TPM.

Check both RPM and TPM against the relevant limits.[1][2]

Account for Peaks, Growth and Extra Model Calls

Calculate average, p95 and p99 demand from actual token totals in matching one-minute buckets. Don’t multiply unrelated p95 request rates and token lengths. Check shorter bursts too, where rolling limits apply.

Include only recurring peaks that affect your service, such as UK working hours, month-end, launches and campaigns. Estimate request growth and token growth separately, then combine their effects: 20 per cent more requests and 10 per cent longer prompts mean 32 per cent more input TPM.[5]

Before calculating tokens, work out the expected downstream model calls for each user request. Include retries, agent loops, tool-result follow-up calls, and fan-out to several models or parallel sub-tasks. Where token lengths differ between calls, use the length for each call type. Don’t count retries or cache misses twice.

Compare Three Forecast Cases

Turn measured token demand into a cautious planning figure for capacity sizing. Compare normal, growth and stress cases, then plan for the highest demand level you can reasonably expect.

Illustrative cases based on the 120-RPM baseline; RPM means effective model calls, including any extra-call allowance.

Case Forecast period and assumptions Peak model-call rate (RPM) Average prompt tokens Average output tokens Total TPM
Expected Six months; 20% RPM growth, 10% prompt growth and 5% output growth; normal seasonal peak 144 2,200 525 392,400
High-growth Six months; 50% RPM growth, 25% prompt growth and 15% output growth; larger launch peak 180 2,500 575 553,500
Stress Planned campaign plus 2× retry/agent allowance; 100% RPM growth, 50% prompt growth and 30% output growth 240 3,000 650 876,000

Use the highest reasonable case as the input to capacity sizing in the next step.

Concurrency = (RPM ÷ 60) × mean request duration in seconds.

For streaming responses, use time to completion to estimate in-flight concurrency. Record whether each peak represents an observed p95, a planned event peak or a stress assumption.

Concurrency is a steady-state estimate, not a worst-case guarantee. Test peak concurrency and latency under load, using production-like prompt lengths, output limits and concurrency. Published throughput figures are only reliable when their workload characteristics match your planned traffic.[4]

3. Calculate Required Capacity and Headroom

Verify Quotas and Tested Throughput

Use the highest forecast case from the previous section to check whether quotas and measured throughput can support the plan.

For hosted inference, list the limits at each scope: model, account/project, region, endpoint and subscription. A workload can stay within total TPM but exceed input TPM when prompts are long, or RPM when requests are short.[9][10] Note any shared limits and the lead times for quota increases.

For self-managed inference, benchmark prompt processing and generation together. Use representative lengths, concurrency, caching, batching and mixed workloads. Base capacity on the highest sustained throughput that meets your time-to-first-token and completion-latency targets, rather than the hardware’s theoretical peak.[7][8]

Record the model version, hardware, quantisation, context length, batch size, caching policy and region so the test can be repeated.

Calculate Serving Units

Once you have confirmed limits and throughput, convert peak demand into serving units.

Required units = ceiling[peak demand × (1 + growth allowance) × (1 + workload overhead) ÷ usable capacity per unit].

Convert all rates to the same unit before dividing. If the chosen forecast already includes growth and workload overhead, set those extra allowances to zero.

Calculate input, output, request-rate and concurrency requirements separately, then use the largest unit count. Check model memory and KV-cache needs too. Test that count under the combined workload: separate throughput measurements do not prove that capacity scales linearly.

Set Headroom and Failure Reserves

After base sizing, add headroom for bursts and failures. Include growth only if the forecast does not already account for it, and keep it separate from burst and forecast-error reserves. At a 75% utilisation limit, divide demand by 0.75 once, unless usable capacity already includes this margin.

Set the failure target first. If the specified instance, zone or region is lost, the surviving capacity must still meet demand within the agreed utilisation limit. Do not count spare capacity twice unless the same reserve can cover both needs.

Record lead times for quota increases, instance start-up, model loading and cache warm-up. Arrange quota approval and pre-warmed capacity before the forecast peak.

4. Test Capacity, Control Demand and Update Forecasts

Test Peaks and Failures

Use the highest forecast case as your load-test baseline. Before committing spend, test it under normal traffic, forecast peaks and sustained stress. Vary prompt and output lengths, concurrency, cache misses, retrieval payloads, agent depth, slow tools and scale-up delays.

Record accepted and completed requests, input/output TPM, queue time, streaming time to first token, end-to-end p95/p99 latency, timeouts, HTTP 429 responses, retries and truncated outputs. A pass means the forecast peak meets service targets, queues stay bounded and the planned failure reserve works under failure conditions. A short throughput spike does not count.[11][12]

If the test fails, control demand before adding capacity.

Set Overload Controls and Assign Owners

Set limits on both queue size and waiting time. Apply token-aware admission control before model calls, reserve capacity for interactive traffic and defer optional batch work first. Cap output length, agent depth and parallel calls.

Keep retries in one layer only: the application or the client library. Retry only transient failures, and only when safe. Honour Retry-After and use exponential back-off with jitter, capped attempts and an overall deadline. Propagate cancellation so abandoned requests stop consuming capacity.[13][14][15]

Risk Mitigation Accountable owner
Forecast error Compare actual demand with forecast ranges daily; revise capacity when excess demand persists Product owner
Token-length inflation Track p95/p99 lengths; enforce prompt, retrieval and output budgets ML/platform lead
Retry amplification Enforce one retry layer, bounded attempts and deadlines SRE lead
Throttling Monitor request/token quotas; request increases early and control admission Cloud/platform owner
Regional failure Test failover and preserve priority for critical traffic Infrastructure lead

Track Forecast Accuracy and Update the Worksheet

Monitor RPM, input/output TPM, token-length distributions, cache-hit rate, concurrency, queue depth and age, and cost per successful task in £. Include failed attempts and retries in that cost. Split dashboards by model, region and workflow. Alert on forecast variance and shrinking headroom, with an owner and an immediate action for each alert. Read available quota headers to distinguish request exhaustion from token exhaustion.[11][12][16]

To check forecast accuracy against actual costs, estimate monthly spend from traffic bands. Do not extrapolate peak demand across every hour. Calculate:

Uncached input tokens × input rate + output tokens × output rate + cached input tokens × cached rate

Then add provisioned infrastructure, monitoring, storage, network and failover costs. Keep cached and uncached input mutually exclusive to avoid double-counting. Use verified £ rates or a dated exchange-rate assumption, and state whether VAT and discounts are included.

Review actuals daily and assumptions weekly during volatility. Keep a version-controlled worksheet covering formulas, forecast ranges, growth assumptions, token distributions, quotas, tested throughput, headroom, failure reserves, cost rates, owners and the next review date. Recalculate after changes to models, prompts, retrieval, caching, agent workflows or user behaviour - not just when request volumes increase.

LLM Cost & Capacity Planning: Tokens, Prefill and Decode | AI System Design Series Episode 4

5. Conclusion: Keep Your Capacity Plan Tested

Once you’ve sized and tested capacity, keep the worksheet up to date and review it regularly.

Averages are not a capacity target. Base capacity on measured peak demand, input and output tokens, concurrency and latency targets. Forecast peaks using explicit assumptions about growth and extra calls. Then check request limits, token limits and tested throughput.[6]

Keep ordinary headroom separate from the failure reserve so both can support your agreed service targets.[17]

Assign a named owner and fill the worksheet with a representative week of data. Identify the peak case you need to protect and schedule the load test before approval. Only mark the worksheet as ready once its assumptions have been tested and a review date is set.

For AI strategy or custom agent implementation, Hokstad Consulting can help.

FAQs

How can I forecast peak token demand without historical data?

Start with workload-unit modelling: estimate daily requests and average tokens per request. Then add a 20% to 30% buffer for trial iterations or failed runs.

Use Little’s Law (average in-flight work = throughput × response time) to estimate the baseline capacity needed for planned traffic. For token-aware scheduling, reserve capacity as each request arrives, using its estimated prompt length and expected output length.

How should I size spare capacity for unpredictable token lengths?

Use a token-aware scheduler rather than counting requests [1]. Measure 95th-percentile token usage across representative tasks, then set capacity caps above that level to allow for longer, valid responses [2].

For agent loops, reserve 10%–20% of the total token budget for final completion, including last-step input context and validation [2]. Reserve capacity atomically before sending each request. Then reconcile the reservation with actual usage and release any unused capacity [1][2].

When should I shorten prompts rather than add capacity?

Shorten prompts first to cut costs or tackle immediate efficiency issues: shorter inputs can reduce costs by 15% to 25% [1]. Before scaling infrastructure, prioritise caching frequent queries, using smaller specialised models and applying INT8 quantisation [2].

Add capacity only when 60 to 90 days of metrics back your steady-state demand forecast and show that baseline usage - not temporary spikes - needs more resources [3][2].

Need help with your DevOps, cloud or AI plans?

Hokstad Consulting helps companies with DevOps transformation, cloud architecture and hands-on AI development — pragmatic consulting with measurable results.

Our services: DevOps on Retainer · Hosting & Cloud · AI Development & Strategy