vLLM is an open-source engine that serves LLMs on your own GPUs. See how it works, what it runs on, how it compares, and when a hosted API fits better.

vLLM is an open-source inference engine that serves large language models on your own GPUs through an OpenAI-compatible API. Started at UC Berkeley and now a PyTorch Foundation project, vLLM stores each conversation's working memory in small blocks and batches requests continuously, so one GPU can serve many users at once. You run it when you host open-weight models yourself; a hosted inference API serves them without the GPUs.
The vLLM inference engine is open-source software that loads a large language model onto your GPUs and answers requests through an OpenAI-compatible API. Every request it answers is one round of AI inference.
Think of the model as a website's files and vLLM as the web server. The files do nothing until a server loads them and starts answering requests. The same files can run behind a different server, too.
vLLM serves open-weight models to many users at once, from a chat app's backend to an internal coding assistant. It also runs offline batch jobs, such as summarizing a million documents overnight, and the generation step inside larger systems, including reinforcement-learning training pipelines.
A 2026 GitHub repository study by researchers at Polytechnique Montréal found vLLM in 1,821 projects, by far the most of any serving framework it covered.
vLLM is an open-source project of the PyTorch Foundation, which it joined on May 7, 2025, built by a community of contributors that includes Red Hat. It started in the Sky Computing Lab at UC Berkeley, according to the vLLM docs, where Woosuk Kwon and colleagues published its core idea, PagedAttention, in 2023.
vLLM is free to use under the Apache 2.0 license, published on GitHub. There is no paid tier.
vLLM inference runs as a loop: a scheduler picks which requests run for each step, the GPU computes the next token for all of them in one pass, and finished requests hand their memory back. PagedAttention manages memory, and continuous batching keeps the GPU busy.
PagedAttention stores the KV cache in small fixed-size blocks. The KV cache is a model's working memory for a conversation: the intermediate results it saves for every token it has already read, so it doesn't reprocess the whole prompt for each new token.
That memory grows with every token in every conversation, which is why LLM inference usually runs short of GPU memory before it runs short of compute. Older servers reserved one large slab per request, sized for the longest possible reply.
The PagedAttention paper found those slabs wasted most of their space: earlier systems used only 20.4% to 38.2% of their KV cache memory for actual tokens. Paging the cache instead let vLLM serve 2 to 4 times as many requests at the same latency.
At startup, vLLM carves its reserved GPU memory into a pool of blocks. A request borrows blocks as its context grows and returns them when it finishes. When the pool runs dry, vLLM preempts some running requests, frees their blocks, and recomputes them once memory frees up, so their replies stall in the meantime.
Paging also lets requests share blocks. In the paper's tests, beam search, where a model explores several candidate replies at once, saved up to 55% of KV cache memory by sharing the candidates' common history. Today the main form of sharing is prefix caching, covered below.
Continuous batching lets requests join and leave the batch between steps, so nobody waits for the slowest request in a fixed batch. The engine runs three jobs at each step:
Prefill and decode share each step. Prefill reads a new prompt's tokens in parallel, a chunk at a time for long prompts. It decides how long you wait for the first token. Decode writes one token per request per step and sets how fast tokens stream.

