Skip to main content
PromptQuorum
Home/Power Local LLM/TensorRT-LLM Explained: NVIDIA's GPU-Optimized Inference Engine (2026)
Overview & Reference

TensorRT-LLM Explained: NVIDIA's GPU-Optimized Inference Engine (2026)

Β·13 min readΒ·By Hans Kuepper Β· Founder of PromptQuorum, multi-model AI dispatch tool Β· PromptQuorum

TensorRT-LLM is a free, open-source (Apache 2.0) library published by NVIDIA that compiles large language models into optimized inference "engines" built specifically for NVIDIA GPUs. Built on top of NVIDIA's TensorRT deep-learning inference SDK, it adds LLM-specific techniques including in-flight (continuous) batching, a paged KV cache, custom attention kernels, and quantization down to FP8 and INT4 to push inference throughput as high as the target GPU generation allows. The defining trade-off is the ahead-of-time compilation step: a model must be built into a GPU-specific engine before it can serve traffic, unlike llama.cpp or vLLM, which load a model directly with no separate compile step. In production, TensorRT-LLM is most often reached through NVIDIA Triton Inference Server or packaged inside NVIDIA NIM microservices, and it targets maximum per-GPU throughput on NVIDIA hardware in datacenter and enterprise deployments β€” not single-user desktop chat.

TensorRT-LLM is an open-source library, published by NVIDIA under the Apache 2.0 license, for compiling and optimizing large language model inference specifically for NVIDIA GPUs. Instead of loading a model and running it directly the way llama.cpp or vLLM do, TensorRT-LLM compiles a model ahead of time into an optimized "engine" built from custom CUDA kernels tuned for a specific NVIDIA GPU generation. That compilation step is the trade its whole design rests on: in exchange for the extra build step and NVIDIA-only hardware requirement, it targets the highest achievable inference performance on NVIDIA GPUs, and it is the engine underneath NVIDIA's own NIM microservices and a common backend for NVIDIA Triton Inference Server.

TensorRT-LLM Explained: NVIDIA's GPU-Optimized Inference Engine (2026)

Key Takeaways

  • Free and Apache 2.0-licensed open-source, published by NVIDIA on GitHub
  • Built on NVIDIA's TensorRT deep-learning inference SDK, extended with LLM-specific optimizations
  • Compiles a model ahead of time into an optimized engine for a specific GPU β€” a distinct step vLLM and llama.cpp do not require
  • Uses in-flight (continuous) batching and a paged KV cache to keep GPU utilization high under concurrent traffic
  • Supports quantization including FP8, INT8, INT4, AWQ, and GPTQ; newest formats need current-generation NVIDIA GPUs
  • Runs only on NVIDIA GPUs β€” no CPU, AMD, Apple Silicon, or other vendor support
  • Commonly deployed via NVIDIA Triton Inference Server or packaged inside NVIDIA NIM microservices
  • Built for datacenter and enterprise production serving, not single-user desktop chat

πŸ“ In One Sentence

TensorRT-LLM is NVIDIA's free, Apache 2.0-licensed library that compiles LLMs into GPU-specific optimized inference engines using in-flight batching, a paged KV cache, and quantization, aimed at maximum throughput on NVIDIA GPUs.

πŸ’¬ In Plain Terms

Instead of just loading a model and running it, TensorRT-LLM has an extra "build" step: you compile the model once for your specific NVIDIA GPU, and the resulting engine runs faster on that GPU than a general-purpose loader would β€” but it only runs on NVIDIA hardware and needs a rebuild if you change GPU generation or model.

πŸ“ŒNote: This article is based on NVIDIA's official TensorRT-LLM GitHub repository and public documentation, not independent benchmarking. Specific throughput or latency figures are not included because they were not independently measured for this article and vary heavily by GPU generation, model, batch composition, and TensorRT-LLM version. This article describes TensorRT-LLM factually as a third party; it is not affiliated with or endorsed by NVIDIA.

What Is TensorRT-LLM?

TensorRT-LLM is an open-source library published by NVIDIA for optimizing and running large language model inference on NVIDIA GPUs. It is built on top of TensorRT, NVIDIA's general-purpose deep-learning inference SDK, and adds a layer of LLM-specific runtime features and a Python API for defining and building models into optimized engines.

  • Published and maintained by NVIDIA, distributed as open source under the Apache 2.0 license on GitHub
  • Extends NVIDIA's general TensorRT inference SDK with transformer- and LLM-specific optimizations
  • Provides a Python API (tensorrt_llm.LLM) as well as a trtllm-build command-line workflow for compiling models
  • Includes a trtllm-serve command for standing up an OpenAI-compatible endpoint directly from a built engine
  • Supports many popular open model families, though exact per-model support and required conversion steps vary by TensorRT-LLM release β€” check the project's supported-models documentation before committing to a model

