Skip to content
sinc-LLMBook a 15-minute call
Page signal: 10 sections as samples, joined by sinc reconstruction; computed from this page's text.

LLM Inference Engines: vLLM, SGLang, llama.cpp, and TensorRT-LLM

A plain guide to picking a self-hosted LLM inference engine by workload, hardware, and API needs, with a fair way to test them.

Quick Answer & Verified Key Facts

Direct Answer: For laptops or Macs, llama.cpp is the top choice due to its minimal setup, GGUF file support, and CPU/GPU flexibility, while vLLM and SGLang excel in GPU serving with specialized memory management.

On this page

Pick llama.cpp for laptops and mixed CPU and GPU boxes. Pick vLLM or SGLang for one or more GPUs that serve many users, and lean to SGLang when many requests share long prefixes. Pick TensorRT-LLM when you run only NVIDIA GPUs and want to tune them hard.

By Mario AlexandreLLM Performance & Reliability

An inference engine turns model weights into a fast, shared service

An inference engine loads model weights onto your hardware and serves tokens to many users at once. The four engines here all do that job. They differ in how they manage memory, which chips they run on, and which file formats they read.

Think of the engine as the part between your app and the GPU. Your app sends a prompt over HTTP. The engine queues it, packs it into a batch with other prompts, runs the model, and streams tokens back. Most of the speed you see comes from how well it packs and reuses work.

Two phases set the shape of every request

Each request has two phases. First comes prefill, where the engine reads the whole prompt in one pass. Then comes decode, where it writes one token at a time. Prefill sets how long a user waits for the first word. Decode sets how fast the rest of the text flows.

Both phases lean on the KV cache. That cache holds the keys and values for every token the model has seen so far in a request. It grows with prompt length and with output length. Our guide on KV cache memory in long-context serving walks through how fast it grows. In short, the KV cache is often what limits how many users fit on one GPU.

Batching is where the speed comes from

A GPU is wasted on one user at a time. Engines group many requests into one batch so each pass over the weights does more work. Modern engines add and drop requests from the batch on every step, rather than waiting for a full batch to finish. Our page on continuous batching covers that idea in depth.

This page does not repeat that material. It compares the four engines you are most likely to shortlist, then shows how to test them on your own traffic. If you want the broad picture of latency tuning first, read LLM latency optimization.

vLLM stores the KV cache in pages to fit more users per GPU

vLLM is a general GPU serving engine built on one key idea: PagedAttention. It treats KV cache memory the way an operating system treats RAM, in small pages. This cuts waste, so more requests fit in a batch.

The vLLM paper states the problem plainly. KV cache memory "can be significantly wasted by fragmentation and redundant duplication, limiting the batch size." Its answer is "PagedAttention, an attention algorithm inspired by the classical virtual memory and paging techniques in operating systems."

Why pages help

Without pages, an engine must reserve one long block of memory per request. It does not know how long the output will be. So it reserves for the worst case, and much of that space sits empty. Pages let the engine hand out memory in small chunks as the text grows.

Pages also make sharing easy. Two requests with the same start can point to the same pages. The paper says vLLM reaches "near-zero waste in KV cache memory" and "flexible sharing of KV cache within and across requests."

What the paper reported

The authors reported that vLLM raised throughput by 2 to 4 times at the same latency, compared with FasterTransformer and Orca. They also said the gain is larger with longer sequences, larger models, and more complex decoding. Treat these as published results on their test setup. They are not a forecast for your traffic.

Hardware and API

vLLM runs on more than NVIDIA. Its install docs list NVIDIA CUDA, AMD ROCm, Intel XPU, and Apple Silicon through vLLM-Metal. They also list CPU builds for x86, ARM, Apple silicon, and IBM Z. Third-party hardware plugins can live outside the main repo.

The vLLM online serving docs say it "provides an HTTP server" with OpenAI APIs. These include the Completions API at /v1/completions and the Chat Completions API at /v1/chat/completions. Chat needs a model with a chat template.

Quantization formats

