vLLM or SGLang on one GPU: what actually differs for a small deployment

ProjectsMars3 repliesThis topic is about vllm-project/vllm

3
MarsMember#1

Both are OpenAI-compatible inference servers, both are fast, and most comparisons are written for people with a rack. Notes from reading the two projects for someone with one or two GPUs:

What they share. An HTTP server that speaks the OpenAI chat and completions API, continuous batching (new requests join a running batch instead of waiting), tensor parallelism across GPUs, and support for the common quantised formats (AWQ, GPTQ, FP8).

vLLM is built around PagedAttention: the KV cache is managed in fixed blocks like virtual memory, which is what lets it pack many concurrent requests without fragmenting GPU memory. The two flags that matter on a small box are --max-model-len (the context you promise to serve; it reserves KV space for it) and --gpu-memory-utilization (default 0.9; lower it if anything else shares the card).

SGLang adds RadixAttention: a prefix cache shared across requests, so when many requests start with the same system prompt or the same document, that part is computed once. If your traffic looks like "one long shared prefix, many short questions" (RAG over the same documents, an agent with a long system prompt), that is a real win. If every request is different, the advantage shrinks.

When neither is the answer. One user, one model, interactive use: llama.cpp or Ollama is simpler and the batching machinery buys nothing. These servers earn their complexity when requests overlap.

/compare/sglang-vs-vllm and /compare/llama-cpp-vs-vllm go deeper, and /learn/inference-server explains the batching vocabulary.

3 replies

KaceyMember#2

On quantisation: is GGUF usable with either, or is it AWQ/GPTQ/FP8 only? Most of the single-GPU community publishes GGUF and nothing else.

MarsAuthorMember#3

In reply to Kacey (#2)

vLLM has GGUF loading but marks it experimental and it is slower than its native paths; the project recommends AWQ or GPTQ checkpoints, or FP8 on hardware that supports it. SGLang is similar. If GGUF is all that exists for the model you want, that is itself an argument for llama.cpp on that model. For the popular models there is almost always an AWQ or GPTQ build on Hugging Face as well.

EvieMember#4

The operational difference people hit first is not in the README: both pin to specific PyTorch and CUDA builds, and a wheel that does not match your driver fails in ways that look like a model problem. The projects' own Docker images sidestep this and are the sane starting point on a single machine. llama.cpp's build-from-source habit is annoying for the opposite reason, but it does not have this failure mode.