Skip to the page
Tecyfy

vLLM vs Ollama: which to run an open model with

Ollama runs open models on your own machine with one command, on a Mac, Windows or Linux, and by default answers one request per model at a time. vLLM is a serving engine for Linux GPU servers that batches many users' requests together. How each starts, what each needs, what happens when 10 people ask at once, and which to pick for your job.

Tecyfy · Published · 7 min read

Stained glass of a home coffee machine making one cup beside a cafe machine filling a row of cups, labelled vLLM

Use Ollama to run an open model on your own machine; use vLLM to serve one to many users from a GPU server. Ollama installs on a Mac, Windows or Linux, pulls a model with one command and, by default, answers one request per model at a time. vLLM runs on Linux with a supported GPU and batches many requests together, which is what keeps a shared server fast.

Both run on your own hardware, both load open models such as Qwen, Llama or Gemma, and both answer through an OpenAI-compatible API. The question is not which is better; it is how many people will send requests at once, and to what hardware.

Side by side

OllamavLLM
Built forRunning models on your own computerServing a model to many users
Runs onmacOS, Windows, LinuxLinux (Windows through WSL; Apple Silicon through a plugin)
GPUsNVIDIA (compute capability 5.0+), AMD, Apple Metal; spills to system RAMNVIDIA (compute capability 7.5+), AMD, Intel, TPUs and more
Startollama run gemma4:e2bvllm serve Qwen/Qwen2.5-1.5B-Instruct
Models fromOllama's library, or a GGUF or Safetensors fileHugging Face repos, many quantised formats including GGUF
Requests at once per model1 by default (OLLAMA_NUM_PARALLEL)Continuous batching, as many as memory allows
MemoryLoads and unloads models (kept 5 minutes after use)Claims 92% of GPU memory at start
APIlocalhost:11434/v1 (OpenAI-compatible)localhost:8000/v1 (OpenAI), plus Anthropic Messages

What happens when 10 people ask at once

Ollama processes requests for a model one at a time unless you raise OLLAMA_NUM_PARALLEL, and queues the rest in order. If one answer takes 8 seconds, the 10th person's request waits 72 seconds before it starts and gets its answer at 80 seconds. Raising the setting helps, but each parallel slot needs its own context in memory: 4 slots of an 8K context take the memory of 32K. Past 512 queued requests (OLLAMA_MAX_QUEUE), the server answers 503.

vLLM was built for this case. It adds new requests to the running batch as others finish (continuous batching) and stores each request's KV cacheKV CacheWork a model saves from the text it has already read, so it is not redone for every new token. Prompt caching keeps that work between requests and charges less for it. in small blocks, so little memory is wasted. In the paper that introduced it, that gave 2 to 4 times the throughput of the serving systems of the day at the same latency. The cost is setup: a Linux machine, a supported GPU, and a server that takes most of that GPU's memory for itself.

Try itvLLM or Ollama for your job
Who sends requests
On
10
8
1
0–8 s
8–16 s
16–24 s
24–32 s
32–40 s
40–48 s
48–56 s
56–64 s
64–72 s
72–80 s

vLLMLast answer at 80 s

vLLM. The queue is long: vLLM's continuous batching serves everyone together instead of in turn. With 1 slot, the last of 10 requests starts after 72 seconds.

Queue arithmetic only: it assumes each request takes the same time and that parallel slots do not slow each other, which they do a little. Each extra slot needs its own context in memory. vLLM's speed depends on the model, GPU and settings; measure on yours.

Starting each

Ollama:

ollama pull gemma4:e2b
ollama run gemma4:e2b          # chat in the terminal
# or call it from code at http://localhost:11434/v1

vLLM:

pip install vllm
vllm download-kernels
vllm serve Qwen/Qwen2.5-1.5B-Instruct --max-model-len 8192
# OpenAI-compatible API at http://localhost:8000/v1

The same Python works against either, with only the base URL and model name changed:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key="unused")  # or :8000/v1 for vLLM
reply = client.chat.completions.create(
    model="gemma4:e2b",
    messages=[{"role": "user", "content": "Explain a Kafka partition in one sentence."}],
)
print(reply.choices[0].message.content)

Which to pick

  • Trying models on your laptop, or one person using a model all day: Ollama. It runs where you are, switches models without a restart and frees memory when idle.
  • A small team on a shared machine, light use: Ollama with OLLAMA_NUM_PARALLEL raised to what memory allows, behind a proxy. Watch the queue.
  • An app or many users, on a Linux GPU server: vLLM. It keeps the GPU busy with batches, serves several LoRALoRAA way to fine-tune a model by freezing its weights and training 2 small matrices beside each chosen layer, so a task needs a tiny file instead of a full copy of the model. adapters on one base model, and supports structured outputs and tool calling.
  • No GPU at all: Ollama runs on the CPU and system RAM, slowly. vLLM has CPU builds, but its strengths show on GPUs.

Either way, check first that the model fits: our GPU memory calculator gives the weights and cache for each model at each precision, and how much VRAM you need to run an LLM locally explains the numbers. Neither server should face the internet without a proxy in front; the vLLMvLLMAn open-source engine for serving language models fast, built on PagedAttention, that answers requests through the same kinds of API the big model makers offer. page explains why its API key alone is not enough. To build with open models from the start, the open models module of our free AI engineering course serves one with vLLM.

Questions

What is the difference between vLLM and Ollama?
Ollama is an app for running open models on your own computer: download it for macOS, Windows or Linux, pull a model and chat or call its local API. vLLM is a serving engine for running a model behind an API for many users, built for throughput with PagedAttention and continuous batching, and installed on Linux with a supported GPU.
Is vLLM faster than Ollama?
For many users at once, vLLM is built for it: it batches incoming requests continuously and manages KV cache memory with PagedAttention, which its paper measured at 2 to 4 times the throughput of earlier serving systems at the same latency. Ollama processes 1 request per model at a time by default (OLLAMA_NUM_PARALLEL is 1) and queues the rest. For one person on one machine, the difference matters much less.
Can I run vLLM on a Mac or Windows?
vLLM's GPU builds need Linux. It does not support Windows natively; use WSL. On Apple Silicon it runs through vLLM-Metal, a community-maintained plugin. Ollama installs natively on macOS, Windows and Linux.
How do I let Ollama handle more requests at once?
Set OLLAMA_NUM_PARALLEL when starting the server. Memory grows with it: each parallel slot needs its own context, so 4 slots of an 8K context take the memory of a 32K context. Requests beyond the slots wait in a queue, 512 by default (OLLAMA_MAX_QUEUE), after which the server returns 503.
Do vLLM and Ollama work with the OpenAI SDK?
Yes. Ollama serves an OpenAI-compatible API at http://localhost:11434/v1, and vLLM at http://localhost:8000/v1, which also offers the Anthropic Messages API. Point the SDK's base URL at the server and use the model's name.