Model Download
NIM LLM and VLM downloads model artifacts at container startup using a manifest-driven approach. The model manifest describes which files to download and where to download them from. The following model sources are supported:
Serving startup in PB7 requires a valid NGC API key whenever NIM must download
model files, including from Hugging Face, S3, Google Cloud Storage, and ModelScope.
Supply the model source credentials as well. A complete NGC or Hugging Face cache
or local model store can start offline without a key. The download-to-cache and
create-model-store commands use the model source credentials and run separately
from the serving startup check.
Prerequisites
Before you download model artifacts, complete the following prerequisites:
-
Install Docker and the NVIDIA Container Toolkit as described in Prerequisites.
-
Pull a NIM LLM and VLM container image as described in Installation.
-
Set
LOCAL_NIM_CACHEto~/.cache/nimas described in Local Cache. -
Export
NGC_API_KEYfor serving starts that download files and collect any credentials required by the source. -
Set the image references for the examples:
For examples with a model-specific image, choose a profile from
list-model-profilesas described in Model Profiles and Selection and export its ID inNIM_MODEL_PROFILE.
NGC
Configure NGC as a model source for NIM with the following information.
URI Format
Use the following URI format for NGC models.
Authentication
NIM checks these locations in order:
- A nonblank
tokenfile beside the NGC hub cache. The default token path is${NIM_CACHE_PATH}/ngc/token. If you setNGC_HOME, NIM looks fortokenin the parent directory ofNGC_HOME. - The
NGC_API_KEYstring in the JSON file atNIM_SDK_SECRETS_PATH, which defaults to/var/secrets/secrets.json. A blank string takes precedence over the environment variable. - The
NGC_API_KEYenvironment variable.
Set NGC_API_KEY when passing a key through the container environment.
NGC_CLI_API_KEY is an NGC CLI setting. The NIM runtime uses the sources above.
Both Personal API Keys (starting with nvapi-) and Legacy API Keys are supported.
Downloading from NGC
To download a model from NGC, complete the following steps:
-
Set the required environment variables:
-
Run the download command:
Downloading Behind a Corporate Proxy
To download a model from NGC behind a corporate proxy, complete the following steps:
-
Set the required environment variables:
-
Run the download command:
Hugging Face
Configure Hugging Face as a model source for NIM with the following information.
URI Format
Use the following URI format for Hugging Face models.
Authentication
Hugging Face uses a bearer token for authentication:
Additional Environment Variables
The following environment variables configure cache location and hub endpoint for Hugging Face downloads:
Hugging Face-Compatible Proxies
NIM supports Hugging Face-compatible proxy servers (such as Olah) for local caching:
Downloading from Hugging Face
To download a model from Hugging Face, complete the following steps:
-
Set the required environment variables:
-
Run the download command:
Amazon S3
Configure Amazon S3 or S3-compatible storage as a model source for NIM with the following information.
URI Format
Use the following URI format for Amazon S3 objects.
Authentication
NIM uses the standard AWS credential provider chain, which discovers credentials in the following order of precedence:
S3-Compatible Storage
To use an S3-compatible service (MinIO, Ceph, Oracle OCI, and so on), set the AWS_ENDPOINT_URL environment variable to redirect S3 API calls to your provider:
When no custom endpoint is set, NIM uses standard AWS S3 endpoints with virtual-hosted-style addressing by default. Some S3-compatible services require path-style addressing instead. The following variables control the addressing style:
NIM automatically detects Oracle OCI Object Storage endpoints and enables path-style addressing without additional configuration.
Mirroring NGC Models to S3
S3 is generic object storage without model-aware upload tools. NIM provides the mirror s3 command to copy NGC models to S3 with the correct percent-encoded keys required by NIM_REPOSITORY_OVERRIDE:
-
Set the NGC API key:
-
Run the mirror command:
Downloading from S3
To download a model from S3, complete the following steps:
-
Set the required environment variables:
-
Run the download command with the URI of your model directory:
Redirecting NGC Downloads to S3
NIM_REPOSITORY_OVERRIDE redirects NGC URIs in the manifest to your S3 bucket at runtime:
When using NIM_REPOSITORY_OVERRIDE with S3, model assets must be stored with percent-encoded keys. Use the mirror s3 command to upload models with the correct encoding.
Google Cloud Storage
Configure Google Cloud Storage as a model source for NIM with the following information.
URI Format
Use the following URI format for Google Cloud Storage objects.
Authentication
GCS uses Google’s Application Default Credentials (ADC), which discovers credentials from the following sources:
GOOGLE_APPLICATION_CREDENTIALSenvironment variable (path to a service account key file)- Vertex AI managed environment credentials
- Google Compute Engine metadata service
- Cloud Run environment
- gcloud CLI user credentials
For example, to set GOOGLE_APPLICATION_CREDENTIALS:
Mirroring NGC Models to GCS
GCS is generic object storage without model-aware upload tools. NIM provides the mirror gcs command to copy NGC models to GCS with the correct percent-encoded keys required by NIM_REPOSITORY_OVERRIDE:
Downloading from GCS
To download a model from GCS, complete the following steps:
-
Set the required environment variables:
-
Run the download command with the URI of your model directory:
Redirect NGC Downloads to GCS
To redirect NGC downloads to GCS, complete the following steps:
-
Set the required environment variables:
-
Start the container:
ModelScope
Configure ModelScope as a model source for NIM with the following information.
URI Format
Use the following URI format for ModelScope models.
ModelScope uses master as the default branch, unlike Hugging Face which uses main.
Authentication
ModelScope authentication uses the following environment variable:
ModelScope-Compatible Proxies
NIM supports custom ModelScope endpoints for local caching:
Additional Environment Variables
The following environment variables configure ModelScope-specific behavior:
Downloading from ModelScope
To download a model from ModelScope, complete the following steps:
-
Set the required environment variables:
-
Run the download command:
Local Storage
Work with models that are already available on a local filesystem with the following information.
Model Path
Mount the complete model directory and set NIM_MODEL_PATH to its absolute
path inside the container, for example /mnt/models/my-model.
How It Works
Unlike remote sources, Local Storage does not download files. Instead, it creates symlinks in the workspace pointing directly to the source files. This means:
- Zero additional disk usage.
- Near-instant setup (milliseconds for symlink creation vs. minutes or hours for network transfers).
- Source files must remain accessible for the duration of the NIM deployment.
Preparing a Local Model Store
The create-model-store command downloads a model from a remote source (such as NGC) and creates a properly formatted local model store:
Using a Local Model
To serve a local model with a model-free NIM, mount the model directory and start the container:
Serving a Fine-Tuned Checkpoint on a Model-Specific NIM
To serve a fine-tune of a model-specific NIM’s model, such as a supervised fine-tune that changes only the weights, run the model-specific image with NIM_MODEL_PATH pointing at the checkpoint. The NIM keeps its own profiles, including their tuned engine arguments, for the checkpoint’s precision, and serves them on the checkpoint’s files:
- The NIM reads the checkpoint’s precision from
config.json(including the quantization config of an llm-compressor checkpoint), and fromhf_quant_config.jsonfor ModelOpt checkpoints, and keeps only its profiles of that precision. A ModelOpt quantization algorithm counts as the weight format it names, so a variant such as weight-only NVFP4 (W4A16_NVFP4) reads as NVFP4. If the NIM has none, for example for a BF16 fine-tune of a NIM that ships only FP8 profiles, it serves generic profiles, as it does for any other model. A ModelOpt mixed-precision checkpoint counts as the precision of its lowest-bit layers, for example NVFP4 for FP8 attention with NVFP4 experts; if its layers are not listed, use a format the NIM does not read, or tie between two formats of the same width, it gets the generic profiles. Matching on the lowest-bit layers assumes the checkpoint keeps NVIDIA’s quantization layout, so a checkpoint quantized with a different layout can be matched to profiles sized for NVIDIA’s. NIM_MODEL_PATHmust point at a fine-tune of the NIM’s own model, as a local directory or a remote URI (ngc://,hf://). The NIM does not check the model architecture. For a remote URI, the generated manifest is cached underNIM_CACHE_PATHand reused on redeploy only when the same image and the sameNIM_MODEL_PATHare used, as for a model-free NIM (refer to Air-Gap Deployment).- Profile selection works as it does with NVIDIA’s weights: without
NIM_MODEL_PROFILE, the NIM picks among its own profiles for the hardware, so a model store created from a tp1 profile can start with tp4 on a larger node. Profile names and IDs are the same as with NVIDIA’s weights, so setNIM_MODEL_PROFILEto a profile’s name or ID as you would for the official model. For a model store, the ID passed tocreate-model-store -preproduces the profile the store was created from. - If the NIM loads a parser plugin, such as one set with
--reasoning-parser-plugin, keep that file from NVIDIA’s checkpoint in the fine-tune’s directory. - If the selected profile uses a separate draft model, such as EAGLE3, startup may fetch the draft from its configured source. Supply any credentials required by that source. For an offline start, stage the draft locally and configure speculative decoding to load it. See Speculative Decoding. To serve without speculative decoding, set
NIM_SPECDEC_ENABLE=0. - Run
list-model-profileswith the sameNIM_MODEL_PATHto see which profiles apply.
Configure Common Download Settings
The following environment variables apply across all model sources.
Cache Path
The following variable sets the model-asset directory inside the container:
Repository Override
NIM_REPOSITORY_OVERRIDE redirects model downloads from the default NGC source to an alternative storage location at runtime.
The following protocols are supported as override targets:
NIM_REPOSITORY_OVERRIDE supports object storage (S3/GCS) and HTTP(S) servers. It does not support model registries (hf://, modelscope://) as override targets. To use Hugging Face or ModelScope models, specify the corresponding URIs directly in the model manifest.
NIM_REPOSITORY_OVERRIDE vs NIM_MODEL_PATH
These two environment variables serve different purposes for sourcing models from cloud storage:
When to use NIM_REPOSITORY_OVERRIDE: You want to serve an NGC model but download from your own S3 or GCS bucket. For a credential-free air gap, stage the model on local storage as described in Air-Gap Deployment. Refer to Examples section.
When to use NIM_MODEL_PATH: You have a custom or fine-tuned model that was never on NGC and want to serve it directly from cloud storage. Refer to Examples section.
Disabling Model Download
The following environment variable controls model download behavior:
Proxy Support
For environments behind corporate firewalls, NIM honors the standard proxy environment variables:
If your corporate proxy performs TLS inspection (re-signing HTTPS traffic with a private CA), you
must also provide the corporate CA certificate so that TLS verification succeeds during model
downloads. Mount a combined CA bundle (default public CAs and your corporate CA) and set
SSL_CERT_FILE:
For details on creating the combined bundle and the full list of outbound TLS variables, refer to Environment Variables: Outbound TLS.
Use CLI Commands
Use the following CLI commands to download model profiles, create a local model store, or mirror models to object storage.
download-to-cache
Downloads model profiles to the NIM cache. The container downloads assets unless --use-cache is passed.
The following arguments are available:
create-model-store
Creates a properly formatted model store directory from a cached model profile.
The following arguments are available:
mirror
Mirrors model profiles from NGC to a destination object storage bucket. This command downloads profiles to the local cache and uploads them with the percent-encoded keys required by NIM_REPOSITORY_OVERRIDE.
The following arguments are available:
Examples
Use the following examples to download, mirror, and serve models from supported sources.
NGC
Use the following examples to download model profiles from NGC, including through a corporate proxy.
Basic NGC Download
Use this example to download a specific NGC model profile to the local cache.
Download Behind Corporate Proxy
Use this example to download NGC model profiles from behind a corporate proxy.
If your proxy uses a private CA for TLS inspection, add the CA bundle:
For information on how to create the combined bundle, refer to Environment Variables: Outbound TLS.
Hugging Face
Use the following examples to download model profiles from Hugging Face or by using a Hugging Face-compatible proxy.
Basic Hugging Face Download
Use this example to download a specific Hugging Face model profile to the local cache.
Using Hugging Face Proxy (Olah)
Use this example to route Hugging Face requests through an Olah proxy.
Amazon S3
Use the following examples to serve models from Amazon S3, mirror NGC models to S3, or use S3-compatible storage.
Download with NIM_REPOSITORY_OVERRIDE
Use this example to serve a model from an Amazon S3 bucket by using NIM_REPOSITORY_OVERRIDE.
Mirror NGC to S3
Use this example to mirror NGC model assets to an Amazon S3 bucket.
S3-Compatible Storage (MinIO)
Use this example to serve a model from MinIO or another S3-compatible object store.
Google Cloud Storage
Use the following examples to serve models from Google Cloud Storage, mirror NGC models to GCS, or download models by using direct GCS URIs in a manifest.
Download with NIM_REPOSITORY_OVERRIDE
Use this example to serve a model from a Google Cloud Storage bucket by using NIM_REPOSITORY_OVERRIDE.
Mirror NGC to GCS
Use this example to mirror NGC model assets to a Google Cloud Storage bucket.
Direct GCS URI in Manifest
Use this example to download a model profile from a custom manifest containing direct gs:// URIs.
Local Storage
Use the following examples to serve models from local storage, run air-gapped deployments, or create a local model store from cached assets.
Using NIM_MODEL_PATH (No Manifest)
Use this example to serve a local model directory by using NIM_MODEL_PATH without a manifest.
Air-Gapped Deployment
Use this example to start a model from local storage with container networking disabled.
Create Model Store from NGC
Use this example to create a local model store from a cached NGC model profile.
ModelScope
Use the following example to download model profiles from ModelScope.
Basic ModelScope Download
Use this example to download a specific ModelScope model profile to the local cache.
Next Steps
After the model artifacts are in cache or object storage, continue with the following:
- Model Profiles and Selection — Select the profile that matches your GPUs.
- About Model-Free NIM — Serve a custom or fine-tuned model without a model-specific image.
- Air-Gap Deployment — Transfer the cache or model store to an isolated environment.