Air-Gap Deployment
Air-gap deployment lets you run a NIM without an internet connection, for example, with no connection to remote model registries such as NGC or Hugging Face Hub. This guide describes how to prepare, transfer, and run NIM LLM in an air-gapped environment.
Air-gap deployment follows a two-phase workflow:
- Network-connected phase: On a machine with internet access and credentials, download model assets and prepare them for transfer.
- Air-gapped phase: On the isolated machine, mount the pre-staged model assets and run the NIM container with no outbound network access and no API keys.
Transfer the model assets between these phases using any allowed channel, such as an archive copy, scp, rsync, or physical media.
In the air-gapped phase, do not set NGC_API_KEY or HF_TOKEN. The NIM must load all model assets from local storage only.
Choose a Deployment Modality
NIM LLM supports two deployment modalities. Your choice affects how you prepare model assets for an air-gapped deployment.
Model-Specific NIM
For model-specific NIM, keep the following in mind:
- The NIM container ships with a model manifest that defines the model and one or more profiles (tensor parallel size, backend, and so on).
- Use a model-specific container image for this workflow, such as
${NIM_LLM_MODEL_SPECIFIC_IMAGE}:2.0.11. - Model weights are not shipped inside the container. At startup, NIM loads the model from cache if present, or downloads it when the system has network and credentials.
- For air-gap, you must pre-stage the model using
download-to-cache(and optionallycreate-model-store) during the connected phase, then transfer the cache or model store to the air-gapped system.
Model-Free NIM
For model-free NIM, keep the following in mind:
- The model is configured at runtime by the user (using
NIM_MODEL_PATHor the positional vLLM model CLI argument). The container does not ship a fixed model manifest. - Use the model-free container image for this workflow, such as
${NIM_LLM_MODEL_FREE_IMAGE}:2.0.11. - When
NIM_MODEL_PATHpoints to a local path (for example,/mnt/models/my-llama), NIM serves directly from that path. No download occurs, so if the model directory is already present on the air-gapped system, you do not need to usedownload-to-cacheorcreate-model-store. - When
NIM_MODEL_PATHis a remote URI (for example,ngc://org/team/model:tag), NIM generates a runtime manifest on the first deployment and automatically persists it insideNIM_CACHE_PATH. On subsequent restarts (including in strict air-gap environments) NIM finds the cached manifest in the same cache volume and skips regeneration, making no outbound network or authentication calls. No extra environment variables are required; mounting the same PVC atNIM_CACHE_PATHis sufficient.
Quick Reference
The following table summarizes the model source location at runtime, the container image to use, and how the model is accessed:
Network-Connected Phase
On a machine with internet access, use the NIM container to download model assets and optionally create a model store directory.
Use a container image that matches your workflow:
- For model-specific NIM, use
${NIM_LLM_MODEL_SPECIFIC_IMAGE}:2.0.11. - For model-free NIM, use
${NIM_LLM_MODEL_FREE_IMAGE}:2.0.11.
Download a Model to Cache
The download-to-cache command downloads selected or default model profiles to the NIM cache.
You can also download all profiles with --all, or let NIM auto-select a profile based on the
available hardware by omitting the -p flag.
Run list-model-profiles to discover available profiles and their hashes before downloading.
Create a Model Store
The create-model-store command extracts files from a cached model profile and creates a
properly formatted model directory. If the profile is not already cached, the command downloads
it first.
The resulting directory is ready for transfer to the air-gapped system.
Prepare Container Images
For Kubernetes deployments, every image referenced by the downloaded Helm chart must be
available from a registry that the air-gapped cluster can reach. At a minimum, mirror the NIM
image. Also mirror any images used by enabled init containers, extra init containers, sidecars,
Helm tests, or platform components such as the GPU Operator. For example,
when initContainers.ngcInit is enabled, the chart adds an ngc-model-puller init container
that uses buildpack-deps:bookworm by default. Each user-defined
initContainers.extraInit entry can reference an additional image.
Use the network-connected machine to pull and archive the images. The provided helper script
packages the Helm chart, records the image list, optionally copies values and manifests, saves
images, and creates a transfer archive. Because the documentation site does not distribute
executable shell files, copy airgap-bundle.sh and airgap-load-images.sh from
Air-Gap Helper Scripts into the same local directory first:
The script copies each values file into $AIRGAP_BUNDLE/values/ using its original filename.
Note the filename you pass so you can reference it during installation.
You can repeat --image, --values, and --manifest, or pass an image list with
--images-file. Add images for enabled init containers, extra init containers, sidecars,
Helm tests, and platform components such as the GPU Operator.
The following commands show the equivalent manual image steps:
In the air-gapped environment, extract the bundle, load the image archive, and push the images to the local registry:
The following commands show the equivalent manual image load and push steps:
Record the rewritten image name because you will use it in the Helm values. For example, if
${NIM_LLM_MODEL_FREE_IMAGE}:2.0.11 becomes
registry.airgap.example.com/nim/nim-llm:2.0.11, set:
If the air-gapped registry requires authentication, create an image pull secret in the target
namespace and reference it with imagePullSecrets.
Bundle Helm Charts and Deployment Recipes
Package the Helm chart and any site-specific values files, manifests, or deployment recipes on
the network-connected machine. If you used the provided airgap-bundle.sh, this is already
done. To perform the steps manually, run the following:
Create a transfer archive after images, model assets, charts, and values are ready:
In the air-gapped environment, extract the bundle before installing:
Transfer Model Assets
Transfer the model store directory (or cache) from the connected machine to the air-gapped environment. Common methods include:
- Archive and copy: Create a
tarorziparchive, transfer it through an allowed channel, then extract it on the air-gapped host. scporrsync: Use direct directory transfer when a one-way or out-of-band SSH path is available.rsyncsupports incremental synchronization.- Physical media: Copy the directory or archive onto portable storage (for example, a USB drive), physically move it to the air-gapped environment, then extract it.
Air-Gapped Phase
On the air-gapped system, mount the pre-staged model directory and run the NIM container.
Use a Model Store
Run the following commands to use a model store:
Use the same image type that you used to create the model store in a model-specific NIM workflow.
-
Set the runtime variables:
-
Start the NIM container:
Do not set NGC_API_KEY or HF_TOKEN in this phase.
Use Model-Free NIM with a Remote URI (PVC-Based Redeploy)
If you use model-free NIM with NIM_MODEL_PATH set to a remote URI (for example,
ngc://org/team/model:tag), NIM generates a runtime manifest on the first deployment and
automatically saves a copy inside NIM_CACHE_PATH.
On subsequent restarts (including in a strict air-gap environment) NIM finds the cached manifest in the same cache volume and skips regeneration, making no outbound network or authentication calls. No additional environment variables are required.
Prerequisites:
- The NIM cache from the first (network-connected) deployment must be on a persistent volume (PVC) that is re-mounted between deployments. Both model assets and the manifest are stored there.
-
Set the runtime variables:
-
Start the NIM container:
NIM detects the cached manifest in
/opt/nim/.cacheand starts without any outbound network access.
Do not set NGC_API_KEY in the air-gap phase. If the cache volume is not mounted or was not
populated by a prior network-connected deployment, NIM will attempt to regenerate the manifest and
fail in a strict air-gap environment.
To force manifest regeneration (for example, after an upstream model update), delete
nim_runtime_manifest.yaml from your persistent cache directory before restarting.
Use the Offline Cache
If you prefer to transfer the cache rather than a model store, mount the cache and specify the profile as shown in the following commands:
Use the same image type that you used when populating the cache in a model-specific NIM workflow.
-
Set the runtime variables:
-
Start the NIM container:
Model-Free NIM with a Local Path
When using a model-free NIM with a local model path, no download occurs at startup.
If the model directory is already on the air-gapped system, you can run without
download-to-cache or create-model-store and without any API keys:
-
Set the container name and model repository path:
-
Run the NIM container with the local model path:
Kubernetes Air-Gap Deployment
Use this workflow when the air-gapped environment is a Kubernetes cluster with a private registry mirror.
Prepare Air-Gap Values
Create a values file that points to the private registry and uses only local model storage.
Do not include model.ngcAPIKey, model.ngcAPISecret, model.hfTokenSecret,
NGC_API_KEY, or HF_TOKEN in the air-gapped values.
For a model-free NIM with a pre-staged local model directory, use the following:
If you are using a pre-populated NIM cache instead of a local model directory, mount the cache
at model.nimCache. When a model-specific NIM requires a specific profile, set
NIM_MODEL_PROFILE through env. For single-node deployments, model.profile is only applied
to multi-node deployments, so use env here instead:
Install from the Bundled Chart
Install with the chart archive and values file from the transfer bundle:
Replace airgap-values.yaml with the filename you passed to --values when creating the
bundle. Run ls "$AIRGAP_BUNDLE/values/" to confirm the exact name.
Wait for the pod to become ready:
If your values render a Deployment instead of a StatefulSet, use the following:
Validate Without Internet Access
Port-forward the service and validate health, model listing, and inference:
In another terminal, run the following:
For a stronger validation, block egress from the NIM namespace with a default-deny egress
NetworkPolicy before starting the release. Keep DNS and private registry access only if your
cluster requires those paths for image pulls or service discovery.
This policy blocks all egress. If your cluster needs DNS resolution or in-cluster
registry access after the image is pulled, add matching egress rules (for example, to
kube-dns on UDP/TCP 53 and to your private registry) so those paths still work.
Then restart the pod and repeat the smoke test:
Proxy and Certificate Configuration
If the network-connected phase runs behind a corporate or outbound proxy, you must configure the standard proxy environment variables so that downloads are routed correctly.
HTTP/HTTPS Proxy
When running the network-connected phase behind a proxy, you may need to specify environment variables to direct HTTP and HTTPS traffic through your organization’s proxy servers. The following variables are commonly used for proxy configuration:
In the air-gapped phase, there is no outbound traffic so proxy variables are not needed.
CA Certificate Injection
When outbound HTTPS traffic goes through a TLS-inspecting proxy, or when downloading from
a corporate registry whose TLS certificate is signed by an internal CA, you must inject the
corporate Certificate Authority (CA) certificate so that TLS verification succeeds. Set SSL_CERT_FILE to point
to a combined CA bundle inside the container.
Setting SSL_CERT_FILE replaces the container’s default trust store. If you point it at a
file containing only your corporate CA, connections to public endpoints (such as
api.ngc.nvidia.com) will fail because the public CAs are no longer trusted. Always create a
combined bundle that includes the default CAs and your corporate CA.
Create a combined CA bundle (one-time, on the host):
To add your corporate CA without losing trust in public CAs, concatenate the container’s default bundle with your corporate CA certificate:
Run with the combined bundle:
Mount and reference the combined bundle:
If downloading through a proxy, also add -e HTTP_PROXY=... and -e HTTPS_PROXY=....
A proxy is not required for SSL_CERT_FILE to take effect.
CA certificate injection is only relevant during the network-connected phase. After the deployment is fully air-gapped, there is no outbound HTTPS traffic and no CA configuration is needed.
These variables affect outbound TLS (model downloads). They are unrelated to the
NIM_SSL_* variables, which configure inbound TLS at the nginx proxy layer.
For more information, refer to Environment Variables: SSL and TLS.
Environment Variables
The following environment variables are relevant to air-gap deployment:
Examples
Use the following examples to deploy a NIM in an air-gapped environment for different scenarios.
Download and Create a Model Store
Use this workflow to create a model store on a network-connected system and then run NIM from that model store in the air-gapped environment.
-
In the network-connected phase, set the required variables and create the local directories:
-
Download the model to the local cache:
-
Create the model store:
-
Transfer the model store to the air-gapped system.
-
On the air-gapped system, set the runtime variables and start NIM:
-
Start NIM:
Use the Offline Cache
Use this workflow when you want to transfer the NIM cache instead of creating a model store.
-
In the network-connected phase, set the required variables and create the cache directory:
-
Download the model to the cache:
-
Transfer the cache to the air-gapped system.
-
On the air-gapped system, set the runtime variables and start NIM:
-
Start NIM:
Model-Free NIM with a Local Path (No Download Needed)
If the model directory is already on the air-gapped system (for example, copied using secure transfer), you can run directly without any prior download steps:
-
Set the runtime variables:
-
Start NIM by using the local model path:
Network-Connected Phase with Proxy and CA Certificate
For environments that require an HTTP/HTTPS proxy and custom CA certificates during the download phase, use a combined CA bundle (see CA Certificate Injection):
After the model is pre-staged and transferred, the air-gapped phase does not require proxy or CA certificate configuration.