Skip to content

AI/ML Model Inference on GKE

This page describes the key concepts, benefits, and steps for running generative AI/ML model inference workloads on Google Kubernetes Engine (GKE), using GKE Gen AI capabilities.

Overview

Inference serving is critical in deploying your generative AI models to real-world applications. GKE provides a robust and scalable platform for managing your containerized workloads, making it a compelling choice for serving your models in development or production.

Terminology

TermDefinition
InferenceThe process of running a generative AI model to generate text, embeddings, or other outputs from input data
ModelA generative AI model that has learned patterns from data and is used for inference
Model ServerA containerized service responsible for receiving inference requests and returning inferences (e.g., vLLM, JetStream, TensorFlow Serving, Triton)
AcceleratorSpecialized hardware (GPUs, TPUs) attached to GKE nodes to speed up computations
QuantizationA technique to reduce model size and improve inference speed by converting to lower-precision data types

Benefits of GKE for Inference

How Inference on GKE Works

Step-by-Step Process

  1. Containerize your model: Create a container image with your model server (vLLM, etc.) and load model weights from Cloud Storage or Hugging Face

  2. Create a GKE cluster: Create a cluster (Autopilot or Standard) and configure accelerators

  3. Deploy as Kubernetes Deployment: Create a Deployment specifying the Docker image, replicas, and settings

  4. Expose your inference service: Create a Service for network access. Use Inference Gateway for intelligent load balancing

  5. Handle inference requests: Send data to your Service's endpoint in the expected format (JSON, gRPC)

  6. Scale and monitor: Use HPA to automatically adjust replicas based on CPU or latency

GKE Gen AI Capabilities

FeatureDescriptionBenefits
GKE Inference QuickstartAnalyze performance and cost-efficiency. Get tailored best practices for accelerators, scaling, storage, and model serversSaves time, maintains full control
GKE Inference GatewayRouting based on metrics like KV cache utilization for better latencyLoRA support, high availability, Model Armor security
Model Weight Loading AcceleratorsFast data access with Cloud Storage FUSE, Managed Lustre, or Hyperdisk MLOptimized startup time, minimal loading latency

Inference Performance Metrics

CategoryMetricDescription
LatencyTime to First Token (TTFT)Time to generate the first token
LatencyTime Per Output Token (TPOT)Time to generate one output token
LatencyInter-token Latency (ITL)Latency between two token generations
LatencyRequest LatencyEnd-to-end time to complete a request
ThroughputRequests per secondTotal requests served per second
ThroughputOutput tokens/secondTotal output tokens generated per second
ThroughputTotal tokens/secondCombined input and output tokens per second

Inference Examples

GPU Examples

Model ServerTutorial
vLLMServe LLMs like DeepSeek-R1 671B or Llama 3.1 405B on GKE
vLLMServe Gemma open models using GPUs on GKE with vLLM
vLLMServe an LLM with GKE Inference Gateway
Ray ServeServe an LLM on L4 GPUs with Ray
TGIServe an LLM with multiple GPUs in GKE
TorchServeServe T5 on GKE with TorchServe

TPU Examples

Model ServerTutorial
vLLMServe an LLM using TPU Trillium on GKE with vLLM
vLLMServe an LLM using TPUs on GKE with KubeRay
MaxDiffusionServe Stable Diffusion XL using TPUs on GKE
vLLMServe LLMs using multi-host TPUs

Getting Started

  1. Go to the GKE AI/ML page in Google Cloud console
  2. Try the Deploy Models steps to deploy a containerized model and model server
  3. Read Overview of inference best practices on GKE

Last updated: December 2025

Built with VitePress & Mermaid diagrams