vLLM Explained: High-Throughput LLM Serving for Developers

vLLM is the engine for high-throughput LLM serving. PagedAttention and continuous batching let one GPU serve many users through an OpenAI-compatible API.

By Galactic News Editorial · Published 2026-11-19T10:37:36+00:00 · Updated 2026-11-19T10:37:36+00:00

vLLM explained: high-throughput LLM serving for developers

vLLM Explained: High-Throughput LLM Serving for Developers

vLLM is an open-source engine for serving large language models at high throughput. It runs open-weight models on your own GPUs and exposes them through an OpenAI-compatible API. It started at UC Berkeley's Sky Computing Lab. It is now a PyTorch Foundation hosted project, licensed under Apache 2.0. If you need to serve many users from one model, vLLM is the default choice in production.

The core idea is simple. Serving a language model is mostly a memory problem. Each request needs memory for its key-value cache. Naive serving wastes most of that memory. vLLM fixes the waste, so more requests fit on the same GPU.

vLLM Explained: PagedAttention and the KV Cache

When a language model generates text, it stores attention keys and values for every token so far. This store is the KV cache. It grows as the response grows. The naive approach reserves one large, contiguous block of GPU memory per request, sized for the longest output the request might produce. Most of that block sits unused. The leftover space fragments. Other requests cannot use it.

PagedAttention fixes this. It borrows the idea of virtual memory paging from operating systems. The KV cache is split into fixed-size blocks, or pages. Blocks are allocated on demand as a request generates tokens. Finished requests free their blocks at once. The freed blocks go straight back to new requests. The technique was published as a paper, Efficient Memory Management for Large Language Model Serving with PagedAttention, at SOSP 2023.

The effect is large. The launch-era tests reported KV cache waste under 4 percent with PagedAttention. More requests fit on the same GPU. Throughput rises without new hardware. That is the whole pitch: same GPUs, more users.

Continuous Batching: Keeping the GPU Busy

PagedAttention solves memory. Continuous batching solves utilisation. Static batching collects a fixed group of requests, runs them all together, and waits until the longest one finishes before admitting new work. Short requests wait for long ones. The GPU idles between batches.

Continuous batching works differently. The scheduler runs at every token step, which is every forward pass of the model. After each step it checks which requests finished. It evicts them and admits new ones at once. The batch stays as full as memory allows. New requests start on the next step instead of waiting for a whole batch to clear.

Together, the two ideas compound. PagedAttention makes room for more requests. Continuous batching keeps those requests flowing. The result is high throughput under concurrent load, which is exactly what a production API needs.

What the vLLM Server Gives You

Most deployments use vLLM through its HTTP server. One command starts it:

vllm serve meta-llama/Llama-3.1-8B-Instruct

The server starts on port 8000 by default. It implements the OpenAI API protocol. Chat completions, completions, embeddings, and responses endpoints are available. An Anthropic Messages API and gRPC support are also listed in the documentation. Client code written against a commercial API can point at a self-hosted vLLM instance by changing the base URL and the model name. The standard OpenAI Python SDK works unchanged.

vLLM also works as a Python library. The same engine powers both. You can run generation offline in a script, or serve it over HTTP. Quantisation is built in, with support for AWQ, GPTQ, and FP8 formats. Multi-GPU serving uses tensor parallelism and pipeline parallelism. Structured output, tool calling, streaming, and multi-LoRA adapters are supported in the server.

The model weights come from Hugging Face. vLLM loads checkpoints by repository ID and supports more than 200 model architectures, according to its documentation. The primary and best-supported hardware is NVIDIA GPUs with CUDA. AMD, Intel, and other backends exist, but with narrower coverage.

Getting Started in Five Steps

  1. Install vLLM. Use pip in a Python environment on a machine with an NVIDIA GPU and compatible CUDA drivers. Docker images are available at vllm/vllm-openai on Docker Hub.
  2. Pick a model. Choose an open-weight model on Hugging Face that fits your GPU memory. An 8B model is a good first test. A 70B model needs tensor parallelism across multiple GPUs.
  3. Start the server. Run vllm serve <model>. The server downloads the weights and starts listening on port 8000.
  4. Point a client at it. Set the base URL to http://localhost:8000/v1 and use any OpenAI-compatible client. Use a dummy API key if your client requires one.
  5. Watch the metrics. vLLM exposes Prometheus metrics at /metrics. Track queue depth and token throughput before you tune anything.

One note on old tutorials. The older invocation python -m vllm.entrypoints.openai.api_server is deprecated and prints a warning. Use vllm serve. It is the current CLI.

vLLM vs Ollama vs llama.cpp

vLLMOllamallama.cpp
Built forHigh-throughput multi-user servingEasy local use on one machineEfficient local inference, CPU and GPU
HardwareData-centre NVIDIA GPUsLaptop, workstation, some serversCPU, Apple Silicon, consumer GPUs
BatchingContinuous batching, PagedAttentionParallel slots and a queueContinuous batching in llama-server
OpenAI APIYes, plus /metricsYesYes, via llama-server
Model formatsHugging Face safetensorsGGUF via its own libraryGGUF

The choice is about workload. vLLM wins when many users hit one model at once. Ollama wins when one person wants a model running quickly on a laptop. llama.cpp wins on CPU-only or Apple Silicon hardware. All three expose an OpenAI-compatible API, so client code moves between them with a base URL change.

When vLLM Is the Wrong Tool

vLLM is not a desktop app. There is no graphical installer. It is not built around CPU-only or Apple Silicon hardware the way Ollama and llama.cpp are. A single user chatting with a model on a laptop will not see its advantage. The setup cost only pays off under concurrent load.

It also needs real GPU memory. A large model on a small GPU will fail to load or run slowly. Check the model's memory needs against your card before starting. Quantisation helps: AWQ and FP8 shrink the model, but they change output quality slightly. Test with your own prompts before deploying a quantised model.

Security deserves attention too. The server accepts an --api-key flag, but the documentation warns not to rely on it alone to secure vLLM. Put the server behind a proper proxy or gateway with authentication. Never expose port 8000 directly to the internet.

Bottom Line

vLLM is the standard engine for serving open-weight language models to many users at once. PagedAttention cuts KV cache waste so more requests fit on one GPU. Continuous batching keeps the GPU full. The OpenAI-compatible server means existing client code works with a base URL change. Start with vllm serve on a small model, watch the metrics, and scale to larger models only when the numbers justify it. If you serve one user at a time, use Ollama instead.