Skip to content
,

What Is TensorRT-LLM? NVIDIA's LLM Inference Engine Explained (vs vLLM and SGLang)

TensorRT-LLM is NVIDIA's open-source library for running large language models as fast as possible on NVIDIA GPUs. A clear, practical guide: what it is, how it works, every key optimisation, supported GPUs and models, quantization formats, a quick start with code, how it fits with Triton, Dynamo and NIM, and an honest comparison with vLLM, SGLang and llama.cpp.

5 min read

What Is TensorRT-LLM? — what is tensorrt-llm

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

ComponentRole
TensorRTNVIDIA's general deep learning inference optimiser (since 2017)
TensorRT-LLMLLM-specific library: kernels, batching, KV cache, quantization, parallelism
TensorRT Model OptimizerQuantization and sparsity tools that prepare checkpoints (FP8, NVFP4, INT4 AWQ)
Triton Inference ServerGeneral model serving platform with a TensorRT-LLM backend
NVIDIA DynamoDistributed inference framework for large-scale, disaggregated serving
NVIDIA NIMPrebuilt inference microservices, often using TensorRT-LLM inside

Key features

FeatureWhat it doesWhy it matters
In-flight (continuous) batchingAdds new requests as others finishKeeps the GPU busy, higher throughput
Paged KV cacheStores attention cache in blocksLess wasted memory, more concurrent users; see KV cache
KV cache reuseReuses cached prefixesFaster responses for shared system prompts
Chunked prefillSplits long promptsSmoother latency under load; see prefill vs decode
QuantizationFP8, NVFP4/FP4, INT8 SmoothQuant, INT4 AWQ, GPTQLess memory, faster inference; see LLM quantization
Speculative decodingDraft models, Medusa, EAGLE, multi-token prediction2–3× faster generation; see speculative decoding
ParallelismTensor, pipeline, expert and context parallelismRun huge models across GPUs and nodes
Disaggregated servingSeparate prefill and decode GPUsBetter efficiency at scale
Optimised attentionFlashAttention-style and MLA kernelsFaster long contexts; see FlashAttention
LoRA servingMultiple adapters on one base modelEfficient multi-tenant fine-tuned models; see What is LoRA?

Supported hardware

GPU generationExamplesNotable support
BlackwellB200, B300, GB200, RTX 50, RTX PRO 6000FP4 (NVFP4), newest kernels
HopperH100, H200, GH200FP8 with Transformer Engine
Ada LovelaceL40S, L4, RTX 40FP8
AmpereA100, A10, RTX 30INT8/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_llm

Python 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 8000

Then 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-LLMvLLMSGLangllama.cpp
DeveloperNVIDIAOpen-source community (UC Berkeley origins)Open-source community (LMSYS origins)Open-source community
HardwareNVIDIA onlyNVIDIA, AMD, Intel, TPU and moreNVIDIA, AMD, othersAlmost anything (CPU, GPU, Apple)
Peak NVIDIA performanceExcellentVery goodVery goodGood for single-user
Ease of useModerateEasyEasy–moderateEasy
Newest NVIDIA features (FP4, NVL72)FirstFast followerFast followerLimited
New model support speedFast for major modelsVery fastVery fastVery fast (GGUF)
Best forMaximum throughput on NVIDIA, enterprise NIM deploymentsGeneral-purpose servingHigh-throughput serving, structured outputsLocal 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

Think you understand it now? Prove it.

Solve real Tensor Core math in the TensorCore.si Challenge and earn a certificate with your name.

Take the challenge

Leave a Reply

Your email address will not be published. Required fields are marked *