Google Cloud
NIM LLM and VLM supports deployment on Google Cloud Platform (GCP) through two approaches. For a product overview, refer to NVIDIA NIM for LLM and VLM Documentation.
- Google Kubernetes Engine (GKE): Self-managed Kubernetes deployment using Helm charts with complete control over infrastructure, GPU node pools, and persistent storage.
- Vertex AI: Fully managed ML platform with built-in load balancing, auto-scaling, and automatic authentication.
Both deployment strategies can use Google Cloud Storage (GCS) as the backend for model storage. The following table compares GKE and Vertex AI across common deployment considerations:
Deploy on Google Kubernetes Engine (GKE)
To deploy NIM LLM and VLM on Google Kubernetes Engine (GKE), create a GKE cluster with GPU-enabled node pools and prepare your Google Cloud environment for NIM LLM and VLM workloads.
Prerequisites
Before you proceed, complete the following prerequisites:
- Create or use a Google Cloud project with permissions for creating GKE clusters and GPU node pools.
- Confirm sufficient GPU quota in your target region for your chosen GPU type (check in Cloud Console under Quotas).
- Install the following tools:
- Google Cloud SDK
kubectl(install withgcloud components install kubectl)- Helm 3
gke-gcloud-auth-plugin
Authenticate and Enable APIs
Authenticate to Google Cloud, select your project, and enable the required services.
-
Authenticate with the Google Cloud CLI:
-
Set the active project:
-
Authenticate Application Default Credentials:
-
Enable the required APIs:
Set Environment Variables
Set environment variables for your GCP project, region, and NIM deployment. Update the placeholder values with your own:
Create GKE Cluster
Create the network and GKE control plane before you add a GPU node pool for NIM LLM workloads.
Create VPC Network
Create a dedicated VPC network for the GKE cluster:
Create Cluster
Create the GKE cluster in that network:
Add GPU Node Pool
NIM requires GPU nodes. First, check available GPU types in your zone:
Choose a GPU type and count that match your model profile in the Support Matrix for PB NIMs. This example creates a GPU node pool with one NVIDIA A100 80 GB GPU for the Lightning model-specific NIM:
Setting gpu-driver-version=latest triggers automatic NVIDIA driver installation, eliminating the need for a separate DaemonSet.
Get Cluster Credentials
This command fetches the cluster endpoint and authentication credentials from GCP and writes them to your local kubeconfig file (~/.kube/config).
Afterward, kubectl commands target your new cluster.
Verify GPU Availability
Confirm that at least one node advertises GPU capacity:
You should observe at least one node with a GPU count of 1.
Create Secrets
Create the secrets that the deployment uses to pull the container image and access the model repository.
NGC Registry Secret
Create the NGC secrets for image pulls and model access:
-
Create the
ngc-secretregistry secret. -
Create the
ngc-apisecret that stores the NGC API key.
Hugging Face Token for Gated Models
Optional: If you are deploying a gated Hugging Face model, create an additional secret with your Hugging Face token. NGC models and ungated public Hugging Face models do not require a token.
Reference in Helm with model.hfTokenSecret: hf-token.
Helm Deployment
Create one of the following values files based on whether you are deploying a model-specific image, a generic image, or a model stored in GCS.
Model-Specific NIM
Use this option for NIM images built for a specific model, such as NVIDIA Nemotron 3.5 Lightning 30B-A3B.
Create values-gke-prebuilt.yaml:
Model-Free NIM with GCS Storage
Use this option to serve custom or fine-tuned models stored in GCS with standard directory structure.
Save these values as values-gke-model-free.yaml and replace YOUR_BUCKET_NAME with your GCS bucket name.
For NIM_MODEL_PATH with GCS, ensure your model is uploaded with standard directory structure, not percent-encoded keys. Refer to GCS Use Cases: Model-Free vs Repository Override for upload instructions.
Use Workload Identity or a node service account with GCS access so pods can obtain credentials without a key file. To test with a service account key, create the secret in the same namespace:
Append this item to the existing env list in your Helm values file:
Add these top-level Helm values to mount the secret:
The imagePullSecrets examples above list ngc-secret, which only authenticates to nvcr.io. When you deploy an image stored in Artifact Registry, the nodes also need pull access to ${GCP_REGION}-docker.pkg.dev. Use one of the following, in addition to ngc-secret:
-
Grant the node service account
roles/artifactregistry.reader(recommended for production, no token expiry). -
Create an
ar-pulldocker-registrysecret that uses a short-lived access token, then add it toimagePullSecrets:The access token is valid for about one hour, so prefer
roles/artifactregistry.readeron the node service account for long-running deployments.
Install the Helm Release
Follow Fetch the Helm Chart to download and extract a PB7-compatible chart. From the parent directory of the extracted nim-llm/ chart, install the release:
For the generic (model-free) image, use -f values-gke-model-free.yaml instead.
Monitor Deployment
Monitor the deployment:
Wait until the pod status is Running and ready.
Configure Network Access
GKE often blocks non-standard ports. Create a firewall rule:
GKE automatically provisions firewall rules for type: LoadBalancer services in most clusters, so this rule is usually not needed. Create allow-nim-8000 manually only if your environment prevents GKE from auto-creating load balancer firewall rules (for example, restricted IAM permissions, a shared VPC, or an org firewall policy). In that case, the LoadBalancer IP is assigned but traffic to port 8000 is dropped, so the health check and chat completion tests appear to hang.
Test the GKE Deployment
Use the following steps to get the service endpoint and verify that the deployment responds to requests.
Get the Endpoint
For LoadBalancer service, wait for the external IP to be assigned:
For ClusterIP service, use port-forward:
Health Check
Confirm the NIM API is up and ready:
Test Chat Completions
Send a test chat completion request and verify inference is working:
For the Model-Free example, change the request’s model field to my-custom-model. To confirm the name your deployment serves, query /v1/models.
Run Helm Tests
Run the suite of Helm chart tests for your release:
View Logs
View real-time logs for your deployed NIM pods:
GKE Model Sourcing Options
Provide an NGC API key through the Helm model.ngcAPISecret value whenever NIM needs to download model files. For gated Hugging Face models, also configure model.hfTokenSecret. A complete local model store can start without an NGC key.
GKE Authentication
GKE supports multiple authentication methods for GCS access:
Workload Identity is the recommended approach for production GKE deployments. It eliminates the need for credential files in pods.
Remove the GKE Resources
Use these steps to remove the deployment and its GKE resources.
To remove the GKE resources, complete the following steps:
Uninstall Helm Release
Uninstall the Helm release:
Delete PVCs
Delete the persistent volume claims:
Delete GKE Cluster
Delete the GKE cluster:
Optional: Delete Firewall Rule
Delete the firewall rule if you created it earlier:
Delete VPC Network
Delete the VPC network:
Deploy on Vertex AI
Vertex AI is a fully managed ML platform that provides load balancing and autoscaling. Application Default Credentials (ADC) give the deployment access to GCS.
To deploy on Vertex AI, complete the following steps.
Key Constraints
Vertex AI has specific requirements that differ from GKE deployments:
Prerequisites
Before you proceed, complete the following prerequisites:
- Create or use a GCP project with permissions for Vertex AI, Artifact Registry, and GCS.
- Confirm sufficient GPU quota in your region for your chosen GPU type (check in Cloud Console under Quotas).
- Install the following tools:
- Google Cloud SDK
- Docker (for pushing images to Artifact Registry)
- Optional:
pip install google-cloud-aiplatformfor Python SDK access
Initial Setup
Complete the following setup steps before you deploy NIM on Vertex AI.
Authenticate and Enable APIs
Authenticate to Google Cloud, select your project, and enable the required services.
-
Authenticate with the Google Cloud CLI:
-
Set the active project:
-
Authenticate Application Default Credentials:
-
Enable the required APIs:
The API must be enabled before proceeding. If you encounter errors indicating that the API is disabled, run the gcloud services enable commands and wait one to two minutes.
Set Environment Variables
Set the environment variables for your Google Cloud resources:
Create GCS Bucket and Grant Access
For a GCS-backed model, create the bucket and grant Vertex AI permission to read from it.
-
Create the bucket:
-
Create the Vertex AI service identity if this is your first Vertex AI deployment in the project:
-
Get the project number:
-
Grant the Vertex AI service agent access to the bucket:
If deployment fails with a permission error for custom-online-prediction@TENANT_ID-tp.iam.gserviceaccount.com, extract the TENANT_ID from the error and grant access:
Create Artifact Registry Repository
Create the Artifact Registry repository, grant Vertex AI access, and configure Docker authentication.
-
Create the repository:
-
Get the project number:
-
Grant the Vertex AI service agent read access to Artifact Registry:
-
Configure Docker authentication for Artifact Registry:
Push NIM Image to Artifact Registry
Copy the PB7 NIM image to Artifact Registry. Choose the image that matches how you plan to register the model.
-
Log in to NGC:
-
Set the source image and tag. Use the model-specific image for its built-in manifest or a GCS mirror. Use the Model-Free image for a custom model in GCS.
-
Pull, tag, and push the image:
Upload Model to GCS
GCS is optional (required only for GCS-backed artifacts or used as a mirror). By default, NIM downloads model artifacts at runtime from the NGC or Hugging Face image manifest given outbound network access. Upload artifacts to GCS only when they are GCS-backed (NIM_REPOSITORY_OVERRIDE or NIM_MODEL_PATH=gs://) or used as an optional mirror. Refer to Model Storage Options for upload instructions.
Register Model in Vertex AI
Register the NIM container as a Vertex AI model. Choose the command for your source. NIM retrieves model files at startup. Set NGC_API_KEY for every remote source, including GCS. ADC grants access to GCS. A model-specific image can download directly from NGC when the endpoint has outbound access.
For the Built-in Manifest (Default)
Use the model-specific PB7 image you pushed to Artifact Registry:
For NIM_REPOSITORY_OVERRIDE
Use the model-specific PB7 image with the GCS bucket prepared by the NGC mirror workflow:
For NIM_MODEL_PATH
Use the PB7 Model-Free image with a compatible model uploaded to GCS in its standard directory structure:
Create Endpoint and Deploy
Choose a Vertex AI configuration with a GPU driver that supports CUDA 13.0 or later. Check GPU availability for your region. Vertex AI compute configuration
The following example uses one NVIDIA A100 80 GB GPU for the Lightning image. For a different model, choose a machine type and GPU count that match your model profile. Complete these steps in the same shell session as the model registration:
-
Create the endpoint:
-
Get the endpoint and model IDs:
-
Deploy the model with the beta CLI to request a minimum GPU driver version.
Test the Vertex AI Endpoint
Vertex AI endpoints are accessed through the Vertex AI REST API using rawPredict:
Use the same SERVED_MODEL_NAME you set when registering the model.
Remove the Vertex AI Resources
Use this section to remove the deployed Vertex AI resources and related artifacts.
To remove the Vertex AI resources, complete the following steps:
Undeploy and Delete Resources
To programmatically clean up your deployed Vertex AI resources and remove related artifacts, you can use the following commands:
Delete Infrastructure
Optional: To fully clean up your project resources—including removing the Artifact Registry repository and deleting all objects and the bucket itself from Google Cloud Storage—run the following commands:
Serve Models from Google Cloud Storage
Use NIM_REPOSITORY_OVERRIDE to serve files from a mirrored model-specific NGC manifest. Use NIM_MODEL_PATH with the Model-Free image to serve a compatible model stored in a standard GCS directory. Both methods require an NGC API key when startup downloads model files, plus credentials that can read the bucket.
NIM_REPOSITORY_OVERRIDE (NGC Mirror)
Run mirror gcs from the PB7 model-specific image. It downloads the manifest’s NGC files and uploads them as percent-encoded GCS keys derived from their original URIs. At startup, NIM rewrites the manifest URIs to those keys and verifies files against the original checksums.
Set GCS_BUCKET to the bucket name without the gs:// prefix. Use a service account key with permission to write to the bucket.
To serve the mirrored model with Docker, use a service account key with read access and set NIM_REPOSITORY_OVERRIDE to the bucket URI. On GKE or Vertex AI, grant bucket access to the workload’s service account and use its ADC credentials instead of mounting a key file.
NIM_MODEL_PATH (Model-Free)
Upload a compatible model’s checkpoint, configuration, and tokenizer files to a GCS prefix with the same directory layout as the local model. NIM generates the model manifest at startup.
Check that config.json is available directly at gs://${GCS_BUCKET}/my-org/my-model/config.json. Run the PB7 Model-Free image and use my-custom-model as the model name in requests.
For GKE or Vertex AI with ADC, use the corresponding deployment examples above. Grant the workload’s service account read access to the GCS prefix.
Comparison
The following table compares the two GCS-based model-loading approaches and highlights when to use each one.
These two approaches use incompatible key formats. Files uploaded with percent-encoding cannot be consumed by NIM_MODEL_PATH=gs:// (expects directory structure), and vice versa.
Authenticate to Google Cloud Storage
GCS supports Application Default Credentials (ADC). Authentication is resolved in the following order:
GOOGLE_APPLICATION_CREDENTIALSenvironment variable pointing to a service account key file- Vertex AI managed environment credentials
- Google Compute Engine (GCE) metadata service
- Cloud Run environment
- gcloud CLI user credentials
Troubleshoot Google Cloud Deployments
Use the following troubleshooting tables to diagnose common deployment issues on GKE and Vertex AI.
GKE Issues
The following table lists common GKE deployment issues and recommended resolutions.
Vertex AI Issues
The following table lists common Vertex AI deployment issues and recommended resolutions.
For additional troubleshooting, refer to Support and FAQ.
Next Steps
Refer to the following Google Cloud documentation for more information:
- Google Kubernetes Engine (GKE) documentation
- Google Vertex AI documentation
- Model Download — Mirror NGC models to GCS or serve with
NIM_MODEL_PATH - About Model-Free NIM — Generic containers with
gs://model paths