vLLM vs Ollama
One line: Ollama optimizes local developer experience; vLLM optimizes GPU throughput in production. Both can expose OpenAI-style /v1, so you can write the app against Ollama and later switch base_url to vLLM. Weights and model cards still live on Hugging Face.
Comparison
When to use Ollama
- Prompt iteration, demos, and offline drafts on a laptop
- You want a reply from
ollama runin minutes - No NVIDIA server, or you only have Apple Silicon
- Agent work needs a “good enough” local OpenAI-compatible endpoint
Follow the Ollama tutorial: install → run → /v1. You do not need PagedAttention first.
When to switch to vLLM
- Concurrent users grow; Ollama queues while the GPU is still underfilled
- You have A10 / A100 / L40S / H100 and tokens/s is an SLA
- Inference must stay in your VPC, with existing OpenAI SDK / LangChain clients
- Offline jobs over many prompts (synthetic data, evals) that benefit from continuous batching
Migration is usually: same chat.completions code, new base_url and model string, then vllm serve on the GPU box.
Where Hugging Face fits
Mental model: Hub stores weights → Ollama for local play → vLLM for serving.
Mix-up pitfalls
- Passing an Ollama library name (
gemma4) to vLLM--model: vLLM wants a Hub ID or a local directory. - Assuming quant files are interchangeable: GGUF ≠ AWQ.
- Running Ollama and vLLM on the same consumer GPU: they fight for VRAM—
ollama stop/ kill the other process first. - Treating the vLLM Docker image as a graphical model store: there is no Ollama Library UX.
Migration checklist
- Prove the product path against Ollama with the OpenAI SDK.
servean ungated HF Instruct repo on vLLM (this course:Qwen/Qwen2.5-0.5B-Instruct).- Change only
base_url=http://<gpu-host>:8000/v1andmodel=. - Compare quality on production prompts; then add quantization / tp.
- Add a reverse proxy and rate limits; do not rely on
--api-keyalone.