trtedge CLI#
trtedge is the command-line interface (CLI) for chat, HTTP serving, engine
building, ONNX export, and model preparation.
trtedge COMMAND [OPTIONS]
Complete Installation and activate your Python environment
before using trtedge. For a first run, follow Quick Start.
Flag spelling#
Use hyphenated long options, such as --max-input-len and --model-dir.
The standalone C++ tools also accept their existing camelCase spellings
(for example, llm_build --maxInputLen), and Python model-preparation commands
retain underscore aliases (for example, trtedge quantize llm --model_dir).
Existing scripts can continue using those spellings. Configuration-file keys
and Python API parameter names are unchanged.
Commands#
The recommended installation includes [server] for chat and HTTP serving.
ONNX export requires [export], and quantization requires [tools].
See Optional Python dependencies
to add these extras to your environment.
Command |
Purpose |
Guide |
|---|---|---|
|
Interactive or one-shot text chat |
|
|
Launch an OpenAI-compatible HTTP server |
|
|
Build engines directly from a checkpoint |
|
|
Export checkpoint components to ONNX |
|
|
Quantize an LLM or draft checkpoint |
|
|
Insert LoRA patterns into ONNX |
|
|
Process LoRA adapter weights |
|
|
Merge a LoRA adapter into a checkpoint |
|
|
Generate reduced-vocabulary artifacts |
Examples#
Chat with a model#
Start an interactive conversation with a Hugging Face model or a local checkpoint:
trtedge chat Qwen/Qwen3.5-0.8B
trtedge chat /path/to/checkpoint
To run one prompt:
trtedge chat Qwen/Qwen3.5-0.8B --prompt "Explain CUDA streams briefly."
Chat and serving build and cache TensorRT engines on first use. Subsequent launches reuse matching cached engines.
Launch a server#
trtedge serve Qwen/Qwen3.5-0.8B --port 8000
See the server guide for HTTP requests, speculative decoding, and runtime options.
Build engines or export ONNX#
Build TensorRT engines directly from a local checkpoint:
trtedge build --model-dir /path/to/checkpoint --engine-dir /path/to/engines
Export ONNX for the component-specific C++ builders:
trtedge export /path/to/checkpoint /path/to/onnx-output
Quantize a checkpoint#
trtedge quantize llm --model-dir /path/to/checkpoint \
--output-dir /path/to/quantized --quantization fp8
Choose a quantization format supported by your model and target device; see Quantization.
Help and version#
trtedge --help
trtedge chat --help
trtedge --version
Use trtedge COMMAND --help for command arguments and options.
Standalone command names#
You can also use the following standalone commands. Each accepts the same
arguments and options as its corresponding trtedge subcommand.
|
Standalone command |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|