Short answer
What is TensorRT-LLM? TensorRT-LLM is NVIDIA's open-source library (Apache 2.0) for optimising and serving large language models on NVIDIA GPUs. Released in October 2023, it combines highly tuned CUDA kernels with serving features such as in-flight batching, paged KV cache, FP8 and FP4 quantization, speculative decoding and multi-GPU parallelism. Since version 1.0 it uses a PyTorch-based workflow with a simple Python LLM API and an OpenAI-compatible server (trtllm-serve). It often delivers the highest throughput on NVIDIA hardware, especially new GPUs like Blackwell, and powers NVIDIA's NIM microservices. The trade-offs are NVIDIA-only hardware and a steeper learning curve than vLLM or Ollama.
Where TensorRT-LLM fits
| Component | Role |
|---|---|
| TensorRT | NVIDIA's general deep learning inference optimiser (since 2017) |
| TensorRT-LLM | LLM-specific library: kernels, batching, KV cache, quantization, parallelism |
| TensorRT Model Optimizer | Quantization and sparsity tools that prepare checkpoints (FP8, NVFP4, INT4 AWQ) |
| Triton Inference Server | General model serving platform with a TensorRT-LLM backend |
| NVIDIA Dynamo | Distributed inference framework for large-scale, disaggregated serving |
| NVIDIA NIM | Prebuilt inference microservices, often using TensorRT-LLM inside |
Key features
| Feature | What it does | Why it matters |
|---|---|---|
| In-flight (continuous) batching | Adds new requests as others finish | Keeps the GPU busy, higher throughput |
| Paged KV cache | Stores attention cache in blocks | Less wasted memory, more concurrent users; see KV cache |
| KV cache reuse | Reuses cached prefixes | Faster responses for shared system prompts |
| Chunked prefill | Splits long prompts | Smoother latency under load; see prefill vs decode |
| Quantization | FP8, NVFP4/FP4, INT8 SmoothQuant, INT4 AWQ, GPTQ | Less memory, faster inference; see LLM quantization |
| Speculative decoding | Draft models, Medusa, EAGLE, multi-token prediction | 2–3× faster generation; see speculative decoding |
| Parallelism | Tensor, pipeline, expert and context parallelism | Run huge models across GPUs and nodes |
| Disaggregated serving | Separate prefill and decode GPUs | Better efficiency at scale |
| Optimised attention | FlashAttention-style and MLA kernels | Faster long contexts; see FlashAttention |
| LoRA serving | Multiple adapters on one base model | Efficient multi-tenant fine-tuned models; see What is LoRA? |
Supported hardware
| GPU generation | Examples | Notable support |
|---|---|---|
| Blackwell | B200, B300, GB200, RTX 50, RTX PRO 6000 | FP4 (NVFP4), newest kernels |
| Hopper | H100, H200, GH200 | FP8 with Transformer Engine |
| Ada Lovelace | L40S, L4, RTX 40 | FP8 |
| Ampere | A100, A10, RTX 30 | INT8/INT4 weight-only, FP16/BF16 |
Linux is the primary platform; Windows support was deprecated in 2025. See NVIDIA B200 specs and NVIDIA H100 specs.
Quick start
Install
Use NVIDIA's NGC container (recommended) or pip on Linux with a supported CUDA version:
pip install tensorrt_llmPython LLM API
from tensorrt_llm import LLM, SamplingParams
llm = LLM(model="Qwen/Qwen2.5-7B-Instruct")
params = SamplingParams(temperature=0.7, max_tokens=256)
for out in llm.generate(["Explain tensor cores in two sentences."], params):
print(out.outputs[0].text)OpenAI-compatible server
trtllm-serve Qwen/Qwen2.5-7B-Instruct --host 0.0.0.0 --port 8000Then call http://localhost:8000/v1/chat/completions with any OpenAI-compatible client.
Older versions required building a separate "engine" per model and GPU configuration (trtllm-build); this workflow still exists for maximum optimisation, but the PyTorch-based path is now the default and much simpler.
Performance
NVIDIA regularly uses TensorRT-LLM for its record results:
- At launch (2023), NVIDIA reported up to 8× higher GPT-J inference throughput on H100 with TensorRT-LLM compared with A100 without it.
- On Blackwell, NVIDIA has reported over 1,000 tokens per second per user on large models using TensorRT-LLM with speculative decoding.
- Many NVIDIA MLPerf Inference submissions use TensorRT-LLM.
Independent comparisons generally find TensorRT-LLM at or near the top for throughput on NVIDIA GPUs, with vLLM and SGLang close behind and sometimes ahead depending on model, version and workload. Always benchmark your own workload. See LLM inference engines compared.
TensorRT-LLM vs vLLM vs SGLang vs llama.cpp
| TensorRT-LLM | vLLM | SGLang | llama.cpp | |
|---|---|---|---|---|
| Developer | NVIDIA | Open-source community (UC Berkeley origins) | Open-source community (LMSYS origins) | Open-source community |
| Hardware | NVIDIA only | NVIDIA, AMD, Intel, TPU and more | NVIDIA, AMD, others | Almost anything (CPU, GPU, Apple) |
| Peak NVIDIA performance | Excellent | Very good | Very good | Good for single-user |
| Ease of use | Moderate | Easy | Easy–moderate | Easy |
| Newest NVIDIA features (FP4, NVL72) | First | Fast follower | Fast follower | Limited |
| New model support speed | Fast for major models | Very fast | Very fast | Very fast (GGUF) |
| Best for | Maximum throughput on NVIDIA, enterprise NIM deployments | General-purpose serving | High-throughput serving, structured outputs | Local and edge inference |
Boundaries blur: vLLM and SGLang can use NVIDIA-derived kernels, and all three borrow ideas from each other.
When to use TensorRT-LLM
Use it if:
- You run only NVIDIA GPUs and want maximum throughput or lowest cost per token.
- You deploy on Blackwell and want FP4 and NVL72 optimisations first.
- You use NVIDIA NIM, Triton or Dynamo.
- You serve at large scale where a few percent efficiency is worth engineering time.
Choose something else if:
- You need AMD, Intel or Apple support (vLLM, SGLang, llama.cpp).
- You want the simplest local setup (Ollama, LM Studio); see Ollama vs LM Studio.
- You need day-zero support for niche models.
Cost impact
Inference cost per token is GPU price ÷ throughput. If an optimised engine raises throughput by 30%, cost per token falls by about 23% on the same hardware. On an H100 at the November 2026 median of $3.92/hour from our GPU price tracker, that difference adds up quickly at scale. See LLM inference cost per token.
Frequently asked questions
Is TensorRT-LLM free?
Yes. It is open source under the Apache 2.0 licence and available on GitHub.
Does TensorRT-LLM work on AMD GPUs?
No. It is designed specifically for NVIDIA GPUs. For AMD, use vLLM or SGLang with ROCm; see ROCm vs CUDA.
Is TensorRT-LLM faster than vLLM?
Often on NVIDIA hardware, especially with the newest GPUs and quantization formats, but the gap varies by model and version; vLLM is sometimes equal or faster.
Can I run TensorRT-LLM on an RTX GPU?
Yes, on supported RTX GPUs (Ampere and newer) under Linux, though most users with consumer GPUs prefer simpler tools.
What is the difference between TensorRT and TensorRT-LLM?
TensorRT is a general inference optimiser for neural networks. TensorRT-LLM is a specialised library built for large language models, adding batching, KV cache management, quantization and multi-GPU features.
Sources and further reading
- NVIDIA, TensorRT-LLM documentation
- NVIDIA, TensorRT-LLM on GitHub
- NVIDIA Developer Blog, NVIDIA TensorRT-LLM supercharges large language model inference on NVIDIA H100 GPUs (2023)
- SemiAnalysis InferenceX, TensorRT-LLM glossary
- Kwon et al., Efficient Memory Management for LLM Serving with PagedAttention (vLLM, 2023)




Leave a Reply