Skip to main content

TensorRT-LLM Engine Schema

Engine version: 1.2.1
Discovered at: 2026-07-13T00:00:00+00:00
Discovery method: TorchLlmArgs+TrtLlmArgs.model_json_schema() union with per-field backends + dataclasses.fields(SamplingParams)
Schema version: 1.0.0

Summary: 95 engine parameters, 48 sampling parameters.

Discovery limitations

  • engine_params - BuildConfig is not a Pydantic model; appears as Optional[object] in the schema Affected fields: build_config
  • engine_params - shared field: TorchLlmArgs and TrtLlmArgs disagree on type/default/description; the trt (TrtLlmArgs) spec is recorded and the field is tagged applicable to both backends Affected fields: load_format
  • sampling_params - SamplingParams is a dataclass; no per-field descriptions

Engine Parameters

FieldTypeDefaultBackendsDescription
modelstring-pytorch, trtThe path to the model checkpoint or the model name from the Hugging Face Hub.
tokenizer`stringNone`-pytorch, trt
tokenizer_modeLiteral['auto', 'slow']autopytorch, trtThe mode to initialize the tokenizer.
custom_tokenizer`stringNone`-pytorch, trt
skip_tokenizer_initbooleanfalsepytorch, trtWhether to skip the tokenizer initialization.
trust_remote_codebooleanfalsepytorch, trtWhether to trust the remote code.
tensor_parallel_sizeinteger1pytorch, trtThe tensor parallel size.
dtypestringautopytorch, trtThe data type to use for the model.
revision`stringNone`-pytorch, trt
tokenizer_revision`stringNone`-pytorch, trt
pipeline_parallel_sizeinteger1pytorch, trtThe pipeline parallel size.
context_parallel_sizeinteger1pytorch, trtThe context parallel size.
gpus_per_node`integerNone`-pytorch, trt
moe_cluster_parallel_size`integerNone`-pytorch, trt
moe_tensor_parallel_size`integerNone`-pytorch, trt
moe_expert_parallel_size`integerNone`-pytorch, trt
enable_attention_dpbooleanfalsepytorch, trtEnable attention data parallel.
enable_lm_head_tp_in_adpbooleanfalsepytorch, trtEnable LM head TP in attention dp.
pp_partition`arrayNone`-pytorch, trt
cp_config`objectNone`-pytorch, trt
load_formatLiteral['auto', 'dummy']autopytorch, trtThe format to load the model.
fail_fast_on_attention_window_too_largebooleanfalsepytorch, trtFail fast when attention window is too large to fit even a single sequence in the KV cache.
enable_lorabooleanfalsepytorch, trtEnable LoRA.
lora_config`LoraConfigNone`-pytorch, trt
kv_cache_configKvCacheConfig-pytorch, trtKV cache config.
enable_chunked_prefillbooleanfalsepytorch, trtEnable chunked prefill.
guided_decoding_backend`stringNone`-pytorch, trt
batched_logits_processorOptional[tensorrt_llm.sampling_params.BatchedLogitsProcessor]-pytorch, trtBatched logits processor.
iter_stats_max_iterations`integerNone`-pytorch, trt
request_stats_max_iterations`integerNone`-pytorch, trt
peft_cache_config`PeftCacheConfigNone`-pytorch, trt
scheduler_configSchedulerConfig-pytorch, trtScheduler config.
cache_transceiver_config`CacheTransceiverConfigNone`-pytorch, trt
sparse_attention_config`RocketSparseAttentionConfigDeepSeekSparseAttentionConfigSkipSoftmaxAttentionConfigNone`
speculative_config`DraftTargetDecodingConfigEagleDecodingConfigLookaheadDecodingConfigMedusaDecodingConfig
max_batch_size`integerNone`-pytorch, trt
max_input_len`integerNone`-pytorch, trt
max_seq_len`integerNone`-pytorch, trt
max_beam_width`integerNone`-pytorch, trt
max_num_tokens`integerNone`8192pytorch, trt
gather_generation_logitsbooleanfalsepytorch, trtGather generation logits.
num_postprocess_workersinteger0pytorch, trtThe number of processes used for postprocessing the generated tokens, including detokenization.
postprocess_tokenizer_dir`stringNone`-pytorch, trt
reasoning_parser`stringNone`-pytorch, trt
⚠️ decoding_configOptional[tensorrt_llm.llmapi.llm_args.DecodingConfig]-pytorch, trtThe decoding config.
otlp_traces_endpoint`stringNone`-pytorch, trt
backend`stringNone`-pytorch, trt
return_perf_metricsbooleanfalsepytorch, trtReturn perf metrics.
orchestrator_type`stringNone`-pytorch, trt
env_overrides`objectNone`-pytorch, trt
enable_tqdmbooleanfalsetrtEnable tqdm for progress bar.
workspace`stringNone`-trt
enable_build_cacheUnion[tensorrt_llm.llmapi.build_cache.BuildCacheConfig, bool]falsetrtEnable build cache.
extended_runtime_perf_knob_config`ExtendedRuntimePerfKnobConfigNone`-trt
calib_config`CalibConfigNone`-trt
quant_config`QuantConfigNone`-trt
embedding_parallel_modestringSHARDING_ALONG_VOCABtrtThe embedding parallel mode.
fast_buildbooleanfalsetrtEnable fast build.
build_config`BuildConfigNone`-trt
enable_prompt_adapterbooleanfalsetrtEnable prompt adapter.
max_prompt_adapter_tokeninteger0trtThe maximum number of prompt adapter tokens.
batching_type`BatchingTypeNone`-trt
normalize_log_probsbooleanfalsetrtNormalize log probabilities.
garbage_collection_gen0_thresholdinteger20000pytorchThreshold for Python garbage collection of generation 0 objects.Lower values trigger more frequent garbage collection.
cuda_graph_config`CudaGraphConfigNone`-pytorch
attention_dp_config`AttentionDpConfigNone`-pytorch
disable_overlap_schedulerbooleanfalsepytorchDisable the overlap scheduler.
moe_configMoeConfig-pytorchMoE config.
nvfp4_gemm_configNvfp4GemmConfig-pytorchNVFP4 GEMM backend config.
attn_backendstringTRTLLMpytorchAttention backend to use.
sampler_type`stringSamplerType`autopytorch
sampler_force_async_workerbooleanfalsepytorchForce usage of the async worker in the sampler for D2H copies, even if confidential compute is not active. Normally, the async worker should only be used when confidential compute is active. This argument is provided to enable it for testing purposes, irrespective of confidential compute state.
enable_iter_perf_statsbooleanfalsepytorchEnable iteration performance statistics.
enable_iter_req_statsbooleanfalsepytorchIf true, enables per request stats per iteration. Must also set enable_iter_perf_stats to true to get request stats.
print_iter_logbooleanfalsepytorchPrint iteration logs.
perf_metrics_max_requestsinteger0pytorchThe maximum number of requests for perf metrics. Must also set request_perf_metrics to true to get perf metrics.
batch_wait_timeout_msnumber0pytorchIf greater than 0, the request queue might wait up to batch_wait_timeout_ms to receive max_batch_size requests, if fewer than max_batch_size requests are currently available. If 0, no waiting occurs.
batch_wait_timeout_itersinteger0pytorchMaximum number of iterations the scheduler will wait to accumulate new coming requests for improved GPU utilization efficiency. If greater than 0, the scheduler will delay batch processing to gather more requests up to the specified iteration limit. If 0, disables timeout-iters-based batching delays.
batch_wait_max_tokens_rationumber0pytorchToken accumulation threshold ratio for batch scheduling optimization. If greater than 0, the scheduler will accumulate requests locally until the total token count reaches batch_wait_max_tokens_ratio * max_num_tokens. This mechanism enhances GPU utilization efficiency by ensuring adequate batch sizes.If 0 disables token-based batching delays.
torch_compile_config`TorchCompileConfigNone`-pytorch
enable_autotunerbooleantruepytorchEnable autotuner for all tunable ops. This flag is for debugging purposes only, and the performance may significantly degrade if set to false.
enable_layerwise_nvtx_markerbooleanfalsepytorchIf true, enable layerwise nvtx marker.
enable_min_latencybooleanfalsepytorchIf true, enable min-latency mode. Currently only used for Llama4.
stream_intervalinteger1pytorchThe iteration interval to create responses under the streaming mode. Set this to a larger value when the batch size is large, which helps reduce the streaming overhead.
force_dynamic_quantizationbooleanfalsepytorchIf true, force dynamic quantization. Defaults to False.
allreduce_strategy`stringNone`AUTOpytorch
checkpoint_loaderOptional[tensorrt_llm._torch.models.checkpoints.BaseCheckpointLoader]-pytorchThe checkpoint loader to use for this LLM instance. You may use a custom checkpoint loader by subclassing BaseCheckpointLoader and providing an instance of the subclass here to load weights from a custom checkpoint format. If neither checkpoint_format nor checkpoint_loader are provided, checkpoint_format will be set to HF and the default HfCheckpointLoader will be used. If checkpoint_format and checkpoint_loader are both provided, checkpoint_loader will be ignored.
checkpoint_format`stringNone`-pytorch
kv_connector_config`KvCacheConnectorConfigNone`-pytorch
mm_encoder_onlybooleanfalsepytorchOnly load/execute the vision encoder part of the full model. Defaults to False.
ray_worker_extension_cls`stringNone`-pytorch
ray_placement_config`RayPlacementConfigNone`-pytorch
enable_sleepbooleanfalsepytorchEnable LLM sleep feature. Sleep feature requires extra setup that may slowdown model loading.Only enable it if you intend to use this feature.
disable_flashinfer_samplingbooleanfalsepytorchDisable the use of FlashInfer.sampling. This option is likely to be removed in the future.
max_stats_leninteger1000pytorchThe max number of performance statistic entries.

Sampling Parameters

FieldTypeDefaultDescription
end_id`intNone`-
pad_id`intNone`-
max_tokensint32
bad`strlist[str]None`
bad_token_ids`list[int]None`-
stop`strlist[str]None`
stop_token_ids`list[int]None`-
include_stop_str_in_outputboolfalse
embedding_bias`TensorNone`-
logits_processor`LogitsProcessorlist[LogitsProcessor]None`
apply_batched_logits_processorboolfalse
nint1
best_of`intNone`-
use_beam_searchboolfalse
top_k`intNone`-
top_p`floatNone`-
top_p_min`floatNone`-
top_p_reset_ids`intNone`-
top_p_decay`floatNone`-
seed`intNone`-
temperature`floatNone`-
min_tokens`intNone`-
beam_search_diversity_rate`floatNone`-
repetition_penalty`floatNone`-
presence_penalty`floatNone`-
frequency_penalty`floatNone`-
prompt_ignore_length`intNone`-
length_penalty`floatNone`-
early_stopping`intNone`-
no_repeat_ngram_size`intNone`-
min_p`floatNone`-
beam_width_array`list[int]None`-
logprobs`intNone`-
prompt_logprobs`intNone`-
return_context_logitsboolfalse
return_generation_logitsboolfalse
exclude_input_from_outputbooltrue
return_encoder_outputboolfalse
return_perf_metricsboolfalse
additional_model_outputs`list[str]None`-
lookahead_config`LookaheadDecodingConfigNone`-
guided_decoding`GuidedDecodingParamsNone`-
ignore_eosboolfalse
detokenizebooltrue
add_special_tokensbooltrue
truncate_prompt_tokens`intNone`-
skip_special_tokensbooltrue
spaces_between_special_tokensbooltrue