本地大模型运行Apache-2.0C++

TensorRT-LLM

NVIDIA’s library for state-of-the-art LLM inference on its GPUs.

Star 数
15.2K
Fork 数
3K
未关闭 Issue
2.1K
最近提交
2026-11-30

数据来自 GitHub API · 更新于 2026-11-30

TensorRT-LLM 是什么?

TensorRT-LLM provides optimized kernels, in-flight batching, paged KV cache, FP8/FP4 quantization and speculative decoding for NVIDIA GPUs, with a PyTorch-based LLM API and the trtllm-serve OpenAI-compatible server.

主要功能

  • Optimized attention and GEMM kernels
  • FP8/FP4/INT4 quantization
  • Multi-GPU and multi-node parallelism
  • trtllm-serve OpenAI-compatible endpoint

系统要求

平台
Linux · Docker
显卡
NVIDIA data-center or RTX GPU
备注
Linux with CUDA 12.

如何安装 TensorRT-LLM

根据项目 README 整理。开源项目更新很快,请以 GitHub 页面上的最新说明为准。

pip

  1. 1
    Install the package.
    pip3 install --upgrade pip setuptools
    pip3 install tensorrt_llm
  2. 2
    Serve a Hugging Face model.
    trtllm-serve "TinyLlama/TinyLlama-1.1B-Chat-v1.0"

优势

  • Top performance on NVIDIA hardware

不足

  • NVIDIA only
  • Complex for hobby use

TensorRT-LLM 替代品对比

软件Star 数许可证平台显存
TensorRT-LLM

NVIDIA’s library for state-of-the-art LLM inference on its GPUs.

15.2KApache-2.0—
vLLM

High-throughput LLM serving engine with PagedAttention.

97.9KApache-2.0—
SGLang

Fast serving framework for LLMs and vision-language models.

39.2KApache-2.0—
LMDeploy

Toolkit for compressing, deploying and serving LLMs and VLMs.

8.2KApache-2.0—
Ollama

Get up and running with large language models locally.

188.6KMIT—
llama.cpp

LLM inference in C/C++ — the engine behind most local AI apps.

136.7KMIT—

常见问题

TensorRT-LLM 免费吗?

是的——TensorRT-LLM 是开源软件,采用 Apache-2.0 许可证。商用前请确认软件及模型权重的许可条款。

TensorRT-LLM 支持 Windows、Mac 和 Linux 吗?

TensorRT-LLM 支持:Linux, Docker。

运行 TensorRT-LLM 需要什么配置?

NVIDIA data-center or RTX GPU

如何安装 TensorRT-LLM?

1. Install the package. 2. Serve a Hugging Face model.

TensorRT-LLM 有哪些好的替代品?

常见替代品包括 vLLM, SGLang, LMDeploy, Ollama,详见本页对比表。