Blog / Guides

vLLM vs SGLang on one GPU: choose with your workload

Published ยท Engine documentation checked 6 September 2026; no new comparative benchmark was run for this guide

A benchmark can show an engine producing more tokens per second while saying very little about how your application will feel. An editor waiting for one answer, a document service reading long inputs and a batch queue keeping the GPU busy put different demands on a model server.

For a single GPU, start with support for your exact model and weight format. If both vLLM and SGLang support the configuration, compare them using the same requests and a latency target. The result you need is the amount of useful work each can complete while meeting that target.

Check compatibility before speed

Model-family support is only the beginning. Verify the architecture, quantization, GPU generation, driver, attention implementation and required features for the engine release you intend to install. The model publisher's serving recipe is often a better starting point than a generic launch command.

Test structured output, streaming, tool calls, stop conditions and long requests before spending time tuning throughput. A server returning HTTP 200 has not necessarily returned valid JSON or a usable tool call. Keep the same tokenizer, chat template and generation settings in both configurations.

Prefix caching is available in both engines

vLLM's automatic prefix caching reuses previously computed state for shared prompt prefixes. It primarily saves repeated prompt processing; it does not make every newly generated token cheaper. SGLang also uses prefix reuse through RadixAttention and related cache mechanisms described in its project documentation.

A shared system prompt, repeated document or growing agent conversation can benefit. Independent prompts with little reusable context may not. Test both a fresh-cache workload and one with the reuse pattern your application actually creates.

Be careful when rerunning an identical benchmark: the second run can benefit from prompts retained by the first. The vLLM benchmark guide explicitly warns about this. Reset cache state or vary prompts when testing uncached behavior, and label intentionally warm results.

Use three small tests before a large benchmark

TestWhat it representsMain result
One interactive request at a timeA developer waiting for an answerFirst-token delay and time to a complete useful answer
Long inputs with shared prefixesDocument questions or agent sessionsPrompt-processing delay and cache benefit
Increasing simultaneous demandA team or batch queue sharing the GPUCompleted work while response times remain acceptable

Pick request lengths from your application, including a few long cases. A single average hides the requests most likely to fill memory or delay everyone behind them. Include output lengths too: generating a long explanation can occupy a worker much longer than returning a short classification.

Keep the comparison reproducible

Both projects provide serving benchmark tools: vLLM's benchmark CLI and SGLang's serving benchmark guide. Save raw results, request parameters and launch settings with the date.

  1. Use the same GPU, host resources, model revision and weight format.
  2. Run one engine at a time, with the same intended memory and context budget.
  3. Warm up deliberately, then separate startup measurements from serving measurements.
  4. Increase load through the point where latency or errors exceed your target.
  5. Repeat enough times to see whether the difference is larger than the run-to-run variation.

Report input throughput and output throughput separately. Also report failed requests, total response time and a tail-latency measure such as p95, which describes a value that 95% of observations are at or below. Make clear whether latency is measured at the client or inside the server.

A larger throughput number can still lose the comparison

Imagine two hypothetical results on the same GPU: one server completes 20% more output tokens per second, but its p95 first-token delay exceeds your application's limit. For an interactive assistant, the faster aggregate result is not necessarily the better configuration. For a batch job without that delay constraint, it may be.

Speculative decoding needs its own comparison. Keep the draft model, extra memory and acceptance behavior visible. Comparing one engine with a drafter against another without one measures complete configurations, not just engine overhead.

Finally, consider the operating work: startup reliability, logs, metrics, upgrades and how quickly your team can diagnose failures. A modest speed gain may have little value if it makes routine operation harder.

Questions people ask

Is SGLang faster than vLLM on one GPU?

There is no workload-independent answer. Compare the exact model, representation, hardware and release under your request mix, and require the result to meet your latency and correctness targets.

Can I compare two published tokens-per-second figures?

Only when their measurement definitions and test conditions are sufficiently comparable. Check whether they count input, output or both, along with concurrency, prompt lengths, cache state and speculative decoding.

How does LLM Hangar choose the serving engine?

The deployment uses the runtime profile specified by the catalog configuration. Check the selected model and variant rather than assuming an engine can be swapped without retesting.