arrow_back Back to AIFC
H
pending Claude

Ollama vs vLLM vs SGLang: Which Inefficiency Is Your Stack Actually Fighting?

Grounded / Real Inflated / Uruttu
70% real
30% uruttu
article Original Content
Ollama vs vLLM vs SGLang
Every inference engine is really an answer to one question: where does the waste come from?
Ollama assumes the bottleneck is access. It packages a quantized model (GGUF through llama.cpp, or MLX on Apple Silicon) into a single local runtime. By default it serves requests in order and runs entirely offline. It’s built for one person at one machine, and it does that job very well.
vLLM assumes the bottleneck is GPU memory and idle time. Continuous batching lets new requests join the running batch at every decoding step instead of waiting for the slowest sequence to finish. PagedAttention borrows from operating-system virtual memory: the KV cache is split into fixed-size pages, so memory is allocated on demand rather than reserved up front. The result is high throughput across thousands of unrelated prompts.
SGLang assumes the bottleneck is repetition. Agents and multi-turn conversations send the same long system prompts, tool definitions and chat history again and again. RadixAttention stores those prefixes in a radix tree so shared context is computed once and reused, and a cache-aware router sends each request to the worker that already holds its prefix. Constrained decoding then forces the output into valid JSON or a regex pattern.
Three engines, three assumptions about where compute is lost:
Access → Ollama
Concurrency → vLLM
Shared context → SGLang
Choosing between them is less about benchmarks and more about knowing which of these problems you actually have.
Which constraint shapes your stack today?
verified Validated Content

Ollama vs vLLM vs SGLang

Each engine optimizes for a different kind of waste.

Ollama optimizes for access. It wraps quantized models (llama.cpp/GGUF, plus its own engine and Apple Silicon support) in a simple local runtime that works offline. It handles light concurrency by queueing and limited parallel requests, but it is built for one person on one machine, not for high-throughput serving.

vLLM optimizes for GPU utilization. Continuous batching lets new requests join the running batch at every decoding step, and PagedAttention allocates KV cache in fixed-size pages on demand, as an OS does with virtual memory. This gives high throughput across many concurrent, unrelated requests. It also offers automatic prefix caching and structured outputs.

SGLang optimizes for reuse. RadixAttention keeps shared prefixes (system prompts, tool definitions, chat history) in a radix tree so they are computed once. A cache-aware router sends each request to the worker already holding its prefix, and constrained decoding enforces valid JSON or regex output. It shines on agents and multi-turn workloads with heavy repetition.

Rule of thumb:

  • Local, personal, offline → Ollama
  • Many concurrent, diverse requests → vLLM
  • Repetitive long prefixes and structured agent workloads → SGLang

Benchmark on your own traffic, because workload shape matters more than headline numbers.