Skip to content

LLM Serving Engine Selection: Four Axes, One Decision Tree

The most common mistake in choosing a serving engine is picking from a table that says "engine A does N tokens per second, engine B does M". Those numbers are tied to a specific model, batch size, input length and GPU, and stop being true the moment your environment changes. The stable approach is to classify the scenario, then the constraints, and only then talk about speed.

This article puts vLLM, SGLang, TensorRT-LLM and Ollama into one tree and branches on concurrency, hardware, workload shape and team capability. Authoritative references are the vLLM documentation, SGLang documentation, the TensorRT-LLM repository and the Ollama documentation. All commands follow those official sources; no numbers are taken from second-hand comparison tables.

The 60-Second Check: Four Questions

Answer these before reading any benchmark. The answers usually leave a single candidate.

Q1: Roughly how many concurrent requests?
  |-- 1-3 (yourself plus a few colleagues) --> stay on Ollama, no production engine
  |-- 5-15 with GPU headroom --> Ollama for now, switch when queues appear
  `-- 20+ / paying users --> go to Q2

Q2: What hardware?
  |-- all-NVIDIA cluster + someone to maintain the build --> go to Q3 (TensorRT-LLM candidate)
  `-- mixed hardware / AMD / TPU / NPU / no engine team --> rule out TensorRT-LLM, go to Q3

Q3: What does the workload look like?
  |-- repeated system prompts / multi-turn agent calls / structured output --> SGLang first
  `-- general chat / completions API at high concurrency --> vLLM first

Q4: Who operates it?
  |-- someone can own upgrades, compilation and tuning --> ship the Q3 choice
  `-- nobody dedicated --> fall back to vLLM defaults, avoid compiled engines

The logic: Q1 decides whether you need a production engine, Q2 eliminates hardware mismatches, Q3 picks the better shape among the survivors, Q4 is the reality check. Skip any step and jump to a performance table, and the odds of a wrong pick stay high.

Axis One: Concurrency Is the Line Between vLLM and Ollama

Ollama listens on 127.0.0.1:11434 by default, a classic single-user local shape. It exposes an OpenAI-compatible API at http://localhost:11434/v1 and takes two commands to run:

ollama pull qwen3:8b
ollama run qwen3:8b

vLLM's defining features are continuous batching and PagedAttention: the former lets new requests join an in-flight forward pass, while the latter manages KV cache in pages like virtual memory, cutting fragmentation and allowing larger batches. Concurrency, not single-request speed, is the real dividing line. Start an OpenAI-compatible server with:

vllm serve NousResearch/Meta-Llama-3-8B-Instruct --dtype auto --api-key token-abc123

Do not memorize the conclusion; measure a concurrency sweep. Pin model and I/O lengths, ramp concurrency from 1 to 32, and watch where p99 latency and queue depth bend. Ollama's curve flattens quickly as requests pile up; vLLM's keeps scaling until GPU memory becomes the limit. Where the bend happens is where your line is.

One more myth to retire: in a single-request scenario vLLM is not necessarily much faster than Ollama; the gap is usually within tens of percent and depends on model, build and hardware. Moving vLLM into a single-user environment for "speed" buys you a Python environment and a set of knobs, nothing more.

Axis Two: Hardware, the Hard Gate for TensorRT-LLM

TensorRT-LLM is officially positioned as a library that optimizes LLM inference on NVIDIA GPUs, using custom kernels, prefill-decode disaggregation, wide expert parallelism and speculative decoding. Its serve command is:

trtllm-serve <model>

The binding constraint is NVIDIA GPUs only. If your fleet includes AMD Instinct, Google TPU, Intel GPU or CPU, Apple Silicon or Ascend NPUs, TensorRT-LLM is out.

vLLM and SGLang cover far more ground. SGLang's official platform list includes NVIDIA, AMD Instinct, Google TPU, Intel, Apple Silicon, Ascend NPUs and Moore Threads, among others. Its install and launch path:

docker pull lmsysorg/sglang:latest
uv pip install --prerelease=allow sglang

This is why the "fastest engine" is often the wrong choice: the performance only holds on specific hardware, and hardware is usually not negotiable. Check the machine first, the engine second.

Axis Three: Workload Shape, the Line Between SGLang and vLLM

