Skip to navigation

Deploy with Helm

View as Markdown

Alpamayo 2 Super. For the previous generation, see Alpamayo 1.5 Deploy with Helm.

Alpamayo 2 Super NIM can be deployed on Kubernetes with the NVIDIA NIM WFM Helm chart. You need a Kubernetes cluster with supported NVIDIA GPU nodes and the GPU Operator installed.

H100 and H200 GPU nodes are supported. Confirm that the selected profile fits the node’s GPU memory by checking Support Matrix before scheduling the pod.

Prerequisites

Create an NGC_API_KEY as described in Quickstart Guide, then download the public nim-wfm chart version 1.3.0 used in this guide. The chart download itself does not require the key, but the command below sends it, and the secrets in the next section need it. The chart version and the NIM image version are separate.

export NIM_WFM_VERSION=1.3.0
python3 - <<'PYTHON'
import base64, os, shutil, urllib.request
version = os.environ["NIM_WFM_VERSION"]
if not version or any(c not in "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-" for c in version):
raise SystemExit("Enter the chart version published with this NIM release.")
filename = f"nim-wfm-{version}.tgz"
auth = base64.b64encode(("$oauthtoken:" + os.environ["NGC_API_KEY"]).encode()).decode()
request = urllib.request.Request(
"https://helm.ngc.nvidia.com/nim/charts/" + filename,
headers={"Authorization": "Basic " + auth},
)
with urllib.request.urlopen(request, timeout=120) as response, open(filename, "wb") as target:
shutil.copyfileobj(response, target)
PYTHON
helm show values "nim-wfm-${NIM_WFM_VERSION}.tgz" > chart-defaults.yaml

Create Kubernetes Secrets

python3 - <<'PYTHON' | kubectl apply -f -
import base64, json, os
key = os.environ["NGC_API_KEY"]
auth = base64.b64encode(("$oauthtoken:" + key).encode()).decode()
config = json.dumps({"auths": {"nvcr.io": {"auth": auth}}})
print(json.dumps({"apiVersion": "v1", "kind": "List", "items": [
{"apiVersion": "v1", "kind": "Secret",
"metadata": {"name": "ngc-secret"},
"type": "kubernetes.io/dockerconfigjson",
"stringData": {".dockerconfigjson": config}},
{"apiVersion": "v1", "kind": "Secret",
"metadata": {"name": "ngc-api"},
"type": "Opaque", "stringData": {"NGC_API_KEY": key}},
]}))
PYTHON

These commands read the exported key from the environment and pass secret manifests to kubectl through standard input. They keep the key out of process arguments and Helm values. Use the same Kubernetes namespace for these secrets and the subsequent Helm installation.

Configure Values

Configure the immutable NIM image reference, one supported GPU, persistent cache storage, and an NGC image-pull secret. Select a node with enough GPU memory for the BF16 profile. Chart 1.3.0 mounts a memory-backed volume at /dev/shm while sharedMemory.enabled keeps its default, true; keep it enabled, because the NIM checks free space in /dev/shm before loading the model. With sharedMemory.sizeLimit unset, the volume’s size depends on Kubernetes and node memory configuration. To bound it, set sharedMemory.sizeLimit, for example to 16Gi to match the Docker --shm-size=16g setting.

Write the complete values file in the directory that holds the chart archive:

cat > custom-values.yaml <<'EOF'
image:
repository: nvcr.io/nim/nvidia/alpamayo-2-super
tag: 1.0.0
pullPolicy: IfNotPresent
imagePullSecrets:
- name: ngc-secret
model:
ngcAPISecret: ngc-api
apiPort: 8000
jsonLogging: false
nimCache: /opt/nim/.cache
env:
- name: NIM_MODEL_PROFILE
value: bf16
- name: NIM_ALPAMAYO_TRAJ_SAMPLES
value: "1"
- name: NIM_ALPAMAYO_VLLM_MAX_INFLIGHT
value: "8"
- name: NIM_ALPAMAYO_HTTP_MAX_REQUEST_BYTES
value: "134217728"
- name: NIM_ALPAMAYO_SHUTDOWN_TIMEOUT
value: "25"
resources:
limits:
nvidia.com/gpu: 1
persistence:
enabled: true
size: 200Gi
startupProbe:
failureThreshold: 360
EOF

The 200Gi volume holds the cache for one or two profiles. It is below the BYOC-with-FP8-conversion budget in Prerequisites: size the volume from those budgets, excluding the image, when you cache several profiles or convert a BYOC checkpoint to FP8. The BYOC checkpoint itself is a separate read-only volume.

