> This page is for version 2.1.5-pb7.
> For other versions, use one of these documentation indexes:
> - 2.1.7 (Latest) (default): https://docs.nvidia.com/nim/large-language-models/2.1.7/llms.txt
> - 2.1.6: https://docs.nvidia.com/nim/large-language-models/2.1.6/llms.txt
> - 2.1.5-pb7: https://docs.nvidia.com/nim/large-language-models/2.1.5-pb7/llms.txt
> - 2.1.5: https://docs.nvidia.com/nim/large-language-models/2.1.5/llms.txt
> - 2.1.4: https://docs.nvidia.com/nim/large-language-models/2.1.4/llms.txt
> - 2.0.13: https://docs.nvidia.com/nim/large-language-models/2.0.13/llms.txt
> - 2.0.12: https://docs.nvidia.com/nim/large-language-models/2.0.12/llms.txt
> - 2.0.11: https://docs.nvidia.com/nim/large-language-models/2.0.11/llms.txt
> - 2.0.10: https://docs.nvidia.com/nim/large-language-models/2.0.10/llms.txt
> - 2.0.4-pb6: https://docs.nvidia.com/nim/large-language-models/2.0.4-pb6/llms.txt
> - Archive: https://docs.nvidia.com/nim/large-language-models/archive/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/large-language-models/llms.txt.

# Model Download

> Learn how NIM for LLMs downloads model artifacts from NGC or Hugging Face at container startup using a manifest-driven cache.

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.