Both engines expose OpenAI-compatible APIs, so client switching is cheap. The real branch is the workload.

SGLang describes itself as a high-performance serving framework for agentic workloads, large-scale serving and RL rollouts; its core technique, RadixAttention, reuses shared prefixes, which suits multi-turn and repeated-system-prompt traffic and structured output. vLLM's PagedAttention plus continuous batching is the mature general-purpose high-concurrency path, with the broadest ecosystem and deployment references.

Rule of thumb: lots of repeated prefixes, structured output, multi-turn agent calls, go SGLang; a mixed bag of plain chat and completions at high concurrency, go vLLM.

Because the interfaces match, the pragmatic move is a load-test script that swaps only the base URL. Run the same traffic against both, compare p99 and queue curves, and let your own distribution decide. Do not settle this at selection time with "which is theoretically faster".

Axis Four: Team Capability, the Most Overlooked Axis

TensorRT-LLM's depth has a cost: engine versions, the compilation flow and the parameter matrix all need long-term ownership. The upstream repository itself moves fast, and an upgrade may require redoing validation. Without a dedicated owner, a compiled engine turns into a black box nobody dares touch six months later.

The test is simple: is there one person who can independently upgrade, compile, load-test and roll the engine back? If not, narrow to vLLM or Ollama. The former's defaults handle most production traffic; the latter needs no Python environment at all.

Quick Reference Table

Engine One-line position Concurrency Hardware Typical pick
Ollama Fastest local single-user startup Requests queue; not for high concurrency NVIDIA / Apple Silicon / AMD / Vulkan Personal dev, prototyping, offline use
vLLM General high-concurrency standard Scales well via continuous batching NVIDIA-first, AMD supported Multi-user production APIs, batch jobs
SGLang Agents, structured output, large-scale serving High; RadixAttention reuses prefixes NVIDIA/AMD/TPU/Intel/Apple/NPU and more Agent chains, repeated prefixes, structured output
TensorRT-LLM Peak NVIDIA optimization High; custom kernels plus compilation NVIDIA GPUs only Hard latency SLA with an engine team

Three Judgment Cases (Built from Typical Production Scenarios)

Case one: a small team exposed Ollama company-wide and queued every morning. An internal Q&A tool started with a few users on Ollama. After rollout, a dozen people asked questions at 9 a.m. and later requests waited tens of seconds. The check: sweep concurrency to confirm queuing rather than a slower model; the team had no engine operator and ran general NVIDIA cards. Q4 ruled out a compiled engine, Q3 was plain Q&A with no structured output, so they moved to vLLM and default continuous batching removed the queue. Lesson: measure the concurrency bend first, do not blame the model.

Case two: chasing "20% faster" onto TensorRT-LLM, then freezing the version for half a year. A latency-sensitive API cut over on lab numbers and p99 did drop; but upgrades required recompiling and revalidating, and after the owning engineer left, the team froze the version. Moving traffic back to vLLM raised p99 slightly but restored maintainability and a normal upgrade cadence. Lesson: multiply the performance gain by the team's maintenance capacity; an engine nobody can maintain is a liability, not an asset.

Case three: an agent app moved from vLLM to SGLang and saved recomputation, not compute. A multi-turn agent carried a long system prompt every turn, with modest QPS but heavy token spend. Moving to SGLang reused shared prefixes through RadixAttention instead of recomputing them each turn. The key was not "which engine has higher throughput" but the share of repeated prefixes in the payload. Workload shape drives cost more than engine brand.

Quick Reference

Your situation First engine to check Next action
Local dev / 1-3 users Ollama ollama pull + ollama run, no Python environment
20+ concurrent general API, mixed hardware vLLM / SGLang Same load script, swap base URL, compare p99 curves
Agent / long system prompt / structured output SGLang Start the official Docker image, verify prefix reuse
All-NVIDIA + hard latency SLA + engine team TensorRT-LLM Price the compile and upgrade effort before chasing the gain
Nobody dedicated to operations Ollama (small) / vLLM (large) Defaults first, no compiled engine

Originality statement: The decision framework, decision tree and cases in this article are the author's own synthesis from the official vLLM / SGLang / TensorRT-LLM / Ollama documentation and hands-on production selection work. The three cases are built from typical production scenarios, not records of a specific customer site.