Skip to navigation

Model Signature Verification

View as MarkdownOpen in Claude

NVIDIA signs all models it publishes to the NGC Catalog using the OpenSSF Model Signing (OMS) standard. You can verify independently that NVIDIA published a model artifact and that its contents have stayed intact. Organizations that follow a “trust, but verify” security model require this verification.

NIM automatically verifies the checksums of downloaded files. The external cryptographic signature verification in this guide complements NIM’s built-in checksum validation.

Prerequisites

Before you start, complete the following prerequisites:

  1. Install and configure the NGC CLI with a valid API key.

  2. Install the model-signing Python package:

    pip install model-signing

Identify the Model Profile

Each NIM container uses a model profile with a 64-character ID. To list the available profiles, run list-model-profiles.

export NIM_LLM_IMAGE="nvcr.io/nim/meta/llama-3.1-70b-instruct:latest"
docker run --rm --gpus=all \
${NIM_LLM_IMAGE} \
list-model-profiles

Example output:

MODEL PROFILES
- Compatible with system and runnable:
- 4f904d571fe60ff24695b5ee2aa42da58cb460787a968f1e8a09f5a7e862728d (vllm-bf16-tp1-pp1) [requires >=18 GB/gpu]

This example uses a vLLM image. In SGLang images, profile descriptions start with sglang-, as in sglang-bf16-tp1-pp1. Both backends use 64-character profile IDs and follow the same verification steps.

Record the 64-character ID of the profile you want to verify. To identify the active profile in a running container, inspect the startup logs.

docker logs ${container_name} | grep "Selected profile"

For more details on profile selection, refer to Model Profiles and Selection.

Find the NGC Version Tag

Each NIM profile downloads its model files from a specific version in the NGC model registry. The container’s model manifest at /opt/nim/etc/default/model_manifest.yaml maps profiles to NGC versions. Use the corresponding NGC version tag to download the model and its signature.

Set PROFILE_ID to the ID you recorded.

export PROFILE_ID=${profile_id}

For example:

export PROFILE_ID=4f904d571fe60ff24695b5ee2aa42da58cb460787a968f1e8a09f5a7e862728d

Locate the profile’s download URI in the manifest. The URI contains the NGC version tag.

docker run --rm --entrypoint bash ${NIM_LLM_IMAGE} -c \
"grep -A20 '${PROFILE_ID}' /opt/nim/etc/default/model_manifest.yaml \
| grep -m1 'uri:'"

Example output:

uri: ngc://nim/meta/llama-3.1-70b-instruct:bf16-tool-calling-fix?file=LICENSE

The URI follows the format ngc://{ORG}/{TEAM}/{MODEL_NAME}:{NGC_TAG}?file=.... The example contains these values.

  • ORG/TEAM: nim/meta
  • MODEL_NAME: llama-3.1-70b-instruct
  • NGC_TAG: bf16-tool-calling-fix

Capture the full model URI and extract the model path, NGC version tag, and model name into variables.

# Strip ngc:// prefix and ?file=... suffix to get: nim/meta/llama-3.1-70b-instruct:bf16-tool-calling-fix
export MODEL_URI=$(docker run --rm --entrypoint bash ${NIM_LLM_IMAGE} -c \
"grep -A20 '${PROFILE_ID}' /opt/nim/etc/default/model_manifest.yaml \
| grep -m1 'uri:' \
| sed 's|.*uri: ngc://||;s|?.*||'")
export NGC_MODEL_PATH=$(echo ${MODEL_URI} | cut -d':' -f1) # nim/meta/llama-3.1-70b-instruct
export NGC_TAG=$(echo ${MODEL_URI} | cut -d':' -f2) # bf16-tool-calling-fix
export MODEL_NAME=$(echo ${NGC_MODEL_PATH} | cut -d'/' -f3) # llama-3.1-70b-instruct
echo "NGC_MODEL_PATH: ${NGC_MODEL_PATH}"
echo "MODEL_NAME: ${MODEL_NAME}"
echo "NGC_TAG: ${NGC_TAG}"

Example output:

NGC_MODEL_PATH: nim/meta/llama-3.1-70b-instruct
MODEL_NAME: llama-3.1-70b-instruct
NGC_TAG: bf16-tool-calling-fix

Download the Model

Download the model files from NGC using the NGC_MODEL_PATH and NGC_TAG variables you set earlier.

mkdir -p ./model
ngc registry model download-version \
${NGC_MODEL_PATH}:${NGC_TAG} \
--dest ./model

The command downloads the model to ./model/${MODEL_NAME}_v${NGC_TAG}/. The example produces the following path.

./model/llama-3.1-70b-instruct_vbf16-tool-calling-fix/

Download the Signature File

Create a directory for the signature. Use the same NGC_MODEL_PATH and NGC_TAG values to download the detached signature.

mkdir -p ./signatures
ngc registry model download-version-signature \
${NGC_MODEL_PATH}:${NGC_TAG} \
--dest ./signatures

The command downloads the signature to ./signatures/${MODEL_NAME}_v${NGC_TAG}/result.sigstore. The example produces the following path.

./signatures/llama-3.1-70b-instruct_vbf16-tool-calling-fix/result.sigstore

Download the NVIDIA Public Certificate

Download the NVIDIA public certificate to validate the model’s signature.

curl https://api.ngc.nvidia.com/v2/catalog/models/public-key -o cert.pem

Verify the Signature

Run model_signing verify certificate with the model directory, the signature file, and the NVIDIA public certificate.

model_signing verify certificate \
./model/${MODEL_NAME}_v${NGC_TAG} \
--signature ./signatures/${MODEL_NAME}_v${NGC_TAG}/result.sigstore \
--certificate_chain cert.pem \
--allow_symlinks

For example:

model_signing verify certificate \
./model/llama-3.1-70b-instruct_vbf16-tool-calling-fix \
--signature ./signatures/llama-3.1-70b-instruct_vbf16-tool-calling-fix/result.sigstore \
--certificate_chain cert.pem \
--allow_symlinks

The command prints a confirmation if verification succeeds. If it detects a mismatch or tampering, it prints an error and exits with a nonzero status.

Next Steps

For more information about model signing and the tools used in this workflow, refer to the following resources: