Comparison
vLLM vs Ollama: Concurrency and When to Use Each
Use Ollama to run open models on your own machine: one install, one command, and it loads and unloads models as you switch between them. Use vLLM to serve one model to many concurrent users on GPUs, where its continuous batching and paged attention memory matter. A common path is Ollama in development and vLLM in production.
Last updated · By Rohit Ghumare
vLLM vs Ollama at a glance
| vLLM | Ollama | |
|---|---|---|
| What its docs call it | A fast and easy-to-use library for LLM inference and serving | A way to use open models in desktop apps and coding agents, or build them into your application |
| Install | uv pip install vllm in a Python environment; the quickstart lists Linux as the prerequisite OS | Download the app for macOS, Windows or Linux |
| Start a model | vllm serve <Hugging Face model ID> | ollama pull <model>, then call the local server or ollama run <model> |
| Default address | http://localhost:8000 | http://localhost:11434 |
| API | OpenAI-compatible server, plus Anthropic Messages API and gRPC | Its own API, plus a subset of the OpenAI API and an Anthropic-compatible API |
| Models per server | One: the server "currently hosts one model at a time" | Several, if memory allows; idle models are unloaded after 5 minutes by default |
| Concurrent requests | Continuous batching of incoming requests, PagedAttention, chunked prefill, prefix caching | Parallel requests per model set by OLLAMA_NUM_PARALLEL, which defaults to 1 except on the MLX backend on Apple hardware; extra requests queue, up to 512 by default |
| Where models come from | Hugging Face by default | The Ollama model library; you can also import GGUF or Safetensors weights with a Modelfile |
| Hardware named in the docs | NVIDIA and AMD GPUs, x86/ARM/PowerPC CPUs, and hardware plugins including Apple Silicon | Nvidia and AMD Radeon GPUs, Apple GPUs through Metal, and Vulkan; a model can be split across CPU and GPU memory |
Every row comes from the vLLM and Ollama documentation listed in this page's sources, read on 2026-12-04. Ollama also offers cloud models; this page covers local use. This page gives no throughput or latency figures: they depend on the model, the hardware and the traffic, so measure your own.
When to choose each
Choose Ollama when
- You are one developer on a laptop or workstation and want a model answering in minutes.
- You switch between several models in a day. Ollama loads them on demand and unloads idle ones.
- The model does not fully fit in GPU memory. Ollama can place part of it in system memory, at a cost in speed.
- You want open models inside desktop apps or coding agents without writing server configuration.
- You are prototyping against an OpenAI-style endpoint before any infrastructure exists.
Choose vLLM when
- Many users or many agents will call one model at the same time. Continuous batching lets requests join and leave the running batch between decoding steps instead of waiting in line.
- You have dedicated GPUs and care about tokens per second per GPU and tail latency.
- You load weights by Hugging Face model ID and want the server to follow that ecosystem.
- You need serving features such as structured outputs, tool-calling parsers or several LoRA adapters on one base model, all of which the vLLM docs list.
- You are deploying on a cluster, where one model per server process is the normal shape anyway.
Use both when
Develop against Ollama, deploy on vLLM. Both speak the OpenAI chat completions format, so the client code stays the same. Re-test quality after the move: the two sides often run different quantizations of the same model.
Code: one example per side
Commands and model names come from each project's quickstart.
Model names, ports and defaults are as the linked documentation showed them on 2026-12-04.
Ollama: pull a model, then call the local OpenAI-compatible endpoint.
ollama pull gemma4:e2b
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "gemma4:e2b", "messages": [{"role": "user", "content": "Say hello in one sentence."}]}'vLLM: start the server, then call the same kind of endpoint on its port.
uv pip install vllm --torch-backend=auto
vllm serve Qwen/Qwen2.5-1.5B-Instruct
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "Qwen/Qwen2.5-1.5B-Instruct", "messages": [{"role": "user", "content": "Say hello in one sentence."}]}'One client for both, in standard-library Python. Only the base URL and the model name differ. It needs one of the two servers running.
import json
import sys
import urllib.request
SERVERS = {
"ollama": ("http://localhost:11434/v1", "gemma4:e2b"),
"vllm": ("http://localhost:8000/v1", "Qwen/Qwen2.5-1.5B-Instruct"),
}
base_url, model = SERVERS[sys.argv[1] if len(sys.argv) > 1 else "ollama"]
payload = {"model": model, "messages": [{"role": "user", "content": "Say hello in one sentence."}]}
request = urllib.request.Request(
f"{base_url}/chat/completions",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(request) as response:
print(json.load(response)["choices"][0]["message"]["content"])Common mistakes
- Benchmarking with one request at a time. That hides the main difference. Test at the concurrency you expect, and report time to first token and time between tokens, not only an average.
- Comparing different weights. A 4-bit GGUF on one side and full-precision weights on the other is a quantization comparison, not an engine comparison.
- Forgetting Ollama's default context. Ollama's docs give 4096 tokens in the FAQ and a VRAM-based default (4k under 24 GiB, 32k for 24 to 48 GiB, 256k at 48 GiB or more) on the context-length page, both read on 2026-12-04. Check what your install uses with
ollama ps, and setOLLAMA_CONTEXT_LENGTHornum_ctxto what your prompts need before you compare answers. - Raising
OLLAMA_NUM_PARALLELwithout counting memory. The Ollama docs note that parallel requests multiply the context allocation: a 2K context with 4 parallel requests becomes 8K. - Expecting vLLM to swap models per request. One server hosts one model. Run one server per model and route in front of them.
- Ignoring the KV cache when sizing a GPU. Quantized weights are only part of the memory. The attention cache for every active request needs room too.
- Putting either server on the open internet as-is. Add authentication and a gateway. vLLM's server accepts an
--api-keyargument; treat that as a minimum, not a security design. - Choosing by someone else's benchmark. Results depend on model, hardware, quantization and traffic shape. Run your own.
Frequently asked questions
Is vLLM faster than Ollama?
It depends on the load, so no single number answers it. vLLM is designed for many simultaneous requests: it batches incoming requests continuously and manages attention memory in pages. With one user on one machine the gap matters far less. Benchmark both on your hardware, at the concurrency you expect.
Can I use Ollama in production?
Ollama can serve several requests: its FAQ, read on 4 December 2026, lists settings for parallel requests per model, loaded models and queue length, and a 503 response when the queue is full. The curriculum's guidance is Ollama for development and single users, and vLLM for a service shared by many users on GPUs.
Does vLLM run on a Mac?
On 4 December 2026 the vLLM quickstart listed Linux as the required operating system and said vLLM also works on macOS through vLLM-Metal, which uses Apple's Metal framework for GPU acceleration on Apple Silicon. That path uses MLX as the compute backend instead of PyTorch and needs MLX-optimized models from Hugging Face.
Do vLLM and Ollama use the same API?
Both expose an OpenAI-compatible chat completions endpoint, so a client written against that format can switch by changing the base URL and model name. Ollama's docs say it supports a subset of the OpenAI API and also has its own API. vLLM's server implements the OpenAI protocol directly.
Can I develop on Ollama and deploy on vLLM?
Yes, and the curriculum describes that pipeline. Keep your client on the OpenAI-compatible endpoint so only the base URL changes. Expect differences: the weights are often quantized differently on each side, so re-run your evaluation set against the vLLM deployment before trusting results from your laptop.
Learn it by building
These free lessons cover how serving engines work and how to pick one:
- Serving Engine Internals — PagedAttention, Continuous Batching, Chunked Prefill: what vLLM's scheduler does, with a toy continuous batcher in standard-library Python.
- Self-Hosted Serving Selection — Matching Engine to Hardware and Scale: a decision tree across llama.cpp, Ollama, vLLM and SGLang.
- Production Quantization — AWQ, GPTQ, GGUF K-quants, FP8, MXFP4/NVFP4: which weight format fits which engine and hardware.
- Inference Metrics — TTFT, TPOT, ITL, Goodput, P99: what to measure when you compare engines.
- Load Testing LLM APIs — Why k6 and Locust Lie: how to run the comparison yourself.