One model, two economics
The same model serves both, and almost every configuration choice that helps one hurts the other.
Because the weights are read once per step regardless of batch size, adding requests to a batch costs almost nothing until the arithmetic or the cache runs out.
That is the whole trade in one line, and it is why an idle server should still batch.
Static batching wastes most of it
A fixed batch finishes when its slowest member finishes, so a batch containing one 2,000-token answer and thirty 50-token answers holds thirty slots idle for the duration.
On realistic length distributions that is often under 30 percent, and the wasted capacity is paid for in full.
Continuous batching
The scheduler works per token rather than per request, so the batch is refilled continuously instead of being drained and refilled.
That is the single largest serving improvement available, and it is why vLLM and similar servers exist rather than a plain loop over requests.
The constraint becomes memory: every active sequence holds a KV cache, so the batch size is limited by how many caches fit rather than by arithmetic.
One request path, in order
- The request arrives and joins the waiting queue.
- The scheduler admits it when there is KV cache room, not when the batch empties.
- Prefill runs for the new sequence, possibly interleaved with other sequences' decode steps.
- Decode proceeds one token per step across every active sequence.
- The sequence finishes, its cache is freed, and the next waiting request takes the space.
When to choose batch outright
If no user is waiting, choose batch.
Embedding a corpus, classifying a backlog, generating summaries overnight and running an evaluation set are all batch problems dressed as API calls.
Providers price them at a discount because they can schedule the work into their own idle capacity, with a completion window of hours rather than seconds.
The engineering follows: batch work needs idempotent jobs, a result store and a retry policy, and does not need streaming, timeouts tuned to a human, or a warm autoscaled fleet.
Mixing the two on one deployment is the common mistake.
A batch job admitted alongside interactive traffic fills the KV cache and pushes every user's latency up, and the two belong on separate pools.