Ollama vs vLLM vs TGI 2026
After picking a model, the inference engine decides your concurrency ceiling. Here is how Ollama, vLLM and TGI differ in batching, VRAM use and operational cost.
📜 Table of Contents
📖 Keep reading
Ollama vs vLLM vs TGI: Choosing an Inference Engine in 2026
Picking a model is step one. Running the same 8B model on Ollama and on vLLM feels identical for one user, and completely different for ten concurrent users. The engine decides how weights sit in VRAM, how requests queue, and whether the GPU idles while waiting on IO.
All three are open source and all expose an OpenAI-compatible /v1/chat/completions endpoint, so the question is scale, not capability.
Differences at a glance
| Dimension | Ollama | vLLM | TGI |
|---|---|---|---|
| Role | Single-machine dev runtime | Production serving | HuggingFace-native serving |
| Core | Wraps llama.cpp and other backends | PagedAttention engine | Rust server plus custom kernels |
| Install | One installer | pip or docker | Docker image or pip |
| Default port | 11434 | 8000 | 80 inside container |
| Concurrency | Weak, largely serial | Continuous batching | Continuous batching |
| Quantisation | GGUF model library | AWQ / GPTQ / FP8 | AWQ / GPTQ / bitsandbytes |
| Multi-GPU | Limited | Mature tensor parallelism | Mature tensor parallelism |
Three mechanisms behind the gap
Batching. vLLM and TGI insert new requests into the running batch and let finished sequences drop out. Under concurrency this raises throughput by several times, sometimes an order of magnitude, depending on model size, sequence length and GPU. Published benchmarks are indicative only.
VRAM management. PagedAttention allocates KV cache in fixed blocks, similar to OS paging, which cuts fragmentation. The gain is largest with long contexts, where KV cache can exceed the weight footprint.
Quantisation path. Ollama consumes GGUF; vLLM prefers AWQ, GPTQ or FP8 with compiled kernels; TGI accepts both. Lower bit width saves VRAM at a quality cost that depends on the model.
Getting started
# Ollama
ollama pull qwen3:8b && ollama run qwen3:8b # endpoint 127.0.0.1:11434/v1
# vLLM
pip install vllm
vllm serve Qwen/Qwen3-8B --max-model-len 8192 --gpu-memory-utilization 0.9
# TGI
docker run --gpus all -p 8080:80 ghcr.io/huggingface/text-generation-inference:latest --model-id Qwen/Qwen3-8B
Sizing VRAM
Weights are roughly parameter count times bytes per parameter (about 2 bytes at FP16, 0.5 at Q4) plus framework overhead. KV cache scales with layers, KV heads, head dimension, sequence length and concurrent requests. An 8B model needs about 16GB at FP16 or around 5GB at Q4; at 8K context with 8 concurrent requests the KV cache alone can take tens of GB. Loading a model and serving concurrent traffic are two different budgets.
How to choose
| Situation | Pick | Why |
|---|---|---|
| Laptop experiments, demos | Ollama | Installs in minutes, model library included |
| Shared internal API | vLLM | Continuous batching, metrics, OpenAI-compatible |
| Models already on HF Hub | TGI | Pulls straight from the hub |
| ARM or no discrete GPU | Ollama | Falls back to CPU inference |
| FP8 or multi-GPU | vLLM or TGI | Both mature |
Start on Ollama, migrate to vLLM when concurrency becomes the bottleneck. Because the API surface is identical, migration is mostly a base_url change.
FAQ
Can Ollama run in production? For low concurrency and internal tools, yes. It is not built for many simultaneous users; put a queueing gateway in front or switch to vLLM.
vLLM reports out of memory? Lower --max-model-len first, then --gpu-memory-utilization to around 0.85, then consider a quantised checkpoint. Avoid CPU offload for latency-sensitive work.
Can tok/s numbers be compared across engines? No. Throughput depends on GPU, quantisation, context length and batch size. Benchmark on your own hardware with identical prompts.
Default ports, flags and quantisation support change between releases; confirm against official documentation before deploying.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.