vLLM reads many quantized formats. Its quantization docs list AutoAWQ, BitsAndBytes, GPTQModel, LLM Compressor schemes such as FP8 W8A8 and INT4 W4A16, NVIDIA Model Optimizer, and AMD Quark. The hardware table there also lists GGUF. The docs put the trade simply: quantization "trades off model precision for smaller memory footprint." For how each method affects accuracy, see our sibling guide on AWQ, GPTQ, and FP8 accuracy.

SGLang reuses shared prompt prefixes with a radix tree

SGLang is a GPU serving engine that shines when many requests start with the same text. Its core idea is RadixAttention. It keeps old KV cache in a tree keyed by tokens, so a new request can reuse the part it shares with past ones.

The SGLang paper says the runtime uses "RadixAttention for KV cache reuse and compressed finite state machines for faster structured output decoding." The second part matters if you force JSON output often.

How the radix tree works

Most engines drop a request's KV cache once it ends. SGLang keeps it. In the paper's words, the system "maintains an LRU cache of the KV cache for all requests within a radix tree." A radix tree is a compact prefix tree. It makes it cheap to find the longest shared start, add new branches, and evict old ones.

LRU means least recently used. When memory fills up, the branch that went unused the longest gets dropped first. Hot prefixes, like a system prompt every user hits, stay in memory.

Who gains the most

Prefix reuse pays off when prompts share long starts. Agents send the same tool list and rules on every step. RAG apps often share a system prompt. Few-shot prompts repeat the same examples. Chat apps resend the whole history each turn.

The SGLang README says it is "optimized for agentic workloads, large-scale serving, and RL rollouts." The paper reported up to 6.4 times higher throughput than other systems, on tasks that include agent control, logical reasoning, few-shot benchmarks, and JSON decoding. As with vLLM, that is a published result on the authors' setup.

If you already use hosted prompt caching, the idea will feel familiar. Our prompt caching explainer covers the hosted version.

Hardware and API

The SGLang docs describe it as "an inference framework meant for production level serving." They say it targets "a wide range of setups, from a single GPU to large distributed clusters." The docs list NVIDIA, AMD, Intel Xeon, Google TPU, Ascend NPU, and Moore Threads MUSA. The README adds CPUs and Apple Silicon to that list.

The docs also say SGLang is "Compatible with Hugging Face and OpenAI APIs." So the same client code you use for vLLM can call it.

llama.cpp runs GGUF models on laptops, Macs, and mixed CPU and GPU boxes

llama.cpp is the engine for local and small machines. It is written in C and C++ and reads one file format, GGUF. It runs on CPUs, on Apple Silicon, and on GPUs, and it can split a model across CPU and GPU.

The llama.cpp README gives the goal. It is "to enable LLM (and MLLM) inference with minimal setup and state-of-the-art performance on a wide range of hardware." It adds "locally and in the cloud." The project is built on the ggml library.

GGUF is a single-file model format

The GGUF spec calls GGUF "a binary format that is designed for fast loading and saving of models." Models are "traditionally developed using PyTorch or another framework, and then converted to GGUF." One file holds the weights and the facts needed to load them. The spec lists single-file deployment and mmap loading as goals.

In practice you download a GGUF file that someone has already quantized. File names often carry the scheme, such as Q4_0 or Q4_K_M. Smaller schemes fit in less memory but can lose some quality. Test the one you plan to ship.

Hybrid offload when the GPU is too small

llama.cpp lets you put some layers on the GPU and the rest on the CPU. The server flag for this is n-gpu-layers. The server README describes it as the "max. number of layers to store in VRAM." It accepts a number, auto, or all.

Here is an illustrative case. Suppose a model has 40 layers and your GPU has room for about 28 of them plus cache. You would start with n-gpu-layers set to 28. The other 12 run on the CPU. Speed drops compared with a full GPU load, but the model runs at all, which is the point.

The built-in server

The llama.cpp server is a "Fast, lightweight, pure C/C++ HTTP server." Its feature list includes "LLM inference of F16 and quantized models on GPU and CPU." It has OpenAI-compatible "chat completions, responses, and embeddings routes." It also offers "Parallel decoding with multi-user support" and "Continuous batching."

