LLM batch size & throughput calculator

Continuous batching is the #1 lever for lowering self-hosted LLM inference cost. Sweep batch sizes from 1 to 256 below to see where your cluster transitions from memory-bandwidth bound to compute bound, where KV cache OOMs, and which batch size meets your per-user latency SLA at the lowest $/1M tokens.

Interactive calculator

Batch SizeTotal VRAMAggregate tok/sPer-User tok/sTPOT (ms)$/1M TokensRegime

Frequently asked questions

Why does increasing batch size boost aggregate tokens/sec so dramatically?

At batch size 1, LLM decode reads the entire active model weights from HBM just to generate 1 token, leaving Tensor Cores over 95% idle. Batching N requests amortizes that weight read across N tokens in a single forward step until you hit either the GPU compute ridge point or the KV cache VRAM ceiling.

What is the roofline ridge point for LLM decode?

The ridge point is the batch size where arithmetic intensity (FLOPs per byte read from HBM) equals the GPU's Tensor Core FLOPS divided by HBM bandwidth. Below the ridge point, decode is memory-bandwidth bound; above it, aggregate throughput plateaus and per-user speed drops roughly inversely with batch size.

What per-user decode speed (TPOT) do interactive chat and coding agents need?

Human reading speed is ~5–8 tokens/sec, but interactive chat feels snappy at 25–40 tok/s (25–40 ms TPOT), and agentic coding loops benefit from 50–100+ tok/s. Offline batch jobs can push batch size all the way to the VRAM ceiling to minimize $/1M tokens.

Why does KV cache limit maximum batch size before compute saturates?

At long context lengths (16K–128K), each concurrent sequence holds gigabytes of KV cache. Even when Tensor Cores have spare FLOPS, the serving engine (vLLM/SGLang) must queue requests once KV cache fills available HBM.

How does tensor parallelism affect batch throughput?

Splitting a model across 2–8 GPUs multiplies both aggregate HBM bandwidth and Tensor Core FLOPS, minus NVLink all-reduce overhead (~6% at TP=2, ~11% at TP=4, ~18% at TP=8).

All calculations run locally in your browser. Roofline estimates model decode steps with 72% HBM efficiency and 45% Tensor Core efficiency; prefill-heavy workloads will see lower decode concurrency without chunked prefill or disaggregated serving.