NIM_MODEL_PROFILE selects the profile. Use bf16, fp8, fp8-dflash2, or bf16-dflash2 on a compatible GPU. NIM_ALPAMAYO_TRAJ_SAMPLES configures trajectory sampling. NIM_ALPAMAYO_VLLM_MAX_INFLIGHT limits admitted inference requests, HTTP and gRPC combined; extra HTTP requests return HTTP 429 and Retry-After: 1, and extra gRPC calls return RESOURCE_EXHAUSTED. NIM_ALPAMAYO_HTTP_MAX_REQUEST_BYTES rejects oversized HTTP inference bodies with HTTP 413 before they consume a backend slot. NIM_ALPAMAYO_SHUTDOWN_TIMEOUT is the default drain deadline, shown so that it can be checked against the pod’s grace period (see Termination Grace Period).

Chart 1.3.0 does not translate Alpamayo-specific fields such as model.profile, model.precision, model.trajectorySamples, model.maxInflight, or model.maxRequestBytes into runtime settings. Set these through env as shown above. To change the served model name, add NIM_SERVED_MODEL_NAME to that list. Leave the chart’s model.selection fields empty: model.selection.precision sets NIM_PRECISION, and the NIM stops at startup when both NIM_PRECISION and NIM_MODEL_PROFILE are set.

Chart 1.3.0 defaults model.jsonLogging to true, which sets NIM_LOGGING_JSONL=1. Every NIM log line is then a JSON object, including the base container banner and platform notes, which appear as JSON records with "source": "base-image-entrypoint". The only plain-text line is the native driver line (ERROR: driverInitFileInfo ...) written before the NIM starts (see Known Issues and Limitations). This example sets it to false for a plain-text collector; set it to true for a JSON collector that tolerates that one line.

The persistence example uses the cluster’s default StorageClass. If the cluster has no default, set persistence.storageClass to an existing class name. For classless storage, set storageClass: "-", which chart 1.3.0 renders as storageClassName: "" so that the claim binds a pre-provisioned volume without a class, or prepare a suitable PVC separately and set persistence.existingClaim to its name.

To set additional runtime variables, add entries to the env list in custom-values.yaml, for example:

- name: NIM_ALPAMAYO_STARTUP_WARMUP
value: "1"
- name: NIM_ALPAMAYO_SPEC_METRICS
value: summary

Use string values. Do not repeat variables already set by model, such as NIM_HTTP_API_PORT and NIM_GRPC_API_PORT (set them with model.apiPort and model.grpcPort), or put credentials in this list; use the existing Secret reference. Review chart-defaults.yaml for the selected chart version before deployment. nim-wfm is a generic chart, so its defaults belong to other NIMs: for example image.repository defaults to a different NIM image and model.name to another model’s name. The values above override the image; chart 1.3.0 does not pass model.name to the NIM, so leave it or set it to the served model ID for readability. Files in the chart archive other than the chart itself, such as deployment scripts and guides, describe other NIMs; follow this page instead.

BYOC also requires a readable checkpoint volume, using extraVolumes and extraVolumeMounts with NIM_FT_CHECKPOINT pointing to its container mount. In chart 1.3.0 both values are maps keyed by the volume name, not Kubernetes lists; the chart’s schema rejects the list form. Helm replaces a list such as env as a whole when a second values file sets it, so write a separate complete file for BYOC instead of layering a second file on top of custom-values.yaml. For example, with an existing PVC named <checkpoint-pvc> that holds the checkpoint:

cat > custom-values-byoc.yaml <<'EOF'
image:
repository: nvcr.io/nim/nvidia/alpamayo-2-super
tag: 1.0.0
pullPolicy: IfNotPresent
imagePullSecrets:
- name: ngc-secret
model:
ngcAPISecret: ngc-api
apiPort: 8000
jsonLogging: false
nimCache: /opt/nim/.cache
env:
- name: NIM_MODEL_PROFILE
value: bf16
- name: NIM_FT_CHECKPOINT
value: /byoc
- name: NIM_ALPAMAYO_TRAJ_SAMPLES
value: "1"
- name: NIM_ALPAMAYO_VLLM_MAX_INFLIGHT
value: "8"
- name: NIM_ALPAMAYO_HTTP_MAX_REQUEST_BYTES
value: "134217728"
- name: NIM_ALPAMAYO_SHUTDOWN_TIMEOUT
value: "25"
resources:
limits:
nvidia.com/gpu: 1
persistence:
enabled: true
size: 200Gi
startupProbe:
failureThreshold: 360
extraVolumes:
byoc-checkpoint:
persistentVolumeClaim:
claimName: <checkpoint-pvc>
readOnly: true
extraVolumeMounts:
byoc-checkpoint:
mountPath: /byoc
readOnly: true
EOF

Replace <checkpoint-pvc> with the claim name, and use custom-values-byoc.yaml in place of custom-values.yaml in the commands below. See Bring Your Own Checkpoint for checkpoint requirements.

Cache Path