A few flags matter for serving. The parallel flag sets the "number of server slots," which caps how many requests run at once. The cache-reuse flag tries to reuse cached chunks "via KV shifting." A metrics flag turns on Prometheus-style metrics.

llama.cpp can serve a small team. But it is built for reach across hardware first. On a big GPU with many users, vLLM, SGLang, or TensorRT-LLM are the usual picks. For a real example of a small local setup, see a local LLM powering a production website.

TensorRT-LLM tunes deeply for NVIDIA GPUs only

TensorRT-LLM is NVIDIA's own serving library. It runs only on NVIDIA GPUs. In return, it gives early access to new NVIDIA precision formats and tuned kernels.

The TensorRT-LLM overview calls it "NVIDIA's comprehensive open-source library for accelerating and optimizing inference performance of the latest large language models (LLMs) on NVIDIA GPUs." The README says it offers optimizations "including custom kernels."

From compiled engines to a PyTorch-native API

You may find a guide that tells you to build a compiled engine file first, then serve it. Check any such guide against the current docs before you follow it. The overview now lists a migration guide titled "TensorRT Backend Removed." It also says TensorRT-LLM "provides a high-level Python LLM API" that runs "from single-GPU to multi-GPU or multi-node deployments," on a PyTorch-native design.

The practical lesson is simple. Pin the version you test. Read the release notes before you upgrade. The setup steps for this engine have changed more than for the others.

Precision and batching features

On "NVIDIA H100 and later GPUs, TensorRT LLM supports FP8 quantization." NVIDIA says FP8 "can double performance and halve memory consumption compared to 16-bit floating point, with minimal impact on model accuracy." That is the vendor's claim. Measure the accuracy on your own task.

On B200 GPUs, it can load "model weights in the new FP4 format." It uses in-flight batching and paged attention. It supports "tensor, pipeline, and expert parallelism across multiple GPUs and nodes."

Serving and install

The quick start guide says you "can use the trtllm-serve command to start an OpenAI compatible server." It notes "The quickest option is to pull and run the pre-built release container from NGC." It also warns you to "Ensure your GPU supports FP8 quantization" before you serve an FP8 model.

Hugging Face TGI is now in maintenance mode

Text Generation Inference, or TGI, was a common pick a few years ago. It is no longer a good base for new work. The TGI docs say it "is now in maintenance mode."

The docs say Hugging Face will only accept "minor bug fixes, documentation improvements and lightweight maintenance tasks." They also name what to use instead. They "recommend using going forward: vllm, SGLang, as well as local engines with inter-compatibility such as llama.cpp or MLX."

If you run TGI today, you do not need to panic. It still works. But new features and new model support will land in other engines first. Plan a move during a quiet period, and use the test plan below to check the new engine before you switch traffic.

The four engines side by side

The table sums up what each engine's own docs say. It compares design, hardware, model formats, and the server you get. It does not rank speed, because speed depends on your model and traffic.

Topic vLLM SGLang llama.cpp TensorRT-LLM
Core memory idea PagedAttention: KV cache in pages RadixAttention: KV cache in a radix tree with LRU GGUF files, KV shifting for cache reuse Paged attention plus in-flight batching
Best fit Many users on one or more GPUs Many requests with shared prefixes, agents Laptops, Macs, CPU and small GPU boxes NVIDIA-only fleets tuned for peak use
Hardware in docs NVIDIA, AMD, Intel XPU, Apple via plugin, CPUs NVIDIA, AMD, Intel Xeon, TPU, Ascend NPU, CPUs, Apple CPU and GPU, with layer offload NVIDIA GPUs only
Model format Hugging Face weights, many quantized formats, GGUF Hugging Face weights GGUF only Hugging Face weights, NVIDIA formats
Quantization notes AWQ, GPTQ, BitsAndBytes, FP8 and INT schemes Offline AWQ, GPTQ and FP8 checkpoints, plus online FP8 and INT8 Quantized GGUF schemes such as Q4_0 FP8, NVFP4, and W4A16 or W4A8 AWQ and GPTQ recipes
OpenAI-compatible server /v1/completions and /v1/chat/completions Listed as compatible with OpenAI APIs Chat, responses, and embeddings routes trtllm-serve
Scale out Data parallel docs, hardware plugins Single GPU to large clusters Splits across GPUs by layer or row Tensor, pipeline, and expert parallelism

