#791 · AI & Technology Tool

Prompt Caching Latency Capacity Calculator

Estimate how prompt caching changes end-to-end inference latency and the concurrency needed to sustain a request rate. Model uncached prefill, cached-prefix lookup, output decoding, and fixed network or queue overhead separately. The result highlights time to first token, full response latency, cached share, and the number of in-flight requests implied by Little’s Law.

Calculator

Latency and traffic assumptions
req/s
Average requests arriving each second.
tokens
Prompt tokens processed normally per request.
tokens
Reusable prefix tokens served from cache.
tokens
Average generated response length.
tok/s
Effective uncached input processing rate per worker.
tok/s
Effective cached-token processing rate per worker.
tok/s
Effective generated-token speed per request.
ms
Network, scheduling, and non-token overhead.

How to use this calculator

  1. Enter average request arrivals and the cached versus uncached input-token mix.
  2. Use measured effective token rates for prefill, cache access, and decoding.
  3. Add fixed non-token overhead such as network and scheduling time.
  4. Read full latency for user experience and concurrency for capacity planning.

Formula

TTFT = overhead + uncached tokens/prefill rate + cached tokens/cache rate
Full latency = TTFT + output tokens/decode rate
Concurrency = requests/second × full latency in seconds

What the result means

Full response latency estimates when the complete answer is available. TTFT estimates when generation can begin, and average concurrency estimates simultaneous in-flight requests at the stated arrival rate.

Rates should be measured under representative batch size, model, hardware, and cache-hit conditions. Queueing under saturation is not automatically included.

Example calculation

At 8 requests/s with 600 uncached tokens, 2,400 cached tokens, 300 output tokens, rates of 12,000, 120,000, and 120 tokens/s, plus 80 ms overhead:

TTFT = 150 ms
Decode = 2.50 s
Full latency = 2.65 s
Concurrency = 21.2 requests

Tips for better results

  • Use p50 rates for typical planning and p95 inputs for latency-risk scenarios.
  • Measure cache lookup speed instead of assuming cached tokens are free.
  • Separate time to first token from full-response latency.
  • Leave headroom because queueing rises rapidly near saturation.
  • Recalculate after changing output-length limits.

Frequently asked questions

Does prompt caching remove all prefill latency?

No. Uncached tokens still require normal prefill, and cached tokens can still incur lookup and transfer time.

Why does output length dominate full latency?

Autoregressive decoding produces output sequentially, so long responses can take more time than cached prompt processing.

What does concurrent request capacity mean here?

It is the average in-flight request count implied by arrival rate multiplied by response time, before extra headroom.

Does the estimate include queueing delay?

Only if queueing is included in fixed overhead. Run a higher-overhead scenario for saturated conditions.

Can I use provider-reported peak token speed?

Measured effective speed at your model, batch size, and workload is safer because peak specifications may not match production.

Variables and units

VariableMeaningUnit
λArrival raterequests/second
U, CUncached and cached inputtokens/request
P, KPrefill and cache speedstokens/second
DDecode speedtokens/second
LFull response latencyseconds

Browse calculator categories

22 category hubs