---
title: "Verifiable NIM on GPUs"
description: "Run a verifiable NVIDIA NIM on GPUs in a Kata confidential container."
source: "Verifiable Compute"
---
<Tabs syncKey="platform">
  <TabItem label="vNIM">
  An NVIDIA NIM optimized for a specific model. Each vNIM has its model associated with the container.
  </TabItem>
  <TabItem label="LLM vNIM">
  A generic NIM container that lets you specify your own model.
  </TabItem>
</Tabs>
<token-field name="VNIM-APP-NAME" label="Kubernetes application name" default="vnim"></token-field>

<token-field name="NVAPI" label="NVIDIA API key" placeholder="nvapi-"></token-field>
<token-field name="RUNTIME" label="Runtime" default="kata-qemu-nvidia-gpu-tdx" placeholder="kata-qemu-" remember></token-field>
<token-field name="CONTAINER_IMAGE" label="Container registry and image name" default="ghcr.io/eqtylab/vcomp-nim/llama-3.3-nemotron-super-49b-v1.5-eqty:latest" placeholder=""></token-field>
<Tabs syncKey="platform">
  <TabItem label="vNIM">
  </TabItem>
  <TabItem label="LLM vNIM">
    <token-field name="MODEL_NAME" label="Model name" default="vcomp-nim/llama-3.3-nemotron-super-49b-v1.5-eqty:latest" placeholder=""
    optional="true"></token-field>
  </TabItem>
</Tabs>

<details>
<summary>Additional configuration options</summary>

<token-field name="GPU" label="Number of GPUs" placeholder="1" default="1"></token-field>
</details>

**Note:** vNIMs are based on NVIDIA NIMs. You need a GPU to run them and an NVIDIA API key to download them.

## Deploy the vNIM

Save the following pod spec as `{{VNIM-APP-NAME}}.yaml`:

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: {{VNIM-APP-NAME}}
  labels:
    app: {{VNIM-APP-NAME}}
  namespace: default
  annotations:
    io.katacontainers.config.hypervisor.default_memory: "65536"
    io.katacontainers.config.hypervisor.default_vcpus: "16"
spec:
  runtimeClassName: {{RUNTIME}}
  containers:
    - name: {{VNIM-APP-NAME}}-app

      # Works around a mismatch between the NIM's file permissions and its running user.
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000

      image: {{CONTAINER_IMAGE}}
      env:
        - name: NGC_API_KEY
          value: "{{NVAPI}}"
        # Enable notary-signed assets
        - name: EQTY_NOTARY
          value: vcomp-coco
      resources:
        requests:
          nvidia.com/pgpu: {{GPU}}
        limits:
          nvidia.com/pgpu: {{GPU}}
```

<Tabs syncKey="platform">
  <TabItem label="vNIM">
  </TabItem>
  <TabItem label="LLM vNIM">
    LLM vNIM requires additional environment variables.
    Add these to the `env` section above. `HF_TOKEN` is optional. 
    
    **REMINDER** `NIM_MODEL_PATH` should start with a uri like `hf://` to tell the NIM where the model is.

```yaml
        - name: NIM_MODEL_PATH
          value: {{MODEL_NAME}}
        - name: HF_TOKEN # optional
          value: hf.... # optional
```
  </TabItem>
</Tabs>

Apply it to the cluster:

```bash
kubectl apply -f {{VNIM-APP-NAME}}.yaml
```

<Tabs syncKey="platform">
  <TabItem label="Bare Metal">
```yaml
---
apiVersion: v1
kind: Service
metadata:
  name: simple-py
spec:
  type: NodePort
  selector:
    app: simple-py
  ports:
    - port: 8000
      targetPort: 8000
      nodePort: 30800
```
  </TabItem>
  <TabItem label="Azure (AKS)">
```yaml
---
apiVersion: v1
kind: Service
metadata:
  name: simple-py
spec:
  type: LoadBalancer
  selector:
    app: simple-py
  ports:
    - port: 8080
      targetPort: 8080
```
  </TabItem>
</Tabs>

## Test the vNIM

```bash
curl localhost:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"model":"{{MODEL_NAME}}","messages":[{"role":"user","content":"hi"}]}'
```