A few notes on reading the table. A listed feature means the docs say so, not that every feature works with every model. SGLang's quantization docs say it "supports various quantization methods, including offline quantization and online dynamic quantization." Offline means it "loads pre-quantized model weights directly during inference," such as AWQ or GPTQ checkpoints. For per-channel INT8 or FP8 models, the docs add that "you can opt to include --quantization w8a8_int8 or --quantization w8a8_fp8" to pick its fast kernels. The docs recommend offline quantization over online quantization. And every engine moves fast, so check the release notes before you trust any row.

Quantization choice shapes engine choice

Your model file often decides the engine for you. If you have a GGUF file, llama.cpp is the native home, though vLLM's table lists GGUF too. If you have an AWQ or GPTQ checkpoint, vLLM and SGLang both read it. TensorRT-LLM does too: its quantization docs list recipes including "W4A16 GPTQ W4A8 GPTQ W4A16 AWQ W4A8 AWQ" next to FP8 and NVFP4. If you want FP8 or FP4 on new NVIDIA chips, TensorRT-LLM has native paths, and vLLM lists FP8 schemes too. GGUF is the odd one out. SGLang's docs list gguf among methods it "will soon support," so do not plan on GGUF there yet.

So pick the precision first, then the engine. Our quantization guide explains how to check that a smaller format still gives good answers on your tasks.

A fair benchmark changes only the engine

A fair test holds the model, precision, hardware, and prompts fixed, and swaps only the engine. Then it measures time to first token, inter-token latency, and throughput at several concurrency levels. One peak number is not enough.

Most bad engine choices come from bad tests. A team runs one engine at FP8 and another at FP16. Or they send one short prompt with no other users. Or they read a blog post about a different GPU. Each of these makes the result useless for your choice.

The three numbers to record

Time to first token, or TTFT, is the wait from sending a request to seeing the first token. It is mostly set by prefill and by queue time. Users feel it as lag before the answer starts.

Inter-token latency is the gap between tokens after the first one. It sets how fast text flows on screen. Some tools report it as time per output token.

Throughput is total output tokens per second across all users. It sets how many users one GPU can carry, and so your cost per token. Our page on time to first token vs throughput explains why these two pull against each other.

Step by step test plan

  1. Pick one model and one exact checkpoint. Use the same file or the same Hugging Face revision for every engine.
  2. Pick one precision. If one engine runs FP8, the others must run FP8 too, or you must report them as separate rows.
  3. Use the same GPU type, driver, and count. Note the version of each engine.
  4. Build a prompt set from real traffic. Keep the mix of short and long prompts, and the mix of output lengths. Strip private data first.
  5. Turn on streaming for all engines, so you can see the first token.
  6. Warm up each engine with a few hundred requests. Throw those results away.
  7. Sweep concurrency. Try levels such as 1, 4, 16, 64, and higher, until latency breaks your target.
  8. At each level, record median and p95 TTFT, median and p95 inter-token latency, and output tokens per second.
  9. Check output quality on a fixed eval set. A fast engine that changes answers is not a win.
  10. Repeat each run at least twice. If the numbers move a lot, find out why before you compare.

An illustrative throughput calculation

Here is illustrative arithmetic, not a measurement. Suppose you run 64 requests at once. Each asks for 256 output tokens. That is 64 times 256, or 16,384 output tokens. Suppose the whole batch takes 40 seconds of wall time. Throughput is 16,384 divided by 40, or about 410 output tokens per second.

Now suppose the same run on a second engine takes 32 seconds. Its throughput is 16,384 divided by 32, or 512 tokens per second. That looks better. But you must also check p95 TTFT at the same load. If the second engine makes some users wait far longer for the first token, it may be the wrong pick for a chat app.

An illustrative prefix reuse calculation

Prefix-heavy work is where SGLang's design should show. Here is illustrative arithmetic. Suppose an agent sends 50 requests. Each has the same 3,000-token system prompt and tool list, plus 200 unique tokens.

