Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →High-throughput LLM inference on NVIDIA GPUs.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 98% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 16% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 29% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 23% | 0% |
NVIDIA's open-source library for optimizing LLM inference with state-of-the-art performance on NVIDIA GPUs.
Use TensorRT-LLM when:
Use vLLM instead when:
Use llama.cpp instead when:
bash# Docker (recommended) — images are on NGC (nvcr.io), not Docker Hub. # Replace x.y.z with the desired version (e.g. 1.2.1). Browse tags on NGC: # https://catalog.ngc.nvidia.com/orgs/nvidia/teams/tensorrt-llm/containers/release/tags docker pull nvcr.io/nvidia/tensorrt-llm/release:x.y.z # pip install (current stable GA) pip install tensorrt_llm # Requires CUDA 13.2.1, TensorRT 10.x, Python 3.10-3.12
pythonfrom tensorrt_llm import LLM, SamplingParams # Initialize model llm = LLM(model="meta-llama/Meta-Llama-3-8B") # Configure sampling sampling_params = SamplingParams( max_tokens=100, temperature=0.7, top_p=0.9 ) # Generate prompts = ["Explain quantum computing"] outputs = llm.generate(prompts, sampling_params) for output in outputs: print(output.text)
bash# Start server (automatic model download and compilation) trtllm-serve meta-llama/Meta-Llama-3-8B \ --tp_size 4 \ # Tensor parallelism (4 GPUs) --max_batch_size 256 \ --max_num_tokens 4096 # Client request curl -X POST http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "meta-llama/Meta-Llama-3-8B", "messages": [{"role": "user", "content": "Hello!"}], "temperature": 0.7, "max_tokens": 100 }'
pythonfrom tensorrt_llm import LLM # Load FP8 quantized model (2× faster, 50% memory) llm = LLM( model="meta-llama/Meta-Llama-3-70B", dtype="fp8", max_num_tokens=8192 ) # Inference same as before outputs = llm.generate(["Summarize this article..."])
python# Tensor parallelism across 8 GPUs llm = LLM( model="meta-llama/Meta-Llama-3-405B", tensor_parallel_size=8, dtype="fp8" )
python# Process 100 prompts efficiently prompts = [f"Question {i}: ..." for i in range(100)] outputs = llm.generate( prompts, sampling_params=SamplingParams(max_tokens=200) ) # Automatic in-flight batching for maximum throughput
Meta Llama 3-8B (H100 GPU):
Llama 3-70B (8× A100 80GB):
Other measured skills in the registry, with their headline benchmark lift.