T
tensorrt-llm
Optimizes LLM inference with NVIDIA TensorRT for maximum throughput and lowest latency. Use for production deployment on NVIDIA GPUs (A100/H100), when you need 10-100x faster inference than PyTorch, or for serving models with quantization (FP8/INT4), in-flight batching, and
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Optimizes LLM inference with NVIDIA TensorRT for maximum throughput and lowest latency. Use for production deployment on NVIDIA GPUs (A100/H100), when you need 10-100x faster inference than PyTorch, or for serving models with quantization (FP8/INT4), in-flight batching, and multi-GPU scaling.
How to use
- Zainstaluj TensorRT-LLM — najłatwiej przez Docker (nvidia/tensorrt_llm:latest) lub pip (pip install tensorrt_llm==1.2.0rc3). Wymagane: CUDA 13.0.0, TensorRT 10.13.2, Python 3.10–3.12. 2. Zaimportuj bibliotekę i zainicjuj model: from tensorrt_llm import LLM, SamplingParams, następnie llm = LLM(model="meta-llama/Meta-Llama-3-8B"). 3. Skonfiguruj parametry próbkowania (sampling_params) — ustaw max_tokens, temperature i top_p zgodnie z potrzebami aplikacji. 4. Przygotuj listę promptów i wywołaj llm.generate(prompts, sampling_params), aby uzyskać odpowiedzi modelu. 5. Przetwórz wyniki — każdy output zawiera atrybut .text z wygenerowanym tekstem. 6. Do wdrożenia w produkcji użyj trtllm-serve do uruchomienia serwera inference'u, który obsługuje równoczesne żądania i skalowanie na wielu GPU.