Without reuse, the engine must prefill 50 times 3,200 tokens. That is 160,000 prompt tokens. With perfect reuse, it prefills the shared 3,000 tokens once, plus 50 times 200 unique tokens. That is 3,000 plus 10,000, or 13,000 tokens. Real reuse will fall short of perfect, since cache space is finite and old branches get evicted. But the gap shows why your benchmark prompts must keep the real share of common prefixes.

If your test uses random prompts with no shared start, it will hide this effect. If it uses one prompt repeated, it will inflate it. Use real traffic.

Published speedups are a signal, not a forecast

Both papers in this guide report big gains. Read them with care. Each gain was measured on one set of models, GPUs, and workloads, against the systems that were current at the time. Your model, your chips, and your traffic will differ.

Use published numbers to build a shortlist. A design that reports large gains on prefix-heavy tasks is worth testing if your traffic is prefix-heavy. A design built to cut memory waste is worth testing if memory caps your batch size. Then let your own test decide.

What to log next to every result

A number without its setup is hard to trust later. Log these with each run, so a teammate can repeat it:

  • Engine name, version, and container image tag.
  • Model name, checkpoint revision, and precision.
  • GPU model, count, and driver version.
  • Max context length and max batch or slot settings.
  • Prompt set name, with the mix of input and output lengths.
  • Concurrency level and how long the run lasted.

Keep these logs in the same repo as your test scripts. When you upgrade an engine six months from now, you can rerun the same test and see what changed.

Engine choice by situation

The right engine depends on where it runs and what traffic it sees. Use the table for a first pick, then confirm it with the test plan above.

Situation First pick Why Also test
Laptop or Mac, one user llama.cpp GGUF files, CPU and Apple support, minimal setup vLLM CPU or Metal plugin
Small GPU, model too big for VRAM llama.cpp Split layers between GPU and CPU with n-gpu-layers A smaller quantized model on vLLM
One GPU, many users, general chat vLLM Paged KV cache fits more requests per GPU SGLang
Agents, RAG, few-shot, long shared prompts SGLang Radix tree reuses shared prefixes vLLM with automatic prefix caching
Heavy JSON or structured output SGLang Compressed state machines speed structured decoding vLLM structured output
NVIDIA-only fleet, peak throughput TensorRT-LLM NVIDIA kernels, FP8 and FP4 paths vLLM and SGLang at the same precision
AMD, Intel, TPU, or Ascend hardware vLLM or SGLang Both list non-NVIDIA support Check your exact chip in their docs
Existing TGI setup vLLM or SGLang TGI is in maintenance mode llama.cpp for edge copies

Laptop or desktop

On a laptop, the main limit is memory. llama.cpp is built for this. Grab a quantized GGUF file that fits. Start the server, point your app at it, and you are done. The zero-cost local model guide shows what you can build this way.

One GPU with many users

Here the main limit is KV cache memory per user. vLLM was built for this case. SGLang is a strong second test. Run both at your real concurrency. If your prompts share long starts, expect SGLang to gain ground. If they do not, the gap may be small.

NVIDIA fleet chasing peak throughput

If you only run NVIDIA and you serve at scale, TensorRT-LLM earns a test. Its FP8 path on H100 and later, and FP4 on B200, are its main draws. Budget more time for setup and upgrades. Then compare it with vLLM and SGLang at the same precision. Do not compare FP4 on one engine with FP16 on another and call it an engine win.

Prefix-heavy agent workloads

Agent loops resend the same rules and tool schemas on every step. That is the textbook case for RadixAttention. Start with SGLang. Keep vLLM as the control. Watch TTFT on later agent steps, since that is where reuse should help most. Our page on structured output covers the JSON side of agent work.

Cost and team skill matter too

The fastest engine is not always the cheapest one to run. A team that knows Python may move faster with vLLM or SGLang. A team that needs to ship a desktop app may prefer llama.cpp. Count setup time and upgrade time in your cost. If you are weighing self-hosting against a vendor API at all, read when to distill a vendor model for self-hosting first. sinc-LLM helps teams design these tests and tie them to cost goals through AI ROI and cost control.

