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

# About Model-Free NIM

> Serve a compatible text model with the vLLM model-free NIM.

Model-free NIM lets you run a compatible text model in NIM LLM and VLM without a model-specific container image.

By default, NIM containers ship with a built-in model manifest that defines which model to serve. In model-free mode, you point the vLLM model-free container at a compatible model, such as a Hugging Face repository, an S3 bucket, or a local directory. NIM then generates a manifest at startup and serves that model.

## How It Works

When you start a model-free container, you supply a model location with `NIM_MODEL_PATH` or with the backend positional argument. NIM generates a runtime manifest for that source, selects a profile, and serves the model.

If you do not set a served name, NIM derives one from the model source by removing the URI scheme and any trailing `:<version>`, then replacing any `:` that remains. That derived name is the value to use in the `model` field of inference requests, and it is what `/v1/models` reports.

For air-gap redeploys, the first network-connected start can persist the generated manifest in the container cache (`NIM_CACHE_PATH`). A keyless offline restart from an NGC or Hugging Face URI also requires every file for the selected profile in that cache. For the full air-gap workflow, refer to [Air-Gap Deployment](/nim/large-language-models/2.1.5-pb7/deployment/air-gap-deployment).

Profile listing, URI schemes, and download behavior are documented in the configuration sections that follow. For profile selection details, refer to [Model Profiles and Selection](/nim/large-language-models/2.1.5-pb7/deployment/model-profiles-and-selection). For source-specific download steps, refer to [Model Download](/nim/large-language-models/2.1.5-pb7/deployment/model-download).

## Related Use Cases

Model-free NIM supports the following capabilities:

* **Flexible single-container deployments**: One container image can pass security review and serve any supported model.
* **Day-zero model support**: You can serve newly released models without waiting for a model-specific NIM container.
* **Custom and fine-tuned models**: You can serve your own models from any supported source.

## Limitations and Considerations

The following limits apply when you choose a model-free NIM container.

* The checkpoint must use a text model architecture supported by the vLLM version in the container. PB7.0 Model-Free NIM supports text-only LLMs; VLM checkpoints and multimodal workloads are not supported. See the [Support Matrix for PB NIMs](/nim/large-language-models/2.1.5-pb7/reference/support-matrix) for models validated with PB7.0.
* A serving start that needs to download model files requires network access and a valid NGC API key in addition to any credentials required by the model source.

## Configuring the Model-Free NIM Container Image