CPU work can slow each step as much as the GPU does. A vLLM co-creator's Berkeley dissertation found that scheduling, preparing inputs, and launching GPU work often took more than half of each step in latency-sensitive serving.
To cut that overhead, vLLM records the GPU's work as CUDA graphs at startup and replays them instead of launching every operation again.
Prefix caching, chunked prefill, and speculative decoding are three inference optimizations that build on the block pool. vLLM's V1 engine turns the first two on by default.
vLLM runs most popular open-weight model families on NVIDIA, AMD, and Intel hardware, with plugins for other accelerators. The vLLM docs say it 'supports 200+ model architectures.'
These include text generation, multimodal, embedding, and reward models from families including Llama, Qwen, DeepSeek, Gemma, Mistral, and OpenAI's gpt-oss. Check the supported models list for the full breakdown.
vLLM already serves multimodal models that take images, audio, or video in and reply in text. vLLM-Omni covers models whose output is more than text: models such as Qwen3-Omni, which speak as well as write, and diffusion models that generate images.
vLLM's supports NVIDIA GPUs, AMD GPUs, Intel GPUs, and CPUs.
Google TPUs, AWS Neuron chips (Trainium and Inferentia), Intel Gaudi, Huawei Ascend, and Apple GPUs run through hardware plugins that live outside the main project.
Weights decide whether a model fits: about 2 bytes per parameter in 16-bit precision and about half a byte in 4-bit, before any KV cache.
Smaller weights don't always mean faster replies. A 2026 review of measurements found 4-bit weights ran Qwen2.5-14B 2.12 times faster on an A100 at low load. Gemma 3 12B gained just 1.02 times at a batch of 256 requests, where the GPU's math, not its memory, sets the pace.
vLLM serves many users from GPUs in a data center, while Ollama runs a model on your own machine. SGLang and TensorRT-LLM compete with vLLM for server workloads. All of them are inference engines, software that loads a model and answers requests, built for different jobs.
vLLM and Ollama solve different problems. Ollama runs open models on your laptop or desktop, or in Ollama's cloud.
If you're testing models specifically, Ollama gets you there faster. If your app's users will hit the model at the same time, run vLLM: its batching and memory paging exist for concurrency, which a single user on a laptop rarely needs.
SGLang and TensorRT-LLM are the two engines most often benchmarked against vLLM. SGLang is an open-source engine hosted by LMSYS, built for large-scale agent workloads. TensorRT-LLM is NVIDIA's open-source library for optimizing inference on NVIDIA GPUs.
Head-to-head benchmarks between engines often measure default settings, not the engines. A November 2026 controlled study ran vLLM and SGLang on a multi-agent workload where requests share most of their prompts.
Under each engine's defaults, vLLM's median time to first token ran up to 64 times as long as SGLang's.
Defaults decide whether a long prompt gets prefilled in chunks. Matching vLLM's setting to SGLang's closed 78% of the gap in how much traffic each could handle. Even then, SGLang kept a 2.4 to 6.4 times edge on its slowest responses at equal throughput.
Published inference benchmarks are a starting point.
vLLM is production-ready for most teams serving open models. It held up best under load in Bench360, an independent benchmark published in late 2025 that tested four engines on three GPUs with 7 to 8 billion parameter models.
The study left out Ollama, llama.cpp, and TensorRT-LLM.
The quickest way to run vLLM is two commands: install it, then start vllm serve with a model name. You get an OpenAI-compatible endpoint at http://localhost:8000, per the vLLM quickstart.
The vLLM docs recommend installing with uv; plain pip install vllm also works.
Any OpenAI SDK works against the server once its base URL points at your host. So does curl:
For batch jobs, skip the server and call vLLM from Python. The program loads the model once and generates for a whole list of prompts:
The official image, vllm/vllm-openai, runs the same OpenAI-compatible server in a container. This is the command from the vLLM Docker guide:
The Hugging Face cache mount keeps downloaded weights between restarts. The --ipc=host flag gives PyTorch the shared memory it uses between processes. HF_TOKEN is for gated models: accept the license on the model page first.
When vLLM won't start, the log usually names one of five problems: the weights don't fit, the context doesn't fit, another process holds the GPU, the model is gated, or vLLM is still compiling.
What the vLLM log shows, and how to fix it.
| The log shows | What it means | Fix |
|---|---|---|
| CUDA out of memory while loading weights | The weights alone don't fit. An 8B model in 16-bit needs about 16 GB before any cache | Use a 4-bit AWQ or GPTQ checkpoint, about a quarter of the size, or split across GPUs with --tensor-parallel-size |
| Max seq len is larger than the KV cache can store | One request at full context can't fit in the cache. Llama 3.1 models default to a 128K-token context | Set --max-model-len at or below the token count the error prints |
| Free memory is less than desired GPU memory utilization | Another process, such as a notebook or a second vLLM server, already holds GPU memory | Stop that process (nvidia-smi shows it) or lower --gpu-memory-utilization, for example to 0.5 each for two servers on one GPU |
| 401 or gated repo error while downloading | The model needs an accepted license and a token | Accept the license on Hugging Face and pass HF_TOKEN into the container |
| Silent for minutes after the weights load | vLLM compiles the model and captures CUDA graphs; it hasn't hung | Wait it out, mount /root/.cache/vllm so restarts reuse the work, or add --enforce-eager while developing |
--enforce-eager skips graph capture, so the server starts faster and each token comes out slower. Use it while you iterate and drop it in production.
A healthy start still takes a while, and most of that time goes to the CPU. An MLSys 2026 cold-start study measured 20.32 seconds with a small model on one test setup, with every step CPU-bound except profiling memory and capturing CUDA graphs. Bigger models and first-time compiles take minutes.
The first request after startup runs slower than the rest while the server warms up, so leave it out when you measure time to first token.
A handful of vLLM settings decide how many requests fit on your GPU and how fast each one runs. They all draw on the same pool of KV cache memory that vLLM reserves at startup.
Four command-line flags set vLLM's memory and batch limits; in Python and config files the same settings use underscores (gpu_memory_utilization).
--gpu-memory-utilization sets the share of GPU memory vLLM may take. On NVIDIA and AMD GPUs it defaults to 1.0, with vLLM sizing its cache from measured memory; elsewhere it defaults to 0.92. Lower it only when something else shares the GPU.--max-model-len sets the longest context one request may use. vLLM must fit one full-length request in its cache to start, so a lower cap lets a long-context model start on a smaller GPU.--max-num-seqs caps how many requests run together. Raising it trades each request's speed for total throughput, until the block pool runs out.--max-num-batched-tokens caps the tokens processed in one step, which limits how much prompt reading can crowd out token writing.When developers set the memory share by hand, a 2026 study of 5,398 repositories found 0.9 (21.9%), 0.8 (15.0%), and 0.5 (11.6%) the most common values in vLLM configs.
vLLM scales past one GPU in a fixed order: tensor parallelism splits each layer across GPUs in one machine, pipeline parallelism splits layers across machines, and separate replicas behind a load balancer add throughput. Tensor parallelism comes first because GPUs inside one machine talk far faster than machines do.
Don't split a model that already fits on one GPU unless your traffic reads long prompts. On Qwen2.5-32B across four A100s, a 2025 GPU inference study found one GPU beat two-way tensor parallelism for decode-heavy chat, 22.2 tokens per second against 20.5. For prefill-heavy summarization, two GPUs added 36.6%.
llm-d, which Red Hat launched in May 2025, runs vLLM on Kubernetes and can put prefill and decode on separate machines. Its own guidance says that split pays off only for large models (70B and up) with long inputs.
In production, vLLM exposes Prometheus metrics on a /metrics endpoint. vllm:kv_cache_usage_perc shows how full the block pool is, vllm:num_requests_waiting shows the queue, and vllm:num_preemptions counts requests paused for lack of memory.
Self-host vLLM when your GPUs will stay busy, when you need to serve weights no provider hosts, or when the model has to run on hardware you control. Otherwise a hosted inference API serves the same open-weight models per token, with no GPUs to run.