The OpenAI-compatible API keeps you portable

All four engines can sit behind an OpenAI-compatible API. That lets you write your app once and swap the engine later. It is the best hedge against picking wrong.

vLLM serves /v1/completions and /v1/chat/completions. SGLang says it is compatible with OpenAI APIs. The llama.cpp server has OpenAI-compatible chat, responses, and embeddings routes, and its README shows a one-line command to "Launch OpenAI-compatible API server." TensorRT-LLM has trtllm-serve for the same job.

How to keep the swap cheap

Put the base URL, the API key, and the model name in config, not in code. Use one thin client wrapper in your app. Send all calls through it. Then a move from llama.cpp on a dev laptop to vLLM in prod is a config change.

This also lets you route traffic. You can send short chat turns to one engine and long agent runs to another. Our guide to LLM model routing covers that pattern.

Where compatible does not mean identical

Compatible APIs still differ at the edges. Watch these spots:

  • Chat templates. vLLM's chat route needs a model with a chat template. A wrong template gives odd or broken replies.
  • Tool calls. Each engine parses tool calls in its own way. Test your tool schemas on every engine.
  • Sampling options. Some fields may be ignored or named a bit differently. vLLM's docs, for example, note that the user field is ignored.
  • Token counts. Usage numbers can differ if tokenizers or templates differ.
  • Errors. Status codes and error text vary. Make your retry logic depend on codes, not on message text.

Write a small contract test that sends the same ten requests to each engine and checks the shape of each reply. Run it in CI whenever you change engine or version.

Failure modes show up as latency, memory, or quality drift

Most engine problems fall into three groups. Latency spikes under load. Memory runs out. Or the answers quietly change. Each has a clear signal you can watch.

Latency spikes under load

Signal: p95 TTFT climbs fast once concurrency passes some level. Cause: the queue grows faster than the engine can prefill. Fix: cap concurrency per GPU, add GPUs, or move to an engine with better prefix reuse if prompts share long starts. Track TTFT and queue depth on a dashboard, as shown in our LLM observability metrics guide.

Out of memory or forced evictions

Signal: requests fail with memory errors, or the engine starts to evict and recompute KV cache. Cause: too many long requests at once, or a model that barely fits. Fix: lower the max context, lower the batch cap, use a smaller quantized model, or add memory. On llama.cpp, lower n-gpu-layers so fewer layers sit in VRAM.

Quiet quality drift

Signal: eval scores drop after an engine swap, even though nothing else changed. Cause: a different precision, a different chat template, or a quantized file that lost too much. Fix: run your eval set on every engine and version before rollout. Hold precision fixed during the engine test, and test precision as a separate step.

Benchmark mistakes that look like engine wins

Signal: one engine wins by a huge margin in your test, but not in prod. Cause: the test changed more than the engine. Common slips include mixed precision, no warm up, a single repeated prompt, or a different GPU. Fix: rerun with the step by step plan above. Report each setting next to each number.

Upgrade breakage

Signal: a new engine release changes flags, defaults, or setup steps. TensorRT-LLM's move away from its TensorRT backend is a clear case. Fix: pin versions in your container image. Rerun your benchmark and contract test before each upgrade.

Checklist before you commit to an engine

Run through this list before you move real traffic. Each item maps to a section above.

  • You wrote down your hardware: chip vendor, GPU model, memory, and count.
  • You picked the model and the precision first, and you know which engines read that format.
  • You confirmed the engine supports your exact chip in its own docs.
  • Your app talks to an OpenAI-compatible API through one config-driven client.
  • You built a prompt set from real traffic, with the real share of shared prefixes.
  • You swept concurrency and logged median and p95 TTFT, inter-token latency, and throughput.
  • You ran the same eval set on each engine and saw no quality drop.
  • You ran a contract test for chat templates, tool calls, and errors.
  • You pinned the engine version and wrote down how to roll back.
  • You have dashboards for TTFT, queue depth, memory, and error rate.
  • If you use TGI today, you have a dated plan to move.

