Configuration#
This page lists launch-time environment variables. Start with the model-selection variables and keep automatic defaults unless the workload requires an override. Refer to Deployment for complete Docker commands.
Essential Configuration#
Authentication and Cache#
Name |
Default |
Use |
|---|---|---|
|
Empty |
Download required model and runtime artifacts when they are not already cached |
|
|
Set the writable in-container artifact cache |
Choose the Runtime and Model#
Name |
Default |
Use |
|---|---|---|
|
|
Select |
|
|
Select |
|
Generator: FP8 preference; Reasoner: GPU-derived preference |
Optionally pin a precision available in the image; refer to Precision Selection |
|
|
Generator only: choose |
Reasoner rejects NIM_PERF_PROFILE, including profile= in
NIM_TAGS_SELECTOR, with a startup error. Edge Reasoner has BF16 and FP8
profiles. Edge-DROID and Nano-DROID have BF16 profiles only. There is no
general-purpose Edge Generator.
The NIM chooses the best compatible profile for these settings and the visible
GPUs. A normal deployment does not need a profile ID.
GPU Selection#
The GPUs exposed by Docker --gpus are the visible GPUs that automatic
selection considers. List host GPUs with their indexes and UUIDs:
nvidia-smi -L
Expose specific GPUs instead of --gpus all, for example
--gpus '"device=0,1"' or --gpus '"device=GPU-<uuid>"'. Expose a GPU count
listed in the Generator or
Reasoner profiles. Extra GPUs sit
idle. Expose GPUs of a single model, because mixed GPUs are not
supported.
Do not pass -e CUDA_VISIBLE_DEVICES: the NIM sets it for its worker
processes, so a passed value can place work outside the intended GPUs.
Bring Your Own Checkpoint#
Name |
Default |
Use |
|---|---|---|
|
Empty |
Absolute local directory or |
|
|
Disable profile download; set automatically for a Reasoner checkpoint override, incompatible with Reasoner |
|
Empty |
Authenticate to a private Hugging Face repository named by |
To override the DFlash draft, refer to NIM_DFLASH_MODEL_PATH under
Speculative Decoding. Refer to Bring Your Own
Checkpoint for layouts, mounts, and
compatibility checks.
Server and Logging#
Name |
Default |
Use |
|---|---|---|
|
|
Set the container HTTP port |
|
|
Set the service logging threshold |
|
|
Emit JSON-line logs |
Advanced Profile Controls#
Use these only when automatic model selection is not sufficient:
Name |
Default |
Use |
|---|---|---|
|
Empty |
Filter by comma-separated exact manifest tags as |
NIM_TAGS_SELECTOR lowercases its values and accepts only the following keys:
Key |
Meaning |
Runtime |
|---|---|---|
|
Runtime, model, and precision |
Both |
|
|
Generator |
|
Offload modes |
Generator |
|
GPUs used by one NIM; the product of |
Both |
|
Data-parallel model replicas; throughput profiles use |
Generator |
|
CFG (guidance) parallel factor; latency profiles on 2 or more GPUs use |
Generator |
|
Ulysses sequence-parallel factor; latency profiles use |
Generator |
|
Tensor-parallel factor; Super BF16 also has a 2-GPU |
Reasoner |
Selectors filter the image’s existing profiles and cannot create a layout the
manifest lacks. A selection that matches no profile fails at startup. Without
them, the Generator uses as many visible GPUs as a compatible profile supports
(1, 2, 4, or 8). There is no one-GPU throughput profile, and model or layer
offload is available only on one GPU. To keep the Generator on fewer GPUs,
expose fewer GPUs with --gpus.
On an integrated GPU with unified host/device memory (NVIDIA DGX Spark/GB10, Jetson
AGX Thor), the NIM treats 70% of the shared pool as GPU memory for profile
floors and as the default Reasoner NIM_GPU_MEMORY_UTILIZATION.
A selector variable, such as NIM_MODEL_VARIANT or NIM_PRECISION, that
conflicts with NIM_TAGS_SELECTOR is a startup error. Use the model_variant tag to filter by model. Exact tags and profile
IDs are tied to an image release. For the offload, memory-headroom, and
profile-pin variables, refer to Advanced Settings.
Generator Configuration#
Input and Output#
Name |
Default |
Use |
|---|---|---|
|
|
Allow HTTP(S) image, video, and Transfer inputs; set |
|
30 minutes ( |
Set the queue-plus-execution timeout in microseconds |
Client HTTP timeouts do not change this backend ceiling. Refer to Long-Running Requests.
Startup and Execution#
Name |
Default |
Use |
|---|---|---|
|
|
Run synthetic inference before readiness at the |
Guardrails#
Name |
Default |
Use |
|---|---|---|
|
|
Enable input-prompt policy checks |
|
|
Enable output image/video face and visual guardrails |
|
|
Enable the output-frame safety classifier |
|
|
Set the text guardrail’s maximum input tokens; minimum 512 |
The selected profile owns guardrail residency. Choose it with the
text_guard_offload and video_guard_offload selector keys under
Advanced Profile Controls. Refer to
Guardrails for what each layer does.
Diffusion Cache, Attention, and VAE Decode#
These performance defaults are validated startup settings, not request fields.
If you notice a quality issue in a specific workload, try
NIM_CACHE_BACKEND=none and NIM_VAE_FAST_PATH=lossless.
The defaults work as follows:
SeaCache reuses transformer results across denoising steps. It is on for every Generator variant except
edge-droid. SetNIM_CACHE_BACKENDtosea_cacheornoneto change that.NIM_CACHE_CONFIGoverrides individual fields as JSON, for example-e NIM_CACHE_CONFIG='{"sea_threshold": 0.20, "sea_max_consecutive_cached": 1}'. The defaults aresea_threshold=0.25,sea_residual_order=1,sea_max_consecutive_cached=2, andsea_power_exp=3.0. Settingsea_max_consecutive_cached=0means no limit. Startup logs the effective settings.SageAttention 2.2 is the default on compute capability 8.0 through 9.x unless the profile uses sequence parallelism. NVIDIA Blackwell GPUs and sequence-parallel profiles use automatic selection.
DIFFUSION_ATTENTION_BACKENDoverrides the default.Variational autoencoder (VAE) decode defaults to
NIM_VAE_FAST_PATH=channels_last, the fastest path. Thelosslessvalue keeps the reference decoder output, andoffuses the reference decoder. On a replica spanning several GPUs, decode is sharded (NIM_ENABLE_VAE_PARALLELISM). Disabling it can raise per-GPU memory. A largerNIM_VAE_SPATIAL_TEMPORAL_CHUNK_SIZEraises peak memory and can change rounding.
Prompt Upsampling#
Prompt upsampling is optional and applies only to Generator text-to-image (T2I), text-to-video (T2V), and image-to-video (I2V) requests. It sends the request to an operator-provided OpenAI-compatible endpoint.
Name |
Default |
Use |
|---|---|---|
|
|
Enable prompt upsampling |
|
Empty |
Set the OpenAI-compatible endpoint base or Chat Completions route |
|
Empty |
Set the external model name |
|
Empty |
Set the external Bearer credential |
|
|
Set the external call timeout in seconds |
|
|
Select |
Endpoint, model, and key are required when the feature is enabled. A request-time external failure logs a warning and continues with the original prompt.
Reasoner Configuration#
Change controls one at a time and measure the effect.
Optimization Presets#
Name |
Default |
Use |
|---|---|---|
|
Unset |
Reasoner only: apply the experimental |
The presets configure these variables:
Preset |
|
|
|
|---|---|---|---|
|
|
|
Unchanged ( |
|
|
|
|
On profiles with tensor parallelism above 1, both presets also set
NIM_MM_ENCODER_TP_MODE=data, which replicates the vision encoder and splits
media across TP ranks. An explicitly set variable wins over the preset. On
Edge, set NIM_USE_DFLASH=0 with TPOT.
Speculative Decoding#
Name |
Default |
Use |
|---|---|---|
|
|
Use the bundled Nano or Super DFlash draft; set |
|
Empty |
Nano or Super Reasoner: use an independent absolute local DFlash directory containing |
DFlash is on by default for Nano and Super Reasoner and does not change the
request API. Set NIM_USE_DFLASH=0 to disable it (Generator rejects an
explicit enable). Edge Reasoner does not support DFlash in this version. It
defaults to NIM_USE_DFLASH=0 and rejects 1. For Edge, set
NIM_STREAMING_SPEC_METHOD=none when streaming
is enabled.
NIM_DFLASH_MODEL_PATH accepts only an absolute local path, not hf://, and
NIM_DFLASH_CONFIG requires DFlash enabled and cannot set the method or
model keys.
Context and Scheduling#
Name |
Default |
Use |
|---|---|---|
|
|
Let the runtime choose a context length, bounded by the checkpoint limit of 262,144 tokens |
|
Discrete GPU: |
Set the Reasoner GPU-memory target in |
Caching and Multimodal Processing#
Name |
Default |
Use |
|---|---|---|
|
Unset |
Optionally set a nonnegative image limit; when unset, do not override the runtime limit |
|
Unset |
Optionally set a nonnegative video limit; when unset, do not override the runtime limit |
Prefer request-level media_io_kwargs over the operator-wide
NIM_MEDIA_IO_KWARGS. Unchunked multimodal input, the default, can raise peak
GPU memory. Set NIM_DISABLE_CHUNKED_MM_INPUT=0 only after measuring memory,
latency, and throughput.
Streaming Video Sessions#
Set NIM_MODEL_TYPE=reasoner and NIM_ENABLE_STREAMING=true to enable the
WebSocket and REST session APIs in standalone NIM. In Dynamo mode,
only REST sessions are supported. Changing these settings requires restarting
the service with the new environment. Ordinary Chat Completions token streaming
uses the request field stream=true and does not require this enable flag.
Name |
Default |
Use |
|---|---|---|
|
|
Enable stateful video-frame sessions and apply the required engine settings |
|
|
Maximum concurrent sessions shared by WebSocket and REST; integer, minimum 1 |
|
|
Default retained frame window per session; integer, minimum 1 |
|
|
Idle timeout for WebSocket sessions, in seconds; must be greater than 0 |
|
|
Idle timeout for REST sessions, in seconds; must be greater than 0 |
Streaming forces the multimodal processor cache off and disables asynchronous
scheduling. It raises the engine’s image budget to at least
2 Ă— NIM_STREAMING_MAX_SESSIONS Ă— NIM_STREAMING_MAX_VIDEO_SEGMENTS, or 32 image
slots with the defaults. This floor can override a lower
NIM_MAX_IMAGES_PER_PROMPT. Increasing either streaming limit increases
encoder-cache memory requirements. Reduce the limits if startup lacks memory,
and validate representative requests before increasing concurrency. These
engine changes also affect ordinary requests on the same container.
Accepted frames refresh session activity. A frame in flight is not reaped.
WebSocket disconnects release the session, while REST clients should explicitly
delete it rather than rely on the shorter idle timeout. Increase the relevant
timeout for feeds with long pauses. Per-session retention and sampling
belong in the creation request. Retention overrides remain subject to shared
capacity and model-context admission checks.
Advanced Streaming Controls#
Leave these at their defaults unless diagnosing or tuning a measured workload:
Name |
Default |
Use |
|---|---|---|
|
|
Select |
|
|
Number of proposed n-gram tokens; an integer of at least 1, and invalid values fail startup when streaming is enabled |
|
Unset |
Set |
The speculation controls apply only when streaming is enabled. For Edge, which
has no DFlash, set NIM_STREAMING_SPEC_METHOD=none
explicitly. While streaming is enabled, NIM_USE_DFLASH is ignored, so set
NIM_STREAMING_SPEC_METHOD=none to turn speculation off. Both V1 and V2 model runners support the
streaming path, so pinning V1 is not required for normal operation.
Inspect GET /v1/streaming/config for the served model and default retention
and sampling policy. Standalone NIM and the Dynamo streaming adapter expose
this route. Refer to Streaming for session requests and error handling,
and Dynamo REST Streaming
for the client’s shared-frontend checks, which require no worker URLs or metadata.
API Behavior#
Name |
Default |
Use |
|---|---|---|
|
|
Keep Reasoner request bodies out of logs |
|
|
Remove Responses routes when set to |
Dynamo Configuration#
Run NIM as a Dynamo Worker#
Use the Cosmos3 NIM image (nvcr.io/nim/nvidia/cosmos3:2.1.0) and start
/opt/nim/start_server.sh with NIM_MODEL_TYPE=reasoner and
NIM_DYNAMO_WORKER=true. Generator profiles do not support Dynamo worker mode.
The NIM selects and loads the model, launches a Dynamo vLLM worker and a private
frontend, and exposes the NIM HTTP API. Keep the usual model-selection,
cache, and authentication settings from Essential Configuration.
The shared frontend is a separate service. It does not need worker enablement
or a GPU.
Name |
Default |
Use |
|---|---|---|
|
|
Launch the Reasoner as a Dynamo worker instead of the standalone Reasoner runtime |
|
|
Set worker and private-frontend discovery; use |
|
From the |
Let the private frontend discover operator-suffixed worker namespaces; takes precedence over the exact |
|
|
Control worker asynchronous scheduling; streaming forces this off |
|
|
Enable Dynamo multimodal handling for image/video requests |
|
Empty object |
Advanced Dynamo worker CLI overrides as a JSON object; use underscore keys such as |
|
|
Private frontend’s loopback HTTP port; integer from 1 through 65535, different from |
|
|
NIM proxy request timeout in seconds; persistent session operations use the separate streaming timeout below |
|
Empty additions |
Comma- or whitespace-separated extra request headers to forward through the NIM proxy; built-in tracing, affinity, worker-routing, and tenant headers remain enabled |
Argument precedence is defaults, then NIM_DISCOVERY_BACKEND (including its
legacy JSON fields), then the individual scheduling/multimodal variables, then
NIM_DYNAMO_ARGS. Streaming engine constraints are applied last and cannot be
overridden by these arguments. The supplied YAML files use the legacy JSON form:
# Regular Dynamo
NIM_DISCOVERY_BACKEND={"async_scheduling":true,"discovery_backend":"kubernetes","enable_multimodal":true}
# Dynamo with REST streaming
NIM_DISCOVERY_BACKEND={"async_scheduling":false,"discovery_backend":"kubernetes","enable_multimodal":true}
Dynamo Streaming#
Set NIM_ENABLE_STREAMING=1 alongside NIM_DYNAMO_WORKER=true on workers.
Use the same NIM image for the shared frontend, running
/opt/nim/.venv/bin/python -m streaming.dynamo.frontend from /opt/nim.
The stock python3 -m dynamo.frontend command does not serve video-session routes.
The NIM worker selects its private streaming frontend automatically.
Name |
Default |
Use |
|---|---|---|
|
Derived |
Set the same explicit RPC endpoint on the shared frontend and workers. The YAML uses |
|
|
Bound each REST session create, frame, or delete operation, including upload and inference, in seconds; positive finite number. Set on the shared frontend and workers |
|
|
Streaming adapter listener defaults; explicit |
|
Unset |
Optional certificate and key paths for TLS on the streaming adapter; set both together, or use |
The adapter’s --streaming-endpoint flag overrides its environment endpoint.
Keep it aligned with the workers. Use aggregated workers with a local encoder.
Disaggregated prefill/decode and remote encoders are unsupported. The
streaming capacity, retention, idle-timeout, and engine controls
also apply. Streaming forces synchronous scheduling and disables the multimodal
processor cache. The request timeout above is separate from
NIM_STREAMING_REST_IDLE_TIMEOUT_S, which expires inactive sessions. REST session
ownership does not depend on the Chat Completions affinity TTL.
WebSocket (/v1/streaming/ws) is unsupported in Dynamo mode, on both shared
frontend and worker NIM endpoints. The streaming adapter and enabled worker NIM
proxy expose GET /v1/streaming/config and the REST session routes. The stock
dynamo.frontend launcher does not attach these streaming routes.
Refer to Dynamo With Streaming for the manifest
and REST request examples.
Advanced Settings#
Leave these at their defaults unless you have measured a need.
Name |
Runtime |
Default |
Use |
|---|---|---|---|
|
Generator |
Automatic |
Request |
|
Reasoner |
|
Free binary GiB reserved per discrete GPU for selection and sizing; lowering it raises OOM risk |
|
Both |
Empty |
Pin an exact profile ID from the current image |
|
Generator |
|
VP9 output quality 1–9; affects encoding, not diffusion |
|
Generator |
|
Enable the compilation path |
|
Generator |
Edge-DROID: |
Diffusion cache: |
|
Generator |
Empty object |
Override individual diffusion-cache settings as JSON; rejected when the backend is |
|
Generator |
|
Override the diffusion attention backend |
|
Generator |
|
VAE decode path: |
|
Generator |
|
Shard VAE decode spatially across the replica’s GPUs |
|
Generator |
Automatic |
Positive number of latent frames per sharded VAE decode chunk |
|
Both |
FP8 on DGX Spark or Jetson AGX Thor: |
|
|
Generator |
|
Backend log verbosity for diagnosis |
|
Generator |
|
Startup prompt-token sequence length |
|
Generator |
|
Bypass Transfer’s VRAM admission check for an approved diagnostic; can fail with OOM |
|
Reasoner |
|
BF16 DFlash KV cache; can improve acceptance but uses more memory |
|
Reasoner |
Empty object |
Extra vLLM DFlash speculative-config fields as JSON |
|
Reasoner |
|
Scheduler token budget; unchunked multimodal input enforces at least |
|
Reasoner |
|
Maximum scheduled sequences |
|
Reasoner |
|
Prefix/KV-cache reuse |
|
Reasoner |
|
Chunked prefill |
|
Reasoner |
|
Require one whole multimodal item per scheduler iteration |
|
Reasoner |
|
Disable the multimodal preprocessor cache |
|
Reasoner |
Video backend |
Replace the whole operator-level media I/O JSON object |
|
Reasoner |
Unset |
Operator-level multimodal processor options as a JSON object |
|
Reasoner |
|
Video-token pruning from 0 through 1; |
|
Reasoner |
|
|
|
Reasoner |
|
Structured-output backend |
Secret Handling#
Inject NGC_API_KEY, HF_TOKEN, and NIM_PROMPT_UPSAMPLING_API_KEY as
separate secrets through the deployment environment, never through source
control, model-source URIs, image layers, requests, notebooks, or logs.