Chart 1.3.0 mounts the persistent volume at model.nimCache and sets NIM_CACHE_PATH to the same path. Its default is /model-store, not the NIM’s default /opt/nim/.cache. Keep model.nimCache: /opt/nim/.cache as in both values files above, so that the volume is mounted at the NIM’s default cache path. With a relocated cache, the NIM still writes a few small compiler best_config files under /opt/nim/.cache; in a pod that path is then part of the container filesystem, so those files are lost on every restart and each pod start repeats that tuning work during engine initialization. With /opt/nim/.cache on the volume, every compiled artifact is reused. It is also the container path at which the air-gapped deployment guide stages and restores a cache, so a staged cache can be copied into the volume unchanged. After rendering, confirm that rendered.yaml sets NIM_CACHE_PATH to /opt/nim/.cache and mounts the model-store volume there.

Launch the NIM

Render the configuration from custom-values.yaml for inspection, then install chart 1.3.0:

helm template alpamayo2-super "nim-wfm-${NIM_WFM_VERSION}.tgz" \
-f custom-values.yaml > rendered.yaml
helm install alpamayo2-super "nim-wfm-${NIM_WFM_VERSION}.tgz" \
-f custom-values.yaml
kubectl get pods
kubectl logs -f statefulset/alpamayo2-super-nim-wfm

Run Inference

Port-forward the HTTP service and verify readiness:

kubectl port-forward service/alpamayo2-super-nim-wfm 8000:http-api
curl --fail http://localhost:8000/v1/health/ready

Run the readiness request from a second terminal while port-forwarding. For request examples, refer to Quickstart Guide. Where the quickstart and the bundled Agent Skills use docker exec or docker cp on the container, use kubectl exec or kubectl cp on the pod instead, and use the port-forwarded URL as NIM_URL:

export NIM_POD=alpamayo2-super-nim-wfm-0
export NIM_URL=http://localhost:8000
kubectl exec "$NIM_POD" -- python3 /opt/nim/build_http_payload.py \
--endpoint infer --task trajectory \
--sample-dir /workspace/sample_data > trajectory.json
curl --fail-with-body -sS "$NIM_URL/v1/infer" \
-H 'Content-Type: application/json' --data-binary @trajectory.json
kubectl cp "$NIM_POD:/workspace/sample_data" ./sample_data
kubectl cp "$NIM_POD:/opt/nim/skills" ./alpamayo-agent-assets/skills

kubectl cp runs tar inside the container. Add -n <namespace> to the kubectl commands when the release is not in the current namespace.

With the values above, chart 1.3.0 exposes only HTTP through its Service. For a local gRPC check, forward the running pod’s gRPC port in a separate terminal:

kubectl port-forward pod/alpamayo2-super-nim-wfm-0 50051:50051

Connect the gRPC client to localhost:50051. This pod port-forward is for local access. For in-cluster gRPC clients, add inferenceProtocol: grpc under model in the values file: chart 1.3.0 then adds a grpc-api port (service.grpcPort, default 50051) to the container and its Services, and HTTP stays on http-api. The NIM serves HTTP and gRPC in either setting. See API Reference for the gRPC API.

Chart 1.3.0 renders one helm test hook by default, test-ready, which checks /v1/health/ready through the HTTP Service. It runs the public curlimages/curl:8.6.0 image from Docker Hub; on clusters without Docker Hub access, mirror that image and set tests.image.repository and tests.image.tag, or skip helm test and check readiness with the port-forwarded curl above. The chart’s metadata and inference test hooks are disabled by default; leave them disabled.

helm test alpamayo2-super

To change the HTTP listener port, use model.apiPort. Avoid the deprecated model.openai_port override, which can make probe and listener ports disagree. Leave gpuDeviceId unset; chart 1.3.0 does not implement it. Kubernetes allocates the GPU through resources.limits. Keep nvidia.com/gpu: 1: with more than one GPU visible in the pod, startup stops with N GPUs are visible in the container, but the Alpamayo 2 Super NIM uses exactly one GPU. CUDA_VISIBLE_DEVICES does not narrow a multi-GPU container.

Troubleshooting

If the pod does not start, inspect kubectl describe pod <pod-name> and kubectl logs <pod-name>. Confirm GPU scheduling, storage permissions, image-pull secrets, and the selected profile.

Termination Grace Period

Keep the pod’s terminationGracePeriodSeconds at least NIM_ALPAMAYO_SHUTDOWN_TIMEOUT plus 30 seconds: the drain deadline, plus time for the backend to release its resources after the deadline when a request is still running then. This is the same rule as docker stop -t in Configuring a NIM. With the default 25-second drain deadline, the grace period must be at least 55 seconds.

Chart 1.3.0 sets the pod’s terminationGracePeriodSeconds from the top-level Helm value of the same name, which defaults to 60. With that default, keep NIM_ALPAMAYO_SHUTDOWN_TIMEOUT at 30 seconds or less: with a longer drain, Kubernetes sends SIGKILL at 60 seconds, so the drain cannot complete and interrupts requests still in flight. The runtime accepts values up to 300. To drain for longer, set terminationGracePeriodSeconds in the values file to the drain deadline plus 30 seconds, for example 330 for a 300-second deadline. See Configuring a NIM for the shutdown contract.