| Source                                        | URI Scheme              |
| --------------------------------------------- | ----------------------- |
| [NGC](#ngc)                                   | `ngc://`                |
| [Hugging Face](#hugging-face)                 | `hf://`                 |
| [Amazon S3](#amazon-s3)                       | `s3://`                 |
| [Google Cloud Storage](#google-cloud-storage) | `gs://`                 |
| [ModelScope](#modelscope)                     | `modelscope://`         |
| [Local Storage](#local-storage)               | Absolute directory path |

## Prerequisites

Before you download model artifacts, complete the following prerequisites:

1. Install Docker and the NVIDIA Container Toolkit as described in [Prerequisites](/nim/large-language-models/2.1.5-pb7/get-started/prerequisites).
2. Pull a NIM LLM and VLM container image as described in [Installation](/nim/large-language-models/2.1.5-pb7/get-started/installation).
3. Set `LOCAL_NIM_CACHE` to `~/.cache/nim` as described in [Local Cache](/nim/large-language-models/2.1.5-pb7/get-started/configuration#configure-local-cache).
4. Export `NGC_API_KEY` for serving starts that download files and collect any
   credentials required by the source.
5. Set the image references for the examples:

   ```bash
   export NIM_LLM_MODEL_SPECIFIC_IMAGE="nvcr.io/nim/nvidia/nemotron-3.5-lightning-30b-a3b-pb7:2.1.5-pb7.0"
   export NIM_LLM_MODEL_FREE_IMAGE="nvcr.io/nim/nvidia/model-free-nim-pb7:2.1.5-pb7.0"
   ```

   For examples with a model-specific image, choose a profile from
   `list-model-profiles` as described in [Model Profiles and Selection](/nim/large-language-models/2.1.5-pb7/deployment/model-profiles-and-selection) and
   export its ID in `NIM_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.

```text
ngc://{org}/{team}/{model}:{version}?file={filename}
```

### Authentication

NIM checks these locations in order:

1. A nonblank `token` file beside the NGC hub cache. The default token path is
   `${NIM_CACHE_PATH}/ngc/token`. If you set `NGC_HOME`, NIM looks for `token`
   in the parent directory of `NGC_HOME`.
2. The `NGC_API_KEY` string in the JSON file at `NIM_SDK_SECRETS_PATH`, which
   defaults to `/var/secrets/secrets.json`. A blank string takes precedence
   over the environment variable.
3. The `NGC_API_KEY` environment 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:

1. Set the required environment variables:

   ```bash
   export NGC_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
   ```

2. Run the download command:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e NGC_API_KEY \
     -e NIM_MODEL_PROFILE \
     "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --profiles "$NIM_MODEL_PROFILE"
   ```

### Downloading Behind a Corporate Proxy

To download a model from NGC behind a corporate proxy, complete the following steps:

1. Set the required environment variables:

   ```bash
   export NGC_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
   export NIM_MODEL_PROFILE="${YOUR_NIM_MODEL_PROFILE}"
   export HTTPS_PROXY=http://proxy.corp.example.com:8080
   ```

2. Run the download command:

   ```bash
   docker run --rm --gpus all \
     -e NGC_API_KEY \
     -e NIM_MODEL_PROFILE \
     -e HTTPS_PROXY \
     -p 8000:8000 \
     "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --profiles "$NIM_MODEL_PROFILE"
   ```

## 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.

```text
hf://{org}/{model}:{revision}?file={filename}
```

### Authentication

Hugging Face uses a bearer token for authentication:

| Variable   | Description                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------------- |
| `HF_TOKEN` | API token for private or gated models. Recommended even for public models to avoid rate limiting. |

### Additional Environment Variables

The following environment variables configure cache location and hub endpoint for Hugging Face downloads:

| Variable      | Default                  | Description                                                                                                                                                |
| ------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HF_HOME`     | `~/.cache/huggingface`   | Root directory for the local Hugging Face cache. When both `HF_HOME` and `NIM_CACHE_PATH` are set, `HF_HOME` must equal `$NIM_CACHE_PATH/huggingface/hub`. |
| `HF_ENDPOINT` | `https://huggingface.co` | Base URL of the Hugging Face Hub API. Set this to redirect downloads to a private Enterprise Hub instance, a mirror, or a local proxy server.              |

### Hugging Face-Compatible Proxies

NIM supports Hugging Face-compatible proxy servers (such as [Olah](https://github.com/vtuber-plan/olah)) for local caching:

```bash
export HF_ENDPOINT="http://localhost:8090"
```

### Downloading from Hugging Face

To download a model from Hugging Face, complete the following steps:

1. Set the required environment variables:

   ```bash
   export HF_TOKEN="hf_your_token_here"
   ```

2. Run the download command:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e HF_TOKEN \
     "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "hf://openai/gpt-oss-20b"
   ```

## 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.

```text
s3://{bucket}/{key}
```

### Authentication

NIM uses the standard AWS credential provider chain, which discovers credentials in the following order of precedence:

| Credential Source                                                    | Priority    | Use Case              |
| -------------------------------------------------------------------- | ----------- | --------------------- |
| Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) | 1 (highest) | Container deployments |
| AWS credentials file (`~/.aws/credentials`)                          | 2           | Local development     |
| IAM instance profile                                                 | 3           | EC2 instances         |
| ECS container credentials                                            | 4           | ECS tasks             |

```bash
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_REGION=us-east-1
```

### 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:

```bash
export AWS_ENDPOINT_URL=http://minio.example.com:9000
```

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:

| Variable                  | Values            | Default   | Description                                                                 |
| ------------------------- | ----------------- | --------- | --------------------------------------------------------------------------- |
| `AWS_S3_ADDRESSING_STYLE` | `virtual`, `path` | `virtual` | Selects the S3 addressing style explicitly.                                 |
| `AWS_S3_USE_PATH_STYLE`   | `True`, `False`   | `False`   | Forces path-style addressing. Required for services such as MinIO and Ceph. |

> **Note**
>
> 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`:

1. Set the NGC API key:

   ```bash
   export NGC_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
   ```

2. Run the mirror command:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e NGC_API_KEY \
     -e AWS_ACCESS_KEY_ID \
     -e AWS_SECRET_ACCESS_KEY \
     -e AWS_DEFAULT_REGION \
     "$NIM_LLM_MODEL_SPECIFIC_IMAGE" mirror s3 \
       --manifest-file /opt/nim/etc/default/model_manifest.yaml \
       --bucket my-models-bucket
   ```

### Downloading from S3

To download a model from S3, complete the following steps:

1. Set the required environment variables:

   ```bash
   export AWS_ACCESS_KEY_ID="${YOUR_AWS_ACCESS_KEY}"
   export AWS_SECRET_ACCESS_KEY="${YOUR_AWS_SECRET_KEY}"
   export AWS_REGION=us-east-1
   ```

2. Run the download command with the URI of your model directory:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e AWS_ACCESS_KEY_ID \
     -e AWS_SECRET_ACCESS_KEY \
     -e AWS_REGION \
     "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "s3://my-bucket/my-model"
   ```

### Redirecting NGC Downloads to S3

`NIM_REPOSITORY_OVERRIDE` redirects NGC URIs in the manifest to your S3 bucket at runtime:

```bash
export NIM_REPOSITORY_OVERRIDE="s3://my-models-bucket"
export AWS_ACCESS_KEY_ID="${YOUR_AWS_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${YOUR_AWS_SECRET_KEY}"
export AWS_REGION=us-east-1

docker run --rm -it --gpus all \
  -e NGC_API_KEY \
  -e NIM_REPOSITORY_OVERRIDE \
  -e AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY \
  -e AWS_REGION \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
```

> **Note**
>
> 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.

```text
gs://{bucket}/{key}
```

### Authentication

GCS uses Google's Application Default Credentials (ADC), which discovers credentials from the following sources:

* `GOOGLE_APPLICATION_CREDENTIALS` environment 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`:

```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"
```

### 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`:

```bash
export NGC_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v /path/to/sa.json:/credentials/sa.json:ro \
  -e NGC_API_KEY \
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" mirror gcs \
    --manifest-file /opt/nim/etc/default/model_manifest.yaml \
    --bucket my-models-bucket
```

### Downloading from GCS

To download a model from GCS, complete the following steps:

1. Set the required environment variables:

   ```bash
   export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"
   ```

2. Run the download command with the URI of your model directory:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -v /path/to/sa.json:/credentials/sa.json:ro \
     -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
     "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "gs://my-bucket/my-model"
   ```

### Redirect NGC Downloads to GCS

To redirect NGC downloads to GCS, complete the following steps:

1. Set the required environment variables:

   ```bash
   export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"
   export NIM_REPOSITORY_OVERRIDE="gs://my-models-bucket"
   ```

2. Start the container:

   ```bash
   docker run --rm -it --gpus all \
     -e NGC_API_KEY \
     -e NIM_REPOSITORY_OVERRIDE \
     -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
     -v /path/to/sa.json:/credentials/sa.json:ro \
     -p 8000:8000 \
     "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
   ```

## ModelScope

Configure ModelScope as a model source for NIM with the following information.

### URI Format

Use the following URI format for ModelScope models.

```text
modelscope://{org}/{model}:{revision}?file={filename}
```

> **Note**
>
> ModelScope uses `master` as the default branch, unlike Hugging Face which uses `main`.

### Authentication

ModelScope authentication uses the following environment variable:

| Variable               | Description                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------- |
| `MODELSCOPE_API_TOKEN` | API token for private models. Recommended even for public models to avoid rate limiting. |

### ModelScope-Compatible Proxies

NIM supports custom ModelScope endpoints for local caching:

```bash
export MODELSCOPE_ENDPOINT="http://your-modelscope-proxy:port"
```

### Additional Environment Variables

The following environment variables configure ModelScope-specific behavior:

| Variable           | Default                          | Description                                                                             |
| ------------------ | -------------------------------- | --------------------------------------------------------------------------------------- |
| `MODELSCOPE_CACHE` | `$NIM_CACHE_PATH/modelscope/hub` | ModelScope cache directory. Must be consistent with `NIM_CACHE_PATH` when both are set. |

### Downloading from ModelScope

To download a model from ModelScope, complete the following steps:

1. Set the required environment variables:

   ```bash
   export MODELSCOPE_API_TOKEN="your_token_here"
   ```

2. Run the download command:

   ```bash
   docker run --rm --gpus all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e MODELSCOPE_API_TOKEN \
     "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "modelscope://my-org/my-model"
   ```

## 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:

```bash
export NGC_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
export NIM_MODEL_PROFILE="${YOUR_NIM_MODEL_PROFILE}"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v "$(pwd)/model-store:/opt/nim/model-store" \
  -e NGC_API_KEY \
  -e NIM_MODEL_PROFILE \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" create-model-store \
    --model-cache-path /opt/nim/.cache \
    --model-store /opt/nim/model-store \
    --profile "$NIM_MODEL_PROFILE"
```

### Using a Local Model

To serve a local model with a model-free NIM, mount the model directory and
start the container:

```bash
docker run --rm --gpus all \
  -v /mnt/models/my-model:/mnt/models/my-model:ro \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e NIM_MODEL_PATH=/mnt/models/my-model \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

### 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:

```bash
docker run --rm --gpus all \
  -v /mnt/models/my-fine-tune:/mnt/models/my-fine-tune:ro \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e NIM_MODEL_PATH=/mnt/models/my-fine-tune \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
```

* The NIM reads the checkpoint's precision from `config.json` (including the quantization config of an llm-compressor checkpoint), and from `hf_quant_config.json` for 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_PATH` must 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 under `NIM_CACHE_PATH` and reused on redeploy only when the same image and the same `NIM_MODEL_PATH` are used, as for a model-free NIM (refer to [Air-Gap Deployment](/nim/large-language-models/2.1.5-pb7/deployment/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 set `NIM_MODEL_PROFILE` to a profile's name or ID as you would for the official model. For a model store, the ID passed to `create-model-store -p` reproduces 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](/nim/large-language-models/2.1.5-pb7/advanced-use-cases/speculative-decoding). To serve without speculative decoding, set `NIM_SPECDEC_ENABLE=0`.
* Run `list-model-profiles` with the same `NIM_MODEL_PATH` to 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:

| Variable         | Default           | Description                                                                       |
| ---------------- | ----------------- | --------------------------------------------------------------------------------- |
| `NIM_CACHE_PATH` | `/opt/nim/.cache` | Directory used for model assets in the container. Must be a valid, writable path. |

### 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:

| Protocol              | Description                       |
| --------------------- | --------------------------------- |
| `ngc://`              | NGC-compatible proxy servers.     |
| `s3://`               | AWS S3 and S3-compatible storage. |
| `gs://`               | Google Cloud Storage.             |
| `http://`, `https://` | HTTP/HTTPS servers.               |

```bash
export NIM_REPOSITORY_OVERRIDE="s3://my-bucket/nim-models"
```

> **Note**
>
> `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:

| Aspect                    | `NIM_REPOSITORY_OVERRIDE`                                 | `NIM_MODEL_PATH`                        |
| ------------------------- | --------------------------------------------------------- | --------------------------------------- |
| **Purpose**               | Mirror NGC models to your own storage                     | Serve custom/fine-tuned models directly |
| **Manifest**              | Uses built-in NGC manifest                                | No manifest required                    |
| **Upload format**         | Percent-encoded flat keys                                 | Standard directory structure            |
| **Checksum verification** | Yes (from NGC manifest)                                   | No                                      |
| **Use case**              | NGC mirrors and deployments that can reach object storage | Custom models, fine-tuned weights       |

**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](/nim/large-language-models/2.1.5-pb7/deployment/air-gap-deployment). Refer to [Examples](#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](#examples) section.

### Disabling Model Download

The following environment variable controls model download behavior:

| Variable                     | Default | Description                                                                                                         |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| `NIM_DISABLE_MODEL_DOWNLOAD` | `False` | Disable model download on container startup. Useful for multi-node scenarios where only one node needs to download. |

### Proxy Support

For environments behind corporate firewalls, NIM honors the standard proxy environment variables:

```bash
export HTTPS_PROXY=http://proxy.mycorp.com:8080
export HTTP_PROXY=http://proxy.mycorp.com:8080
export NO_PROXY=localhost,127.0.0.1
```

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`:

```bash
docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v ./combined-ca-bundle.pem:/etc/ssl/certs/custom-ca-bundle.pem:ro \
  -e SSL_CERT_FILE=/etc/ssl/certs/custom-ca-bundle.pem \
  -e REQUESTS_CA_BUNDLE=/etc/ssl/certs/custom-ca-bundle.pem \
  -e HTTPS_PROXY=http://proxy.mycorp.com:8080 \
  -e NGC_API_KEY \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --all
```

For details on creating the combined bundle and the full list of outbound TLS variables, refer to
[Environment Variables: Outbound TLS](/nim/large-language-models/2.1.5-pb7/reference/environment-variables#outbound-tls-model-downloads).

## 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.

```text
usage: download-to-cache [-h] [--all] [--profiles [PROFILES ...]]
                         [--lora] [--model-uri MODEL_URI]
                         [--manifest-file MANIFEST_FILE]
                         [--model-cache-path MODEL_CACHE_PATH]
                         [--use-cache] [--verify-checksums]
```

The following arguments are available:

| Argument                              | Description                                                                                                                                                                                   |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--all`                               | Download all profiles to cache.                                                                                                                                                               |
| `--profiles [PROFILES ...]`           | Profile(s) to download. If omitted, the optimal profile is downloaded.                                                                                                                        |
| `--lora`                              | Download the default LoRA profile. Cannot be combined with `--profiles` or `--all`.                                                                                                           |
| `--model-uri MODEL_URI`               | Model URI to download. Remote schemes include `ngc://`, `hf://`, `s3://`, `gs://`, and `modelscope://`. For a local serving deployment, use an absolute directory path with `NIM_MODEL_PATH`. |
| `--manifest-file MANIFEST_FILE`       | Manifest file path.                                                                                                                                                                           |
| `--model-cache-path MODEL_CACHE_PATH` | Directory path of model cache.                                                                                                                                                                |
| `--use-cache`                         | Check for cached assets before downloading from the repo.                                                                                                                                     |
| `--verify-checksums`                  | Verify downloaded files match the checksums in the manifest (enabled by default).                                                                                                             |

### `create-model-store`

Creates a properly formatted model store directory from a cached model profile.

```text
usage: create-model-store [-h] --profile PROFILE --model-store MODEL_STORE
                          [--model-cache-path MODEL_CACHE_PATH]
                          [--use-cache]
```

The following arguments are available:

| Argument                              | Description                                                                   |
| ------------------------------------- | ----------------------------------------------------------------------------- |
| `--profile PROFILE`                   | Profile hash to create a model directory for (required).                      |
| `--model-store MODEL_STORE`           | Directory path where the model profile is extracted and copied to (required). |
| `--model-cache-path MODEL_CACHE_PATH` | Directory path of model cache.                                                |
| `--use-cache`                         | Check for cached assets before downloading from the repo.                     |

### `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`.

```text
usage: mirror {s3,gcs} [-h] -b BUCKET
                        [--profiles [PROFILES ...]]
                        [--manifest-file MANIFEST_FILE]
                        [--model-cache-path MODEL_CACHE_PATH]
```

The following arguments are available:

| Argument                              | Description                                                                       |
| ------------------------------------- | --------------------------------------------------------------------------------- |
| `s3` or `gcs`                         | Destination storage type (positional, required).                                  |
| `-b BUCKET`, `--bucket BUCKET`        | Destination bucket name (required).                                               |
| `--profiles [PROFILES ...]`           | Profiles to mirror. If omitted, the command mirrors all profiles in the manifest. |
| `--manifest-file MANIFEST_FILE`       | Manifest file path.                                                               |
| `--model-cache-path MODEL_CACHE_PATH` | Directory path of model cache.                                                    |

## 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.

```bash
export NGC_API_KEY="${YOUR_NGC_API_KEY}"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e NGC_API_KEY \
  -e NIM_MODEL_PROFILE \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --profiles "$NIM_MODEL_PROFILE"
```

#### Download Behind Corporate Proxy

Use this example to download NGC model profiles from behind a corporate proxy.

```bash
export NGC_API_KEY="${YOUR_NGC_API_KEY}"
export HTTPS_PROXY=http://proxy.corp.example.com:8080
export NO_PROXY=localhost,127.0.0.1

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e NGC_API_KEY \
  -e HTTPS_PROXY \
  -e NO_PROXY \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --all
```

If your proxy uses a private CA for TLS inspection, add the CA bundle:

```bash
docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v ./combined-ca-bundle.pem:/etc/ssl/certs/custom-ca-bundle.pem:ro \
  -e NGC_API_KEY \
  -e HTTPS_PROXY \
  -e NO_PROXY \
  -e SSL_CERT_FILE=/etc/ssl/certs/custom-ca-bundle.pem \
  -e REQUESTS_CA_BUNDLE=/etc/ssl/certs/custom-ca-bundle.pem \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --all
```

For information on how to create the combined bundle, refer to [Environment Variables: Outbound TLS](/nim/large-language-models/2.1.5-pb7/reference/environment-variables#outbound-tls-model-downloads).

### 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.

```bash
export HF_TOKEN="${YOUR_HF_TOKEN}"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e HF_TOKEN \
  "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "hf://openai/gpt-oss-20b"
```

#### Using Hugging Face Proxy (Olah)

Use this example to route Hugging Face requests through an Olah proxy.

```bash
export HF_ENDPOINT="http://localhost:8090"
export HF_TOKEN="${YOUR_HF_TOKEN}"

docker run --rm --gpus all \
  -e NGC_API_KEY \
  --network=host \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e HF_ENDPOINT \
  -e HF_TOKEN \
  -e NIM_MODEL_PATH=hf://openai/gpt-oss-20b \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

### 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`.

```bash
export AWS_ACCESS_KEY_ID="${YOUR_AWS_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${YOUR_AWS_SECRET_KEY}"
export AWS_REGION=us-east-1
export NIM_REPOSITORY_OVERRIDE=s3://my-models-bucket

docker run --rm -it --gpus all \
  -e NGC_API_KEY \
  -e NIM_REPOSITORY_OVERRIDE \
  -e AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY \
  -e AWS_REGION \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
```

#### Mirror NGC to S3

Use this example to mirror NGC model assets to an Amazon S3 bucket.

```bash
export NGC_API_KEY="${YOUR_NGC_API_KEY}"
export AWS_ACCESS_KEY_ID="${YOUR_AWS_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${YOUR_AWS_SECRET_KEY}"
export AWS_DEFAULT_REGION=us-east-1

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e NGC_API_KEY \
  -e AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY \
  -e AWS_DEFAULT_REGION \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" mirror s3 \
    --manifest-file /opt/nim/etc/default/model_manifest.yaml \
    --bucket my-models-bucket
```

#### S3-Compatible Storage (MinIO)

Use this example to serve a model from MinIO or another S3-compatible object store.

```bash
export AWS_ENDPOINT_URL=http://minio.example.com:9000
export AWS_ACCESS_KEY_ID="${YOUR_MINIO_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${YOUR_MINIO_SECRET_KEY}"
export AWS_REGION=us-east-1
export AWS_S3_USE_PATH_STYLE=true
export NIM_REPOSITORY_OVERRIDE=s3://my-bucket

docker run --rm -it --gpus all \
  -e NGC_API_KEY \
  -e NIM_REPOSITORY_OVERRIDE \
  -e AWS_ENDPOINT_URL \
  -e AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY \
  -e AWS_REGION \
  -e AWS_S3_USE_PATH_STYLE \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
```

### 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`.

```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"
export NIM_REPOSITORY_OVERRIDE=gs://my-models-bucket

docker run --rm -it --gpus all \
  -e NGC_API_KEY \
  -e NIM_REPOSITORY_OVERRIDE \
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
  -v /path/to/sa.json:/credentials/sa.json:ro \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE"
```

#### Mirror NGC to GCS

Use this example to mirror NGC model assets to a Google Cloud Storage bucket.

```bash
export NGC_API_KEY="${YOUR_NGC_API_KEY}"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v /path/to/sa.json:/credentials/sa.json:ro \
  -e NGC_API_KEY \
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" mirror gcs \
    --manifest-file /opt/nim/etc/default/model_manifest.yaml \
    --bucket my-models-bucket
```

#### Direct GCS URI in Manifest

Use this example to download a model profile from a custom manifest containing direct `gs://` URIs.

```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/sa.json"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v /path/to/sa.json:/credentials/sa.json:ro \
  -v "$PWD/model_manifest.yaml:/tmp/model_manifest.yaml:ro" \
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials/sa.json \
  -e NIM_MODEL_PROFILE \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" download-to-cache --manifest-file /tmp/model_manifest.yaml --profile "$NIM_MODEL_PROFILE"
```

### 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.

```bash
docker run --rm --gpus all \
  -v /mnt/models/my-model:/opt/nim/model:ro \
  -e NIM_MODEL_PATH=/opt/nim/model \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

#### Air-Gapped Deployment

Use this example to start a model from local storage with container networking disabled.

```bash
docker run --rm --gpus all \
  --network none \
  -v /opt/models/my-model:/opt/nim/model:ro \
  -e NIM_MODEL_PATH=/opt/nim/model \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

#### Create Model Store from NGC

Use this example to create a local model store from a cached NGC model profile.

```bash
export NGC_API_KEY="${YOUR_NGC_API_KEY}"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -v "$(pwd)/model-store:/opt/nim/model-store" \
  -e NGC_API_KEY \
  -e NIM_MODEL_PROFILE \
  "$NIM_LLM_MODEL_SPECIFIC_IMAGE" create-model-store \
    --model-cache-path /opt/nim/.cache \
    --model-store /opt/nim/model-store \
    --profile "$NIM_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.

```bash
export MODELSCOPE_API_TOKEN="${YOUR_MODELSCOPE_TOKEN}"

docker run --rm --gpus all \
  -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
  -e MODELSCOPE_API_TOKEN \
  "$NIM_LLM_MODEL_FREE_IMAGE" download-to-cache --model-uri "modelscope://my-org/my-model"
```

## Next Steps

After the model artifacts are in cache or object storage, continue with the following:

* [Model Profiles and Selection](/nim/large-language-models/2.1.5-pb7/deployment/model-profiles-and-selection) — Select the profile that matches your GPUs.
* [About Model-Free NIM](/nim/large-language-models/2.1.5-pb7/deployment/model-free-nim) — Serve a custom or fine-tuned model without a model-specific image.
* [Air-Gap Deployment](/nim/large-language-models/2.1.5-pb7/deployment/air-gap-deployment) — Transfer the cache or model store to an isolated environment.