See the [vLLM Model-Free NIM](https://catalog.ngc.nvidia.com/orgs/nim/teams/nvidia/containers/model-free-nim-pb7) in the NGC Catalog.

Set the image and cache directory for the examples. Before running a connected deployment, export the `NGC_API_KEY` according to the [Configuration](/nim/large-language-models/2.1.5-pb7/get-started/configuration) guide. If the Hugging Face repository requires authentication, also export your `HF_TOKEN`.

```bash
export NIM_LLM_MODEL_FREE_IMAGE="nvcr.io/nim/nvidia/model-free-nim-pb7:2.1.5-pb7.0"
export LOCAL_NIM_CACHE="$HOME/.cache/nim"
mkdir -p "$LOCAL_NIM_CACHE"
```

## Configuring the Model

Supply the model path and name using **either** of these methods. If both are provided, the CLI positional argument takes precedence.

### NIM_MODEL_PATH Environment Variable

Use `NIM_MODEL_PATH` to point the container to the model at runtime:

```bash
docker run --gpus=all \
  -e NIM_MODEL_PATH=hf://openai/gpt-oss-20b \
  -e NGC_API_KEY \
  -e HF_TOKEN \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

### Backend CLI Positional Argument

Pass the model path as a positional argument to the vLLM backend.

```bash
docker run --gpus=all \
  -e NGC_API_KEY \
  -e HF_TOKEN \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE" \
  hf://openai/gpt-oss-20b
```

### Default Model Name

If you do not set a name, NIM derives one from the model source by removing the URI
scheme and any trailing `:<version>`, then replacing any `:` still left. The result is
the name to use in the `model` field of inference requests, and it is what `/v1/models`
reports.

| Model source                      | Derived model name           |
| --------------------------------- | ---------------------------- |
| `hf://openai/gpt-oss-20b`         | `openai/gpt-oss-20b`         |
| `ngc://nim/my-org/my-model:1`     | `nim/my-org/my-model`        |
| `s3://my-bucket/my-org/my-model`  | `my-bucket/my-org/my-model`  |
| `gs://my-bucket/my-org/my-model`  | `my-bucket/my-org/my-model`  |
| `/opt/nim/models/my-model`        | `/opt/nim/models/my-model`   |
| `s3://my-bucket/team:v2/my-model` | `my-bucket/team_v2/my-model` |

NIM uses an explicitly set name verbatim. Use `/v1/models` to confirm the served name.

### NIM_SERVED_MODEL_NAME Environment Variable

Use `NIM_SERVED_MODEL_NAME` to set the model name used in inference requests:

```bash
docker run --gpus=all \
  -e NIM_SERVED_MODEL_NAME=openai/gpt-oss-20b \
  ...
```

### CLI Argument

Use the CLI argument `--served-model-name` to pass the model name used in inference requests.

```bash
docker run --gpus=all \
  ...
  --served-model-name "openai/gpt-oss-20b"
```

## Supported Model Sources

The table lists model source URI prefixes and source credentials. Serving startup requires a valid NGC API key whenever it needs to download model files, regardless of source.

| Prefix            | Source                 | Example                          | Authentication                                                                                               |
| ----------------- | ---------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `hf://`           | Hugging Face Hub       | `hf://openai/gpt-oss-20b`        | `HF_TOKEN`                                                                                                   |
| `ngc://`          | NVIDIA NGC             | `ngc://nim/my-org/my-model:1`    | `NGC_API_KEY`                                                                                                |
| `s3://`           | AWS S3 / S3-compatible | `s3://my-bucket/my-org/my-model` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` ([additional S3 variables](#s3-specific-environment-variables)) |
| `modelscope://`   | ModelScope Hub         | `modelscope://my-org/my-model`   | `MODELSCOPE_API_TOKEN`                                                                                       |
| `gs://`           | Google Cloud Storage   | `gs://my-bucket/my-org/my-model` | `GOOGLE_APPLICATION_CREDENTIALS` (or ADC)                                                                    |
| *(absolute path)* | Local directory        | `/mnt/models/my-model`           | None                                                                                                         |

For details on downloading models from each source (including URI formats, proxy configuration, and cache management), refer to [Model Download](/nim/large-language-models/2.1.5-pb7/deployment/model-download).

## Configuring Deployment Options

Model-free NIM generates profiles for combinations of tensor parallelism (TP), pipeline parallelism (PP), and LoRA. To select a deployment configuration, use **either** of the following methods. If both are provided, backend CLI arguments take precedence.

### NIM_MODEL_PROFILE Environment Variable

Run `list-model-profiles` and select a compatible profile. Export `NIM_MODEL_PROFILE` with its description or ID before starting the container.

```bash
docker run --gpus=all \
  -e NIM_MODEL_PATH=hf://openai/gpt-oss-20b \
  -e NIM_MODEL_PROFILE \
  -e NGC_API_KEY \
  -e HF_TOKEN \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE"
```

### Backend CLI Arguments (passthrough)

Use vLLM CLI arguments to pass additional runtime options with the model path. The following example requires two compatible GPUs.

```bash
docker run --gpus=all \
  -e NGC_API_KEY \
  -e HF_TOKEN \
  -p 8000:8000 \
  "$NIM_LLM_MODEL_FREE_IMAGE" \
  hf://openai/gpt-oss-20b \
  --tensor-parallel-size 2
```

The following vLLM CLI arguments are most relevant in the context of model-free
NIM:

| Argument                   | Purpose                                      | Default  |
| -------------------------- | -------------------------------------------- | -------- |
| `--tensor-parallel-size`   | Number of GPUs in each tensor-parallel group | 1        |
| `--pipeline-parallel-size` | Number of pipeline stages                    | 1        |
| `--enable-lora`            | Enable LoRA adapter support                  | Disabled |

For a deployment with both forms of parallelism, allocate `TP × PP` GPUs.

## Listing Profiles

Use the `list-model-profiles` command to view the profiles generated for a given model:

```bash
docker run --gpus=all \
  -e NIM_MODEL_PATH=hf://openai/gpt-oss-20b \
  -e HF_TOKEN \
  "$NIM_LLM_MODEL_FREE_IMAGE" \
  list-model-profiles
```

For more details on profile selection, refer to [Model Profiles and Selection](/nim/large-language-models/2.1.5-pb7/deployment/model-profiles-and-selection).

## S3-Specific Environment Variables

The following environment variables authenticate and configure S3 and S3-compatible endpoints:

| Variable                             | Required               | Purpose                                                          |
| ------------------------------------ | ---------------------- | ---------------------------------------------------------------- |
| `AWS_ACCESS_KEY_ID`                  | Yes                    | AWS access key                                                   |
| `AWS_SECRET_ACCESS_KEY`              | Yes                    | AWS secret key                                                   |
| `AWS_REGION` or `AWS_DEFAULT_REGION` | Yes                    | AWS region (for example, `us-east-1`)                            |
| `AWS_ENDPOINT_URL`                   | Only for S3-compatible | Custom endpoint (for example, `http://localhost:9000` for MinIO) |
| `AWS_S3_USE_PATH_STYLE`              | Only for S3-compatible | Set to `true` for MinIO or path-style S3 endpoints               |

For complete authentication and configuration details for each source, refer to [Model Download](/nim/large-language-models/2.1.5-pb7/deployment/model-download).

## Air-Gap Deployments

How model-free NIM behaves in an air-gap environment depends on the type of `NIM_MODEL_PATH` value
you use.

### Local Path (`/abs/path/to/model`)

NIM builds the deployment from local files without network access or credentials. Stage the complete model directory and mount it into the container.

### Remote URI (`ngc://`, `hf://`, `s3://`, and so on)

On a connected deployment, NIM saves the runtime manifest and its key in
`NIM_CACHE_PATH`. For keyless offline startup from an NGC or Hugging Face URI, mount the same
cache in a container running the same image and use the same `NIM_MODEL_PATH`. The manifest
key must match, and the cache must contain every file for the selected profile.

For S3, Google Cloud Storage, or ModelScope, stage the complete checkpoint in a local
directory before disconnecting. Mount the directory and set `NIM_MODEL_PATH` to its absolute
path inside the container.

> **Tip**
>
> The cached manifest is also reused on network-connected restarts while the image and
> `NIM_MODEL_PATH` are unchanged, so a moving reference (such as a `:latest` tag or a Hugging Face
> branch) keeps serving the files it was first resolved to. Pin `NIM_MODEL_PATH` to a fixed version,
> or, to force manifest regeneration after an upstream model update, delete `nim_runtime_manifest.yaml`
> or `nim_runtime_manifest.key.json` from your persistent cache directory (for example, the host machine directory in `LOCAL_NIM_CACHE`) mounted to `/opt/nim/.cache` (the default value of `NIM_CACHE_PATH` inside the container) before restarting.

For a complete walkthrough, refer to [Air-Gap Deployment](/nim/large-language-models/2.1.5-pb7/deployment/air-gap-deployment).

## Examples

Use the following examples to run model-free NIM with different model sources and profile selection methods. Each example lists the commands in order.

### Hugging Face Model with TP=2

Use this example to inspect available profiles for a Hugging Face model and then run the model with `TP=2`.

1. Set the model path:

   ```bash
   export MODEL=hf://openai/gpt-oss-20b
   ```

2. List the available profiles:

   ```bash
   docker run --gpus=all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e HF_TOKEN \
     -e NIM_MODEL_PATH="$MODEL" \
     "$NIM_LLM_MODEL_FREE_IMAGE" \
     list-model-profiles
   ```

3. Confirm the output lists a compatible `tp2-pp1` profile for your two GPUs. Export
   `NIM_MODEL_PROFILE` with that profile's description or ID if you plan to select it explicitly.

4. Start NIM using one of the following methods:

* Select a profile with `NIM_MODEL_PROFILE`:

  ```bash
  docker run --gpus=all \
    -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
    -e NGC_API_KEY \
    -e HF_TOKEN \
    -e NIM_MODEL_PROFILE \
    -e NIM_MODEL_PATH="$MODEL" \
    -p 8000:8000 \
    "$NIM_LLM_MODEL_FREE_IMAGE"
  ```

* Override the profile through a vLLM CLI argument:

  ```bash
  docker run --gpus=all \
    -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
    -e NGC_API_KEY \
    -e HF_TOKEN \
    -p 8000:8000 \
    "$NIM_LLM_MODEL_FREE_IMAGE" \
    "$MODEL" --tensor-parallel-size 2
  ```

### Model Hosted in S3 Using Default Profile from Automatic Profile Selection

Use this example to serve a model from S3 and let NIM select the default compatible profile automatically.

1. Set the model path:

   ```bash
   export MODEL=s3://my-bucket/my-org/my-fine-tuned-model
   ```

2. Export the AWS credentials. Start NIM with the source credentials and the NGC API key:

   ```bash
   docker run --gpus=all \
     -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
     -e NIM_MODEL_PATH="$MODEL" \
     -e NGC_API_KEY \
     -e AWS_ACCESS_KEY_ID \
     -e AWS_SECRET_ACCESS_KEY \
     -e AWS_REGION=us-east-1 \
     -p 8000:8000 \
     "$NIM_LLM_MODEL_FREE_IMAGE"
   ```

### Local Model with TP=8 Profile Specified

Use this example to serve a local model and select a `TP=8` profile explicitly.

1. Set the model path:

   ```bash
   export MODEL=/mnt/models/my-120b-model
   ```

2. List profiles for the mounted model as shown in [Listing Profiles](#listing-profiles). Include the same model directory mount used below. Export `NIM_MODEL_PROFILE` with a compatible TP=8 profile ID and start NIM:

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