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:
Model download is independent of the inference backend. The commands and URI schemes in this guide work identically for both the vLLM and SGLang container images — only the image tag changes.
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. - Collect credentials for the source you will use (for example,
NGC_API_KEY,HF_TOKEN, or cloud provider credentials). Each source section lists the required variables.
NGC
Configure NGC as a model source for NIM with the following information.
URI Format
Use the following URI format for NGC models.
Authentication
NGC uses API key authentication. NIM checks the following environment variables in order of priority:
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:
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:
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.
URI Format
Use the following URI format for local filesystem paths.
The following examples show valid local URI formats:
local:///mnt/models/llama-3.1-8b— references a model directory.local:///mnt/models/llama-3.1-8b?file=config.json— references a specific file.
Only the local:// URI scheme is supported for local filesystem access. Alternative notations (such as file:// or bare paths) are not supported.
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 work with a local model source, complete the following steps:
-
Set the required environment variable:
-
Run the command:
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/GCS bucket instead of NGC (for air-gapped environments, lower latency, or cost optimization). 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 when the manifest already contains 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 run a model from local storage in an air-gapped environment.
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.