Skip to main content

CLI Reference

Building and native execution use separate entry points. The Python module builds bundles; the trtmc executable inspects and runs them.

Build a bundle

python -m tensorrt_model_connect build MODEL -o OUTPUT.bundle [OPTIONS]

MODEL is a Hugging Face model ID or a local snapshot directory. --output is required. A remote model is downloaded at --revision when supplied. The resolver reads root model metadata and requires exactly one dependency-free families/*/support.py to claim it. It then imports only the selected family's model.py and calls build(request, writer) once.

Build options

OptionContract
-o, --output PATHRequired output bundle path.
--task TASKOverride the family-owned default with another task declared by that family.
--revision REVISIONHugging Face revision used for snapshot download.
--precision fp16|bf16|fp32Requested build precision; default is fp32. The family must support or reject it.
--backend trt|trt_rtxBundle backend identity; default is trt.
--max-sequence-length NOptional family-consumed sequence bound.
--image-height N, --image-width NOptional image build dimensions.
--video-num-frames NOptional video frame count.
--max-batch-size NMaximum build batch; default is 1.
--tensor-parallel-size NRequested TP size; default is 1.
--context-parallel-size NRequested CP size; default is 1.
--quantization NAMEFamily-owned quantization selection.
--fp32-layer INDEXKeep one family-local layer in FP32; repeatable.
--dynamic-kv-cacheRequest the direct dynamic-KV build path from a compatible family.
--verboseEnable verbose family/TensorRT build output.

There are no compatibility aliases, configuration registries, graph-selection subcommands, automatic fallbacks, or default output-name derivation. An unsupported request fails in its owning family.

Inspect a bundle

trtmc inspect MODEL.bundle
trtmc version

inspect accepts exactly one path and prints the format, family, task, backend, and section bounds. Family-owned section payloads are not decoded.

Run a bundle

Every execution command has this shape:

trtmc COMMAND MODEL.bundle --runtime-root DIR [OPTIONS]

--runtime-root is always required. It must contain the matching libtrtmc_core.so, libtrtmc_runtime.so, backend DSO, and selected family DSO. The CLI never searches the current directory, environment variables, or an installed fallback. Common load options are:

OptionContract
--runtime-root DIRRequired exact DSO root.
--kv-cache-size BYTES|GB|GiBRuntime-sized KV capacity for a compatible bundle.
--runtime-cache PATHTensorRT-RTX cache path; rejected by the standard TensorRT backend.
--cuda-graphsEnable TensorRT-RTX CUDA graphs; rejected by the standard backend.
--byok-library DSO, --byok-function NAME, --byok-name NAMELoad one TVM-FFI BYOK binding. All three are required together.

Task commands

TaskCommand and primary inputs
Text or vision-language generationrun with --prompt, and optional --image
Encoding and embeddingencode --text TEXT, embed --text TEXT
Rerankingrerank --query TEXT --document TEXT
Classification and featuresclassify --image PATH, extract-features --image PATH
Stereo and geometrydisparity --left PATH --right PATH, geometry --image PATH --output DIR
Segmentationsegment --image PATH, segment-prompted --image PATH with text or point prompt, video-segment --frame PATH --prompt TEXT
Audiogenerate-audio --prompt TEXT --output PATH, speak --input WAV --output WAV, speech-session --input WAV
Transcriptiontranscribe --input WAV, repeatable-input transcribe-batch, or transcribe-streaming --input WAV
Image and video generationgenerate-image, generate-image-batch, or generate-video, each with the command-specific prompt/output options
Numeric taskssolve --branch F32 [--trunk F32], forecast --input F32 [--mask F32]
Robotics and world modelscontrol --image PATH --state F32, generate-world --prompt TEXT --image PATH --output DIR

F32 inputs are raw binary float32 files. Media inputs are decoded by private CLI code under apps/cli/; these file formats are not part of the C++ Task API.

Text generation options

run accepts --max-new-tokens, --temperature, --top-k, --top-p, --min-p, --seed, --repetition-penalty, --use-chat-template true|false, --enable-thinking true|false, source/forced language token IDs, family-owned text-diffusion replay inputs, and a paired --lora-adapter / --lora-adapter-id. The loaded family decides which values it supports.

trtmc run qwen.bundle \
--runtime-root /opt/trtmc/lib \
--prompt "Hello" \
--max-new-tokens 32 \
--temperature 0 \
--use-chat-template true \
--enable-thinking false

Transcription and generation options

Offline transcription accepts language/translation fields, beam size, length penalty, punctuation, timestamps, input-duration limits, and segmented decode controls. Streaming transcription instead accepts chunk size, attention contexts, language, and a new-token bound.

Image/video generation accepts negative prompt, height, width, steps, seed, guidance/CFG scale, and optional initial float32 latents. Audio generation and speech commands expose only the options listed by their Task contracts in apps/cli/cli.cpp.

Unknown commands, unknown command-specific options, duplicate options, task interface mismatches, invalid values, and missing DSOs fail with a nonzero exit status. Run trtmc help for the compiled executable's concise synopsis and python -m tensorrt_model_connect build --help for the exact build parser.