Batch Inference Throughput Calculator
Inputs
| Batch size | 32 |
|---|---|
| Output tokens per request | 256 |
| Batch completion time | 5 sec |
Batch Inference Throughput Calculator
Turn a measured batch completion time into aggregate tokens per second, per-request speed, and requests per second — the throughput-versus-latency trade-off of batched LLM serving.
Inputs
Batch
Results
Enter a value to see results.
Details
Batch Inference Throughput
Batched inference is how production language-model servers reach high utilization: instead of decoding one request at a time, they process many together. Because the model's weights are read once and reused for the whole group, the server's total output climbs sharply with batch size — but each individual request waits for the batch to finish. This calculator separates those two views, turning a measured batch completion time into aggregate throughput, per-request speed, and a request rate.
The batching trade-off
Autoregressive decoding is memory bound: each step reads every weight to produce one token. When a single request is in flight, almost all of that memory traffic serves just one user. Group several requests into a batch and the same weight read produces a token for every request at once, so the aggregate token rate rises with batch size while the bandwidth cost barely changes. The catch is latency — a request cannot leave until the batch step that contains it completes, so the per-request speed does not improve and may dip slightly as batches grow.
The formulas
From the batch size , the output tokens per request , and the measured batch completion time :
vaggvreqR=tbB×Nout=tbNout=tbBwhere is aggregate throughput, is per-request throughput, and is completed requests per second. The aggregate is simply the per-request speed multiplied by the batch size.
Worked example
A server decodes a batch of 32 requests, each producing 256 tokens, and the batch finishes in 5 seconds:
vaggvreqR=532×256=1638.4 tokens/s=5256=51.2 tokens/s=532=6.4 requests/sThe operator sees more than 1,600 tokens per second flowing out of the server, but each user reads at about 51 tokens per second. Doubling the batch to 64 — if memory allows and completion time stays near 5 seconds — would roughly double the aggregate while leaving the per-request figure unchanged.
Choosing a batch size
Aggregate throughput keeps rising with batch size only while the work remains memory bound. Once the batch saturates compute or the key-value cache exhausts device memory, completion time grows faster than the batch and per-request latency degrades. The practical target is the largest batch that keeps per-request latency acceptable while memory still fits, found by measuring completion time at several batch sizes. Real servers also use continuous batching, where requests join and leave on every step rather than as a fixed group, which raises sustained throughput further. For the single-stream ceiling that sets , see the Inference Throughput Calculator; for fleet-level capacity across many replicas, see the Effective Tokens per Second Calculator.
Frequently Asked Questions (FAQ)
Why is aggregate throughput so much higher than per-request throughput?
Aggregate throughput counts every token the server emits across all requests in the batch, while per-request throughput is what a single user experiences. Batching reads each model weight once and reuses it for the whole group, so total tokens served climbs roughly in proportion to batch size.
The individual request, however, still has to wait for the batch to finish, so its perceived speed does not improve — and can even drop slightly as the batch grows. This is the central trade-off of batched serving: throughput for the operator versus latency for the user.
Is a bigger batch always better?
Only up to a point. Aggregate throughput rises with batch size while the work stays memory bound, but once the batch saturates compute or the key-value cache exhausts memory, completion time grows faster than the batch and per-request latency suffers. The practical sweet spot is the largest batch that keeps per-request latency within the target while memory still fits, which is found by measuring completion time at several batch sizes.
How does continuous batching change this?
This calculator models a fixed batch that starts and finishes together. Modern servers use continuous (in-flight) batching, where new requests join and finished ones leave on every step, keeping the accelerator full even when sequence lengths differ. That raises sustained aggregate throughput above the fixed-batch estimate, but the same trade-off holds: total tokens per second improves while any single request is bounded by the decode speed.
Disclaimer
Estimates assume all requests in the batch generate the same number of tokens and start together. Real workloads mix sequence lengths and use continuous batching, so measured aggregate throughput will differ. Benchmark at several batch sizes on the target hardware before sizing capacity.