Running vLLM yourself makes all of the work above your job: sizing models against GPU memory, waiting through warmup on every new instance, watching the block pool and the queue, and splitting models that outgrow one card.
The bigger cost is the GPU you pay for while nobody uses it. A 2026 cost study measured a Mixtral 8x7B deployment on one H100 at $15.25 per million output tokens at 1 request per second, and $0.87 at 25 requests per second.
Same hardware, same model, about 17 times the price per token, because the quiet server spreads the same hourly bill over fewer tokens. The study is a single author's preprint, so treat its numbers as an illustration of the pattern. Per-token inference costs on a hosted API don't depend on how busy you keep a GPU.
The same open-weight model runs at different speeds and prices on different providers because each one runs it differently: the engine and its settings, the GPU type, how full each batch runs, prefix cache hits, and the distance to the GPU. Compare providers on your own prompts.
Serving your own fine-tuned model is a common reason to run vLLM yourself. vLLM serves fine-tuned weights like any other checkpoint. With --enable-lora, it also serves LoRA adapters, small add-on weight files, per request on top of one shared base model.
If your application already talks to a vLLM server through the OpenAI SDK, moving it to a hosted API is a configuration change.
Telnyx's Inference API serves open-weight LLMs on GPU infrastructure Telnyx owns, through an OpenAI-compatible Chat Completions API: you change the base URL to https://api.telnyx.com/v2/ai/openai, the API key, and the model name.
Telnyx runs inference GPUs in five regions on four continents, and a request can pin a region so it is served there or fails.
Self-hosted vLLM compared with a hosted inference API.
| Self-hosted vLLM | Hosted inference API | |
|---|---|---|
| Who runs the GPUs | The team that self-hosts | The provider |
| Models | Any weights the team can load, including fine-tunes and LoRA adapters | The provider's catalog of open-weight models |
| Scaling | Capacity the team provisions, with warmup on each new instance | The provider's capacity |
| Pricing | GPU hours, busy or idle | Per token |
| Tuning | The settings above | The provider's settings |
| Client change | None | Change the base URL, API key, and model name |
An LLM is the model itself: a file of trained weights that predicts the next token. vLLM is the software that loads those weights onto GPUs and answers requests from many users at once. You need both to serve a model.
vLLM doesn't train or fine-tune models; it only runs them. You fine-tune with a training framework, then serve the result, or its LoRA adapters, with vLLM. Reinforcement-learning frameworks such as verl call vLLM to generate sample answers, then update the model with a training library such as FSDP or Megatron-LM.
vLLM only runs models whose weights you can download, such as the open-weight models on Hugging Face. You call GPT and Claude models through OpenAI's and Anthropic's APIs. OpenAI's gpt-oss models, released as open weights on August 5, 2025, are the exception: they run on vLLM like any other open model.
vLLM "does not support Windows natively," its install docs say. They point Windows users to the Windows Subsystem for Linux (WSL) or community-maintained forks. On a Mac, Apple silicon runs vLLM through the vllm-metal plugin, which scales less with traffic than vLLM on NVIDIA GPUs. For one person on a laptop, Ollama is usually simpler.
Open-weight models don't require your own GPUs. You can run them with vLLM on GPUs you rent or own, or call a hosted inference API that serves the same models and bills per token. Self-hosting pays off when your GPUs stay busy or you need custom weights; otherwise a hosted API costs nothing while idle.
Related articles
What is AI inference? How a trained model turns input into answers
Inference optimization: cut LLM latency and cost

AgentSDK: Run Your Agent on One Platform

What is multilingual voice AI and how does it work?
What is PSTN? How the public switched telephone network connects to VoIP

What is SMTP? How the Simple Mail Transfer Protocol works
