Skip to main content
In this tutorial, you deploy an NVIDIA NIM on a CoreWeave Kubernetes Service (CKS) cluster. NIM microservices package optimized large language models (LLMs) as production-ready container images, which lets you serve GPU-accelerated inference without building a custom model server. This tutorial is for Kubernetes users who want to run LLM inference on CoreWeave. By the end, you have a running LLM inference endpoint and have queried it with the OpenAI-compatible chat completions API.

Prerequisites

Before you start, you must have:
  • A CKS cluster with at least one x86 (amd64) GPU node. NVIDIA NIM containers require x86 architecture. This tutorial uses an L40 GPU, but any NVIDIA GPU with 16 GB or more of VRAM works.
  • kubectl installed and connected to your cluster.
  • An NVIDIA NGC account and API key. To generate an API key, sign in to NGC and go to your profile dropdown > Setup > API Keys.

Set your NGC API key

Export your NGC API key as an environment variable. The commands in this tutorial reference this variable when creating Kubernetes Secrets.

Verify cluster access

Confirm that kubectl can reach your cluster and that GPU nodes are available:
You should see output similar to the following:
Verify that at least one node has an NVIDIA GPU:
You should see output similar to the following, with at least one node showing nvidia.com/gpu in its capacity:

Create NGC secrets

NIM containers are hosted on NVIDIA’s NGC registry (nvcr.io). To authenticate with NGC, you must create two Kubernetes Secrets: one to pull the container image, and one for the NIM runtime to download model weights.
You should see output similar to the following:
Create a second Secret to provide the NGC API key to the NIM runtime:
You should see output similar to the following:
With the Secrets in place, the cluster can authenticate to NGC to pull the NIM container image and download model weights.

Deploy the NIM

With authentication configured, deploy the NIM itself. Save the following manifest as nim-hello-world.yaml. This manifest defines a single-replica Deployment with one GPU and a ClusterIP Service that exposes the inference API on port 8000.
nim-hello-world.yaml
If your cluster uses a different GPU type, adjust the nodeSelector to match. Use kubectl get nodes -o jsonpath='{.items[*].metadata.labels.gpu\.nvidia\.com/class}' to see available GPU classes.
Apply the manifest to create the Deployment and Service:
You should see output similar to the following:

Wait for the NIM to become ready

The Deployment and Service exist, but the NIM container must download model weights before it can serve traffic. On first start, this can take several minutes depending on model size and network speed. To check Pod status, list the Pods with the nim-hello-world label:
You should see output similar to the following once the model is loaded:
If the Pod restarts during startup, the liveness probe might trigger before the model finishes loading. Increase initialDelaySeconds on the liveness probe, or check logs with kubectl logs -n default -l app=nim-hello-world --tail=50.
Now that the NIM is running and healthy, you can send it inference requests.

Query the NIM

Send a chat completion request to the NIM. The API is compatible with the OpenAI Chat Completions format. Because the Service type is ClusterIP, you can only reach the endpoint from within the cluster. The following command uses a temporary Pod to send the request:
You should see a JSON response similar to the following:
At this point, you have a working NIM inference endpoint running on your CKS cluster. You have authenticated to NGC, deployed the model, and confirmed it responds to chat completion requests.

Clean up

When you’re done, remove the Deployment, Service, and Secrets so the GPU node and credentials are no longer in use.

Next steps

Now that you have a working NIM deployment, explore these options:
  • Try a different model. Replace the image and model name in the manifest to deploy any NIM-supported model.
  • Add autoscaling. See the Deploy vLLM for inference tutorial for patterns using KEDA and Prometheus-based autoscaling.
  • Expose externally. Add an Ingress or LoadBalancer Service to serve inference requests from outside the cluster.
Last modified on June 10, 2026