If you speed up decode later, our sibling guide on speculative decoding with draft models is the next step. The llama.cpp server lists speculative decoding as a feature too, so you can try it locally before you try it at scale.

Frequently asked questions

Which inference engine is best for a laptop or a Mac?

llama.cpp is the usual pick for a laptop or a Mac. Its goal is inference with minimal setup on a wide range of hardware. It loads GGUF files, which are single files built for fast loading. It runs quantized models on CPU and GPU, and you can split layers between them. It also ships an OpenAI-compatible server, so your app code can move to a bigger engine later.

What is the main difference between vLLM and SGLang?

Both are GPU serving engines with OpenAI-compatible APIs. vLLM is built around PagedAttention, which stores KV cache in pages to cut waste and fit more requests in memory. SGLang is built around RadixAttention, which keeps KV cache in a radix tree so requests that share a prefix can reuse work. Many agent and RAG workloads share long prefixes, so SGLang is worth a test there.

Is TensorRT-LLM only for NVIDIA GPUs?

Yes. NVIDIA describes TensorRT-LLM as its open-source library for LLM inference on NVIDIA GPUs. It adds features such as FP8 on H100 and later and FP4 weights on B200. If your fleet has AMD, Intel, TPU, or Apple hardware, look at vLLM, SGLang, or llama.cpp instead, since their docs list wider hardware support.

Is Hugging Face TGI still a good choice for new projects?

The TGI docs say the project is now in maintenance mode. It will take only minor bug fixes, doc fixes, and light upkeep. Hugging Face now points users to vLLM and SGLang, and to local engines such as llama.cpp or MLX. An existing TGI setup can keep running, but plan a move for new work.

How do I benchmark inference engines fairly?

Hold everything fixed except the engine. Use the same model weights, the same precision, the same GPU, and the same prompt and output length mix. Warm up first. Then sweep concurrency and record time to first token, inter-token latency, and output tokens per second at each level. Compare engines at the concurrency your users really create, not at one peak number.

Can I switch engines without changing my application code?

Mostly yes, if your app talks to the OpenAI-compatible API. vLLM, SGLang, llama.cpp server, and trtllm-serve all expose one. Keep the base URL and model name in config. Then run a contract test on each engine, since chat templates, tool calls, and some parameters can behave a little differently from one server to the next.

Do published speedup numbers tell me which engine will be fastest for me?

No. Published numbers come from a set model, hardware, and workload. The vLLM paper reports 2 to 4 times more throughput than older systems, and the SGLang paper reports up to 6.4 times on its tasks. Both are useful signals of design strength. Neither predicts your result. Only a test on your own traffic shape can do that.

Sources

  1. TensorRT-LLM docs: Quantization: Supported quantization recipes, including FP8, NVFP4, AWQ and GPTQ.
  2. SGLang docs: Quantization: Offline and online quantization paths and flags.
  3. Efficient Memory Management for Large Language Model Serving with PagedAttention: The vLLM paper. Source for PagedAttention and the reported throughput gain.
  4. SGLang: Efficient Execution of Structured Language Model Programs: The SGLang paper. Source for RadixAttention and the radix tree cache.
  5. vLLM docs: Online Serving: Lists the OpenAI APIs the vLLM server supports.
  6. vLLM docs: Installation: Lists vLLM hardware platforms and plugins.
  7. vLLM docs: Quantization: Lists quantization formats vLLM accepts.
  8. SGLang documentation: Describes SGLang serving goals, hardware, and API support.
  9. SGLang README: States the workloads SGLang is tuned for and its hardware list.
  10. llama.cpp README: States the llama.cpp goal and shows the server launch command.
  11. llama.cpp server README: Lists server features and flags such as GPU layers and slots.
  12. GGUF format spec: Defines the GGUF model file format.
  13. TensorRT-LLM overview: Describes TensorRT-LLM features, FP8 and FP4, and batching.
  14. TensorRT-LLM quick start guide: Shows trtllm-serve and the container install path.
  15. TensorRT-LLM README: Summarizes the library and its custom kernels.
  16. Text Generation Inference docs: States that TGI is in maintenance mode.
Original source record

Skip to content

sinc-LLMAboutBlogServices