What Makes TensorRT-LLM Fast?

TensorRT-LLM's performance approach combines an ahead-of-time compilation step with several LLM-specific runtime optimizations, rather than relying on one single technique.

  • In-flight batching (NVIDIA's term for continuous batching): new requests can join a running batch and finished requests can leave it without waiting for the whole batch to complete, keeping the GPU busy under real, uneven traffic
  • Paged KV cache: the attention key-value cache is managed in fixed-size blocks rather than one large per-request allocation, reducing wasted GPU memory β€” conceptually similar to the paging approach vLLM's PagedAttention popularized
  • Custom attention and GEMM kernels: hand-tuned CUDA kernels for the specific operations LLMs run most, compiled and selected for the target GPU during the engine-build step
  • Ahead-of-time engine compilation: the model graph, chosen precision, and kernel selections are fixed into a single optimized engine file before serving starts, rather than decided dynamically at load time
  • Speculative decoding support: NVIDIA documents draft-model and other speculative-decoding techniques to generate multiple candidate tokens per step and verify them in parallel

What Hardware Does TensorRT-LLM Need?

TensorRT-LLM runs exclusively on NVIDIA GPUs β€” there is no CPU-only, AMD, Intel, or Apple Silicon backend. Within NVIDIA's own GPU lineup, which optimizations are available depends on the GPU's architecture generation.

Blackwell (e.g. B200)

Details:
The newest supported architecture as of this writing. Adds hardware-accelerated FP4 (NVFP4) support alongside FP8, per NVIDIA's documentation.

Hopper (e.g. H100, H200)

Details:
Hardware FP8 support; documented by NVIDIA as one of the most mature paths for TensorRT-LLM's newer quantization and attention optimizations.

Ada Lovelace (e.g. L4, L40S)

Details:
Supported, with INT8 (including SmoothQuant) commonly used as a fallback where full FP8 tooling support is narrower than on Hopper/Blackwell.

Older architectures (e.g. Ampere)

Details:
Broader compatibility exists for some earlier NVIDIA datacenter GPUs, but the newest quantization formats and kernel optimizations target current-generation hardware β€” check NVIDIA's release notes for the exact GPU-to-feature matrix for the version you plan to use.

If your goal is running a model on a laptop, a Mac, or any non-NVIDIA GPU, TensorRT-LLM is not built for that β€” llama.cpp and tools built on it, like Ollama and LM Studio, target CPU and Apple Silicon hardware directly and are the better fit for that scenario.

What Quantization Formats Does TensorRT-LLM Support?

TensorRT-LLM supports running models at reduced numeric precision to cut memory use and increase throughput, with the specific formats available depending on the target GPU generation.

FP8

Details:
Hardware-accelerated 8-bit floating point on Hopper and Blackwell GPUs; NVIDIA documents this as generally the best precision/throughput trade-off on those generations.

FP4 (NVFP4)

Details:
A Blackwell-exclusive 4-bit floating-point format documented by NVIDIA for Blackwell-generation GPUs and current TensorRT/CUDA toolchain versions.

INT8 / INT4

Details:
Integer quantization paths including SmoothQuant, documented as a fallback on GPU generations (such as Ada) where full FP8 tooling coverage is narrower.

AWQ / GPTQ

Details:
Established community 4-bit weight-quantization methods, with TensorRT-LLM supporting these formats alongside its own precision options.

This article does not include independently measured quality-loss figures for each format on each GPU generation β€” those vary by model architecture and task, so comparing outputs from a couple of formats on your own prompts and hardware is the most reliable way to judge the trade-off.

How Does TensorRT-LLM Get Deployed?

TensorRT-LLM can be run directly through its own Python/C++ runtime, but in production it is most commonly reached through one of two NVIDIA deployment layers built around it.

  • trtllm-serve: a command included with TensorRT-LLM that stands up an OpenAI-compatible API endpoint directly from a built engine, without a separate serving framework
  • NVIDIA Triton Inference Server: a general-purpose model-serving platform with a TensorRT-LLM backend, adding request queuing, multi-model orchestration, and production-grade deployment features like Kubernetes integration
  • NVIDIA NIM: prebuilt, containerized microservices sold as part of an NVIDIA AI Enterprise subscription, which package a TensorRT-LLM-optimized backend behind a standardized API with vendor support β€” see the enterprise inference server comparison for a deeper look at NIM's licensing and support model

How Do You Build and Run a TensorRT-LLM Engine?

TensorRT-LLM requires an NVIDIA GPU, a matching CUDA driver, and typically NVIDIA's own container image to avoid dependency-version mismatches, since it depends closely on specific CUDA and TensorRT toolchain versions.

  1. 1
    Confirm you have a supported NVIDIA GPU (Hopper, Ada, or Blackwell generation for the newest optimizations) with a current CUDA driver installed.
  2. 2
    Pull NVIDIA's official TensorRT-LLM container image, or install the tensorrt_llm Python package into a matching CUDA environment β€” the containerized route avoids most dependency-version mismatches.
  3. 3
    Convert or load your source model checkpoint (for example, from Hugging Face) using the TensorRT-LLM Python API or example conversion scripts for that model family.
  4. 4
    Build the optimized engine for your specific GPU with the trtllm-build command, choosing a precision (FP16, FP8, INT4/INT8, or FP4 on Blackwell) and batching configuration at build time.
  5. 5
    Launch the built engine, either directly with trtllm-serve for an OpenAI-compatible endpoint, or by pointing NVIDIA Triton Inference Server's TensorRT-LLM backend at the engine directory.
  6. 6
    Send a test request to the served endpoint (curl or any OpenAI-API-compatible client) to confirm the engine loads and generates correctly before routing production traffic to it.
  7. 7
    Re-run the build step whenever you change GPU generation, model, or want to pick up a new TensorRT-LLM release β€” an engine built for one GPU generation is not guaranteed to run optimally, or at all, on a different one.

Do I need to rebuild the engine for every GPU?

Generally yes for optimal results β€” an engine is compiled with kernel selections and optimizations for a specific GPU architecture generation, so moving to a different GPU generation typically requires rebuilding it.

Can I use a pre-quantized model with TensorRT-LLM?

Yes β€” TensorRT-LLM supports building engines from models quantized with AWQ or GPTQ, in addition to its own FP8/INT8/INT4/FP4 quantization applied during the build step.

How Does TensorRT-LLM Compare to vLLM and llama.cpp?

TensorRT-LLM, vLLM, and llama.cpp all run LLM inference, but they sit at different points on the performance-versus-flexibility spectrum.

TensorRT-LLM

Details:
NVIDIA-only, Apache 2.0-licensed. Requires an ahead-of-time compile step per GPU generation; targets the highest achievable throughput on that specific NVIDIA hardware in exchange for the build step and vendor lock-in.

vLLM

Details:
Apache 2.0-licensed, loads Hugging Face Transformers-compatible models directly with no compile step. NVIDIA GPUs are its primary target, with documented (narrower) AMD, Intel, and TPU backends too.

llama.cpp

Details:
MIT-licensed, C/C++ engine that runs on CPU, Apple Silicon, and a broad range of GPU vendors via the GGUF model format β€” the most hardware-flexible of the three, but not built for the multi-GPU, high-concurrency datacenter scale TensorRT-LLM and vLLM target.

This article has not independently benchmarked these three engines against each other and does not claim one is universally faster β€” throughput depends heavily on the model, GPU generation, batch characteristics, and each engine's version. TensorRT-LLM's real edge is peak performance on current-generation NVIDIA hardware specifically, at the cost of the compile step and NVIDIA-only support; vLLM trades some of that peak, GPU-specific tuning for a simpler no-compile workflow and broader (though still NVIDIA-primary) hardware coverage; llama.cpp trades further peak throughput for running on hardware neither of the other two targets, including CPUs and Macs.

How Does TensorRT-LLM Relate to NVIDIA NIM and Triton?

TensorRT-LLM, NVIDIA NIM, and NVIDIA Triton Inference Server are not competitors β€” they are different layers of the same NVIDIA inference stack, and understanding the difference matters when planning a deployment.

TensorRT-LLM

Details:
The engine and compiler: turns a model into an optimized, GPU-specific inference engine. Free and open source (Apache 2.0); you operate it yourself.
Articles about TensorRT-LLM (5)

Also mentioned in:

NVIDIA Triton Inference Server

Details:
A general-purpose, free and open-source model-serving platform with a TensorRT-LLM backend, adding request routing, multi-model hosting, and production orchestration around one or more engines.

NVIDIA NIM

Details:
A paid, prebuilt microservice layer, sold as part of an NVIDIA AI Enterprise subscription, that packages a TensorRT-LLM-optimized backend behind a standardized API with vendor support β€” trading DIY setup for a supported, ready-to-deploy container.

A common path is: build the model into a TensorRT-LLM engine, then serve it through Triton for self-managed production deployment, or skip the build step entirely by using a prebuilt NIM container if the paid subscription and vendor support are worth it for your team. See the enterprise inference server comparison for the licensing and cost trade-offs across NIM, vLLM, and TGI.

Who Should Use TensorRT-LLM?

TensorRT-LLM fits teams that have committed to NVIDIA GPU hardware and need the highest achievable inference throughput from it, not people looking for the simplest way to run a model.

TensorRT-LLM vs. Alternatives at a Glance

These tools sit at different points on the setup-complexity-versus-peak-performance spectrum.

TensorRT-LLM

Setup:
Compile a GPU-specific engine with trtllm-build, then serve it with trtllm-serve or Triton. NVIDIA GPU and CUDA required.
Best for:
Maximum per-GPU throughput on NVIDIA hardware in production, at the cost of a compile step.

vLLM

Setup:
Python package via pip; OpenAI-compatible server started with vllm serve. No compile step; NVIDIA GPU primary target.
Best for:
High-throughput multi-user serving with a simpler, no-compile workflow.

llama.cpp

Setup:
CLI, built-in web UI, and OpenAI-compatible API via llama-server. Runs on CPU or a broad range of GPU vendors.
Best for:
Hardware flexibility, embedded/edge deployment, and CPU or Apple Silicon use.

NVIDIA NIM

Setup:
Prebuilt container, deployed with a paid NVIDIA AI Enterprise subscription. No build step for the end user.
Best for:
Teams that want TensorRT-LLM-level performance without operating the compile pipeline themselves.

This article has not independently benchmarked speed or output quality across these tools and does not claim one is technically superior for every workload β€” the comparison above covers documented architecture, setup, and licensing facts only. See the enterprise inference server guide for a deeper licensing and deployment comparison.

What Does This Article Not Cover?

This is an explainer built from NVIDIA's public documentation and repository, not a hands-on benchmark report.

  • No independently measured throughput, latency, or requests-per-second figures β€” these depend heavily on GPU generation, model, batch composition, and TensorRT-LLM version
  • No independently verified quality-loss percentages for specific quantization formats on specific GPUs β€” these vary by model architecture and task
  • No full coverage of every supported model architecture, kernel option, or advanced feature (disaggregated serving, expert parallelism, LoRA) β€” this article focuses on the concepts most teams evaluate first
  • No coverage of NVIDIA AI Enterprise or NIM pricing, since enterprise subscription pricing is not published the way a retail product's is β€” confirm current pricing directly with NVIDIA
  • No claim of NVIDIA endorsement or partnership β€” this article describes TensorRT-LLM factually as an independent, third-party explainer based on public sources

Common Mistakes When Trying TensorRT-LLM

Most friction with TensorRT-LLM comes from underestimating the build/compile step or expecting it to behave like a direct-load engine.

Frequently Asked Questions

What is TensorRT-LLM?

TensorRT-LLM is a free, open-source (Apache 2.0) library published by NVIDIA that compiles large language models into optimized inference engines built specifically for NVIDIA GPUs, built on top of NVIDIA's TensorRT deep-learning inference SDK.

Is TensorRT-LLM free?

Yes. TensorRT-LLM itself is free, open-source software released under the Apache 2.0 license. NVIDIA NIM, a separate paid microservice layer that packages a TensorRT-LLM backend, requires an NVIDIA AI Enterprise subscription.

Does TensorRT-LLM run on AMD or Apple GPUs?

No. TensorRT-LLM runs exclusively on NVIDIA GPUs β€” there is no CPU-only, AMD, Intel, or Apple Silicon backend, unlike vLLM or llama.cpp, which support broader hardware.

Why does TensorRT-LLM require compiling a model first?

TensorRT-LLM builds a model ahead of time into an engine with kernel selections and optimizations fixed for a specific GPU architecture generation, which is how it achieves its performance target. This trades a build step and less cross-hardware flexibility for higher peak throughput on that specific NVIDIA GPU compared to engines that decide everything dynamically at load time.

What quantization formats does TensorRT-LLM support?

TensorRT-LLM supports FP8 and FP4 (FP4 exclusive to Blackwell-generation GPUs), INT8 and INT4 including SmoothQuant, and community formats like AWQ and GPTQ, with exact availability depending on the target GPU generation.

Is TensorRT-LLM better than vLLM?

"Better" depends on the job: TensorRT-LLM targets the highest achievable per-GPU throughput on NVIDIA hardware specifically, at the cost of an ahead-of-time compile step and NVIDIA-only support. vLLM loads models directly with no compile step and documents backend support beyond NVIDIA GPUs alone. Neither is universally faster β€” see the comparison table above.

What is the difference between TensorRT-LLM and NVIDIA NIM?

TensorRT-LLM is the free, open-source engine and compiler you operate yourself. NVIDIA NIM is a separate, paid microservice layer that packages a TensorRT-LLM-optimized backend behind a standardized API with vendor support, sold as part of an NVIDIA AI Enterprise subscription.

Can TensorRT-LLM serve models across multiple GPUs?

Yes. NVIDIA documents multi-GPU and multi-node serving support in TensorRT-LLM for models too large to fit on a single GPU, typically deployed through NVIDIA Triton Inference Server for production orchestration.

Sources

← Back to Power Local LLM