vLLM vs TGI vs Ollama: GPU Memory Throughput, PagedAttention & Batching Benchmarks A developer benchmarked vLLM 0.9.x, Hugging Face's TGI 2.4, and Ollama 0.6 on Llama-3-8B-Instruct fp16, finding vLLM reached 3,480 tok/s aggregate throughput at 65 concurrent requests versus 2,910 for TGI and 96 for Ollama. The comparison attributes vLLM's lead to PagedAttention's 16-token KV cache blocks, which cut fragmentation below 4% and allow 256 concurrent sequences on an A100-80GB, against 128 for TGI and a soft limit of 4 for Ollama. All three systems serve LLM inference, but they occupy non-overlapping points on the production spectrum. vLLM is a throughput-optimized serving engine built around PagedAttention and continuous batching. TGI Text Generation Inference, Hugging Face is a Rust-fronted, Python-core server with tuned kernels FlashAttention, custom CUDA graph capture and first-party model hub integration. Ollama is a llama.cpp-based local runner — GGUF quantized models, CPU/hybrid execution, zero-ops — and it is not designed for concurrent serving at all. Decision Matrix in One Sentence: Run vLLM if you serve 10 requests/second from a dedicated GPU fleet; run TGI if you need enterprise support, Ranger-level model hub integration, and SAFETENSORS-native weight streaming; run Ollama only for local development, air-gapped single-user inference, or laptop-class prototyping — never for concurrent production traffic. | Metric Llama-3-8B-Instruct, fp16 | vLLM 0.9.x | TGI 2.4 | Ollama 0.6 | |---|---|---|---| | Aggregate throughput 65 concurrent, 1k in/512 out | 3,480 tok/s | 2,910 tok/s | 96 tok/s | | Single-stream TTFT p50 | 182 ms | 161 ms | 310 ms A100 / 2.4 s CPU | | p99 latency @ 50 concurrent 512-token completion | 4.7 s | 5.2 s | ~41 s | | KV cache memory efficiency vs. naive allocation | ~4.2× more sequences | ~3.6× | N/A static context buffer | | Max concurrent sequences A100-80GB, 8B model | 256 continuous batch | 128 | 4 soft; degrades hard | | GPU memory idle overhead server process, MiB | 1,180 | 940 | 620 | | Quantization paths | FP8, INT8 W8A8 , AWQ, GPTQ | AWQ, GPTQ, EETQ, fp8 Hopper | GGUF Q4 K M/Q5/Q8 llama.cpp | | Streaming protocol | OpenAI-compatible SSE | SSE TGI native + OpenAI shim | SSE OpenAI-compatible | | Token-level rate limiting built-in | None bring your own | Built-in per-key queues | None | | p50 retraining/upgrade churn minor versions/yr | ~26 weekly releases | ~12 | ~18 | Ratings: vLLM 4.8/5 raw serving performance, ecosystem velocity , TGI 4.5/5 operational maturity, support , Ollama 3.9/5 developer ergonomics; scoring collapses under production concurrency . Autoregressive decoding stores key/value tensors for every token in the context. With fp16 and a 32-layer, 32-head, 128-dim-head architecture Llama-3-8B class , the KV cache per token is: KV per token = 2 K+V × num layers × num kv heads × head dim × dtype bytes = 2 × 32 × 8 × 128 × 2 = 131 KB/token GQA, Llama-3-8B = 2 × 32 × 32 × 128 × 2 = 524 KB/token MHA, no GQA A naive server pre-allocates a contiguous buffer per sequence for max seq len . At 8,192 tokens that's 1.07 GB per sequence in fp16 with GQA — an 80 GB A100 fits exactly one weights copy ~16 GB plus ~54 sequences even though most conversations never fill the buffer. Internal fragmentation routinely wastes 60–80% of the reservation. vLLM borrows virtual-memory paging from operating systems. The KV cache is carved into fixed-size blocks default 16 tokens/block ; a per-sequence block table maps logical positions to physical blocks scattered across GPU memory. Consequences: php flowchart TB subgraph vLLM "vLLM 0.9.x" A OpenAI API Server -- B AsyncScheduler