
NVIDIA
NVIDIA's engine for the fastest inference on NVIDIA GPUs.
GitHub Stars
14.3K
Contributors
450
PyPI / Month
12.9K
2%TensorRT-LLM is NVIDIA’s dedicated inference engine for serving large language models and visual generation models on NVIDIA GPUs. First released in 2023 under the Apache 2.0 license, it is maintained by NVIDIA and written across Python, C++, and CUDA. With nearly 14,000 GitHub stars, 411 contributors, and over 11,000 monthly PyPI downloads, it is one of the most popular engines for high-performance inference on NVIDIA hardware.
This engine occupies the production serving engine category. It competes directly with vLLM, SGLang, TGI, and LMDeploy. Unlike generic inference libraries, TensorRT-LLM is built around a compilation step that transforms a model into a GPU-specific optimized engine. The design philosophy is simple: trade flexibility for raw speed. The team behind it is NVIDIA’s GPU compute and inference optimization group, the same team that builds TensorRT, CUDA, and the CUTLASS kernel library. The engine is not meant for every deployment, but for teams that need maximum throughput per dollar on NVIDIA GPUs.
TensorRT-LLM follows a two-phase model: compilation then serving. First, you take a model (typically from Hugging Face or a model zoo) and pass it through the trtllm-build tool. This step compiles the model into a TensorRT engine file, applying graph optimizations, kernel fusion, and quantization during the process. The engine is tied to a specific GPU architecture (e.g., H100, B200) and target batch size.
After compilation, you serve the engine using one of two runtimes:
/v1/chat/completions, /v1/completions, and /v1/responses endpoints. This drops in as a replacement for any application written against the OpenAI API.LLM class loads the engine and runs inference with an API similar to Hugging Face’s pipeline but optimized for performance.Both runtimes support the same core features: continuous batching, quantization, multi-GPU parallelism, and streaming. The mental model for an engineer is: you compile a model once per GPU target, then treat the engine file as a deployable artifact. No Python dependencies are needed at runtime for the C++ server path.
TensorRT-LLM only runs on NVIDIA GPUs. No CPU, AMD, or Apple Silicon support. It is designed to wring every token out of H100, H200, B200, GB200, and RTX 6000 Pro Blackwell cards. It uses CUDA graphs, fused attention kernels, and FP4/FP8/INT4 quantization to reduce memory and boost throughput.
The engine achieves its speed through:
NVIDIA publishes official throughput benchmarks for key models across its GPU lineup. For example, on B200 with FP4 quantization, Llama 3.3 70B achieves over 10,600 tokens per second per GPU at 128 input and 128 output tokens. At longer context lengths (128 input, 4096 output), throughput drops to 6,276 t/s per GPU, still competitive. These numbers are reproducible using the trtllm-bench tool.
The trade-off: you must compile for each GPU target and batch configuration. Changing batch size or model version requires recompilation. This makes it less flexible than dynamic runtimes like vLLM but delivers higher throughput in stable production environments.
trtllm-serve exposes an API that matches the OpenAI chat, completion, and responses schemas. You can point any existing OpenAI client (LangChain, LlamaIndex, custom app) at it without code changes. Supports streaming, structured output (JSON schema), and function calling.Latency-sensitive serving: If you serve an LLM-powered assistant where users expect sub-second first-token latency, TensorRT-LLM’s compiled kernels and minimal overhead make it a strong choice. It is commonly used in NVIDIA’s own services (e.g., NIM).
High-throughput NVIDIA deployments: Teams running thousands of queries per second on a fleet of H100 or B200 GPUs choose TensorRT-LLM to maximize tokens per watt and per dollar. The compilation step pays off at scale.
Large multi-GPU models: When a model like Llama 3.1 405B (or a MoE model like Mixtral) does not fit on a single GPU, TensorRT-LLM’s multi-GPU support with tensor parallelism is production-grade. It is often the default for internal NVIDIA clusters.
Self-hosted OpenAI API: Many organizations replace OpenAI with a self-hosted model behind the same API surface. TensorRT-LLM’s trtllm-serve makes this straightforward.
Poor fit for: teams running on AMD, Intel, or Apple hardware; developer laptops without NVIDIA GPUs; rapid prototyping where compile times are unacceptable; heterogeneous hardware environments.
The install command is:
1pip install tensorrt-llm
Prerequisites:
The smallest path to a running model:
nvidia/Llama-3.2-3B-Instruct-FP8).trtllm-build --checkpoint_dir ./model --output_dir ./engine.trtllm-serve ./engine.curl http://localhost:8000/v1/chat/completions -d '{"model":"default","messages":[{"role":"user","content":"hello"}]}'.For offline inference using the Python API:
1from tensorrt_llm import LLM2model = LLM("./engine")3output = model.generate("Hello, how are you?")4print(output[0].text)
Documentation is at [nvidia.github.io/TensorRT-LLM](https://nvidia.github.io/TensorRT-LLM). The GitHub repository ([NVIDIA/TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM)) contains example recipes, benchmarking tools (trtllm-bench), and Slurm deployment scripts. Community support is primarily through GitHub issues and NVIDIA developer forums.
TensorRT-LLM vs vLLM: vLLM uses PagedAttention and is architecture-agnostic (NVIDIA, AMD, CPU). TensorRT-LLM is faster on NVIDIA GPUs (10-30% higher throughput in many benchmarks) but requires compilation per GPU target. vLLM is easier to iterate with and supports more hardware. Choose TensorRT-LLM for production fleets of homogeneous NVIDIA GPUs where peak throughput matters more than quick deployment. Choose vLLM for dynamic environments, multi-vendor hardware, or when you need to swap models frequently without recompilation.
TensorRT-LLM vs Ollama: Ollama is designed for local development and single-user use on consumer GPUs. It abstracts away compilation and offers a simple ollama run experience. TensorRT-LLM requires manual setup and compilation, making it inappropriate for quick experimentation. Ollama also supports CPU and Apple Silicon. If you are running open models locally on a gaming GPU, use Ollama. If you are deploying to a production cluster with dozens of H100s, use TensorRT-LLM.
TensorRT-LLM vs SGLang: SGLang emphasizes programming language-like control over LLM outputs (structured generation, function calls). TensorRT-LLM supports these features but does not match SGLang’s flexibility in composing calls. However, on NVIDIA GPUs, TensorRT-LLM typically delivers superior throughput. SGLang also supports AMD GPUs. Your choice depends on whether you need advanced output control (SGLang) or raw speed (TensorRT-LLM).
TensorRT-LLM vs TGI: Hugging Face’s TGI offers broad model support and simple deployment. It is slower than TensorRT-LLM on equivalent hardware. TensorRT-LLM is the better choice if you are already committed to NVIDIA and need every token of performance. TGI wins on model coverage and ease of use.
What the engine gives you out of the box, in plain language.
Turns a model into a hardware-tuned engine for faster runs on NVIDIA GPUs.
Adds and removes requests from the batch on the fly to keep the GPU busy.
trtllm-serve exposes a local endpoint that mirrors the OpenAI API.
The jobs this engine is best suited for.
Serve a model where every millisecond of response time matters.
Get the most throughput per card on NVIDIA hardware.
Split a big model across several NVIDIA GPUs.

Side-by-Side
Add a second or third engine and see stars, downloads, and capabilities lined up next to each other.
Close alternatives worth a look before you decide.
High-throughput GPU serving with an OpenAI-compatible API out of the box.
High-throughput GPU serving
pip install vllmStars
88.8K
PyPI / mo
5.1M
Fast serving engine tuned for structured output and complex prompting.
High-throughput serving with structured output
pip install "sglang[all]"Stars
31.7K
PyPI / mo
327.4M
Run open models locally with a single command.
One-line local model running
curl -fsSL https://ollama.com/install.sh | shStars
178.2K
PyPI / mo
—