docs/getting_started/trtllm_user_guide.md
TensorRT-LLM (TRT-LLM) is an open-source library designed to accelerate and optimize the inference performance of large language models (LLMs) on NVIDIA GPUs. Built on PyTorch, TRT-LLM offers an easy-to-use Python LLM API that lets you serve any HuggingFace model directly, incorporating state-of-the-art optimizations to ensure efficient inference on NVIDIA GPUs.
The TensorRT-LLM Backend lets you serve TensorRT-LLM models with Triton Inference Server. With the PyTorch backend (LLM API) you can serve any HuggingFace model directly — no engine compilation required. The steps below get you from an empty container to a running server in a few minutes.
docker run --rm -it --net host --shm-size=2g --ulimit memlock=-1 --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
nvcr.io/nvidia/tritonserver:25.12-trtllm-python-py3 bash
Replace 25.12 with the latest tag from
NGC.
git clone https://github.com/NVIDIA/TensorRT-LLM.git
Edit TensorRT-LLM/triton_backend/all_models/llmapi/tensorrt_llm/1/model.yaml
and set model: to any HuggingFace model ID or local path, for example:
model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
All keys in model.yaml map directly to
LLM() constructor arguments.
This is where you configure KV cache, quantization, parallelism, and more. For
gated models (e.g. Llama), set your token first: export HF_TOKEN=hf_...
Run the launch script from the parent of TensorRT-LLM/ (running it from inside
the cloned folder causes ModuleNotFoundError: No module named 'tensorrt_llm.bindings'):
python3 TensorRT-LLM/triton_backend/scripts/launch_triton_server.py \
--model_repo=TensorRT-LLM/triton_backend/all_models/llmapi/
Once the server is up, send a request:
curl -X POST localhost:8000/v2/models/tensorrt_llm/generate \
-d '{"text_input": "The future of AI is", "sampling_param_max_tokens": 50}' | jq
For multi-GPU, multi-node, and the full set of configuration and deployment options, see the TensorRT-LLM Backend README and the LLM API guide.
Explore advanced configuration options and deployment strategies to optimize and run Triton with your TRT-LLM models effectively:
Make sure to check out the tutorials repo to see more guides on serving popular LLM models with Triton Server and TensorRT-LLM, as well as deploying them on Kubernetes.
GenAI-Perf is a command line tool for measuring the throughput and latency of LLMs served by Triton Inference Server. Check out the Quick Start to learn how to use GenAI-Perf to benchmark your LLM models.
Check out the Performance tuning guide to learn how to optimize your TensorRT-LLM models for better performance.
Triton Server provides metrics indicating GPU and request statistics. See the Triton Metrics section in the TensorRT-LLM Backend repo to learn how to query the Triton metrics endpoint to obtain TRT-LLM statistics.
Can't find what you're looking for, or have a question or issue? Feel free to ask questions or report issues in the GitHub issues page: