Powering Production-Ready AI Platforms: Serving Gemma LLMs on GKE with vLLM at Scale

Powering Production-Ready AI Platforms: Serving Gemma LLMs on GKE with vLLM at Scale

Powering Next-Gen AI: Serving Gemma LLMs on GKE with vLLM at Scale

The landscape of Artificial Intelligence is undergoing a seismic shift, largely driven by the advent of powerful Large Language Models (LLMs). These models are unlocking unprecedented capabilities in natural language understanding, generation, and reasoning. However, translating their potential into real-world applications hinges on the ability to serve them efficiently, reliably, and at scale. This is where the convergence of cutting-edge models, optimized serving frameworks, and robust infrastructure becomes paramount.

This detailed article provides a comprehensive guide to deploying Google’s Gemma open models on Google Kubernetes Engine (GKE) using the vLLM serving framework, with a strong emphasis on achieving production readiness. It will navigate from the foundational steps of deployment to advanced strategies for automation, observability, and continuous improvement. The objective is not merely to serve an LLM, but to architect a solution that is scalable, resilient, secure, cost-effective, and maintainable in demanding production environments.

We will conclude the article by exploring how Drizzle:AI can transform the basic implementation outlined in this guide into a fully production-ready solution, leveraging best practices and operational excellence principles to accelerate your AI journey.

The Trifecta for High-Performance Inference: Gemma, vLLM, and GKE with GPUs

The choice of model, serving engine, and infrastructure forms the bedrock of any successful LLM deployment.

  • Gemma: Google’s Gemma family represents a significant step in democratizing access to state-of-the-art LLMs. These are lightweight, open models built from the same research and technology underpinning the Gemini models. Gemma models, such as the recently introduced Gemma 3, offer compelling capabilities including multimodality (supporting vision-language input and text outputs), extensive context windows (up to 128,000 tokens), support for over 140 languages, and improved math, reasoning, and chat functionalities. Their open nature allows for broader adoption and fine-tuning for specialized tasks.

  • vLLM: To unleash the full potential of models like Gemma, an optimized serving framework is crucial. vLLM is an open-source LLM serving engine designed for high throughput and efficiency. Its key innovations include PagedAttention, which effectively manages the memory-intensive Key-Value (KV) cache, continuous batching to maximize GPU utilization, and optimized CUDA kernels. vLLM also supports tensor parallelism, enabling the distribution of large models across multiple GPUs.

  • GKE & GPUs: Google Kubernetes Engine (GKE) provides a managed, production-grade environment for deploying, managing, and scaling containerized applications, including demanding AI/ML workloads. When paired with NVIDIA GPUs (such as H200, H100, A100, and L4 options available on GKE), it offers the computational horsepower necessary for low-latency, high-throughput LLM inference.

The synergy between Gemma’s advanced capabilities, vLLM’s serving optimizations, and GKE’s scalable infrastructure creates a powerful trifecta for LLM inference. This combination effectively lowers the barrier to entry for deploying sophisticated AI, making powerful tools more accessible. However, this accessibility also elevates the expectations for operational excellence. While initiating a deployment might be straightforward, achieving and maintaining a production-grade service that is truly scalable, cost-efficient, and reliable requires a deeper understanding of the underlying components and best practices. Mastering the operational aspects of such deployments is becoming a key differentiator.

A fundamental decision early in this journey involves the choice of GKE cluster mode: Autopilot or Standard. Autopilot offers a fully managed experience where GKE handles node provisioning and management, simplifying operations. Standard mode, conversely, provides greater control over the underlying node infrastructure, allowing for more granular customization.This choice has significant implications throughout the LLM lifecycle, affecting cost structures (Autopilot’s pay-per-pod versus Standard’s pay-per-node ), operational overhead, and the extent of possible optimizations. Teams must weigh their Kubernetes expertise, operational capacity, and cost sensitivity when making this decision, as it will influence subsequent choices regarding node pools, scaling strategies, and resource management.

Foundations: Deploying Gemma with vLLM on GKE and GPUs

This section details the core steps to get a Gemma model up and running with vLLM on a GKE cluster equipped with GPUs, based on the procedures outlined by Google Cloud.

Gearing Up: Essential Prerequisites

Before embarking on the deployment, several prerequisites must be met:

  • Google Cloud Project: A Google Cloud project with billing enabled is necessary. Required APIs, such as the Compute Engine API and Kubernetes Engine API, must also be enabled.

  • IAM Roles: The user or service account performing the setup needs appropriate Identity and Access Management (IAM) roles. Specifically, roles/container.admin is required for GKE cluster creation and management, and roles/iam.serviceAccountAdmin may be needed for managing service accounts, particularly if using Workload Identity.

  • Hugging Face Account: Accessing Gemma models often involves a Hugging Face account. Users must typically agree to the model’s license terms and generate an access token with at least Read permissions to download model weights. This token is crucial for the vLLM deployment.

  • GPU Quota: Sufficient GPU quota for the chosen GPU type (e.g., NVIDIA L4, A100) in the desired Google Cloud region is critical. This is a common oversight that can halt deployment; checking and requesting quota increases ahead of time is recommended.

  • Cloud Shell Environment: Using Google Cloud Shell is advisable for executing commands, as it comes pre-installed with the gcloud command-line tool and kubectl. Key environment variables like PROJECT_ID, REGION, CLUSTER_NAME, and the HF_TOKEN (Hugging Face token) should be set for convenience.

Crafting Your GKE Cluster and GPU Node Pools

With prerequisites in place, the next step is creating the GKE cluster and configuring GPU-enabled node pools.

  • Autopilot Mode: For a more managed experience, GKE Autopilot can automatically provision and manage nodes, including GPU nodes, based on workload requests. A cluster can be created using:

    gcloud container clusters create-auto CLUSTER_NAME \ 
    --project=PROJECT_ID \  
    --region=REGION \
    --release-channel=rapid  

    While simpler, this mode offers less direct control over node configurations.

  • Standard Mode: For greater control, Standard mode allows explicit definition of node pools.

    1. Create the Standard Cluster:

      gcloud container clusters create CLUSTER_NAME \ 
      --project=PROJECT_ID  
      --region=REGION  
      --workload-pool=PROJECT_ID.svc.id.goog \ 
      --release-channel=rapid \ 
      --num-nodes=1 \# Initial CPU node pool 

      Enabling Workload Identity (—workload-pool) is a security best practice, allowing Kubernetes service accounts to impersonate Google Cloud service accounts.

    2. Create a GPU Node Pool: The configuration of the GPU node pool depends on the Gemma model size. Examples from :

      • Gemma 3 1B/4B (L4 GPU): Suitable for g2-standard-8 machine type with one L4 GPU.

        gcloud container node-pools create gpupool \ 
        --accelerator
        type=nvidia-l4,count=1,gpu-driver-version=latest \ 
        --project=PROJECT_ID \ 
        --location=REGION \ 
        --node-locations=REGION-a \ 
        --cluster=CLUSTER_NAME \ 
        --machine-type=g2-standard-8 \ 
        --num-nodes=1
      • Gemma 3 12B (Four L4 GPUs): Requires a larger machine type like g2-standard-48.

        gcloud container node-pools create gpupool \ 
        --accelerator
        type=nvidia-l4,count=4,gpu-driver-version=latest \ 
        \#\... other params as above\...  
        --machine-type=g2-standard-48
        
      • Gemma 3 27B (One A100 80GB GPU): Needs a powerful a2-ultragpu-1g machine type and potentially larger, faster disk.

        gcloud container node-pools create gpupool \ 
        --accelerator type=nvidia-a100-80gb,count=1,gpu-driver-version=latest \ 
        #... other params as above...  
        --machine-type=a2-ultragpu-1g \ 
        --disk-type=pd-ssd 
        --disk-size=256

It’s important to note the --gpu-driver-version=latest parameter. While convenient for tutorials, production environments benefit from pinning to a specific, tested driver version. “Latest” is a dynamic tag, and an automatic update to a newer driver could inadvertently introduce incompatibilities with the CUDA toolkit version used by vLLM or the model itself, potentially leading to instability or performance regressions. For production stability, identifying and specifying a fixed driver version that is validated with the chosen vLLM container and CUDA version is a recommended practice.

  • Kubernetes Secret for Hugging Face Token: To securely provide the Hugging Face token to vLLM pods:

    1. Configure kubectl to communicate with the cluster:

      gcloud container clusters get-credentials CLUSTER_NAME \ 
      --location=REGION
    2. Create a Kubernetes Secret:

      kubectl create secret generic hf-secret \ 
      --from-literal=hf_api_token=\${HF_TOKEN} \ 
      --dry-run=client -o yaml \| kubectl apply -f - 

Note: This secret will be mounted into the vLLM pods.

Deploying vLLM with Gemma: Manifests and Considerations

The vLLM server is deployed as a Kubernetes Deployment. The manifest specifies the vLLM container image, model to serve, resource requests, and other configurations. A typical manifest structure includes :


apiVersion: apps/v1  
kind: Deployment  
metadata:  
name: vllm-gemma-deployment  
spec:  
replicas: 1  
selector:  
matchLabels:  
app: gemma-server  
template:  
metadata:  
labels:  
app: gemma-server  
ai.gke.io/model: google/gemma-3-4b-it \# Example  
ai.gke.io/inference-server: vllm  
spec:  
containers:  
- name: inference-server  
image: vllm/vllm-openai:latest \# Or a specific version  
env:  
- name: MODEL_ID  
value: "google/gemma-3-4b-it" # Matches the label  
- name: HUGGING_FACE_HUB_TOKEN  
valueFrom:  
secretKeyRef:  
name: hf-secret  
key: hf_api_token  
args:  
- "--model=$(MODEL_ID)"  
- "--tensor-parallel-size=1"  
# Add model-specific args like --max-model-len, --max-num-seqs  
ports:  
- containerPort: 8000  
resources:  
limits:  
nvidia.com/gpu: "1" # Adjust based on model and
tensor-parallel-size  
cpu: "2"  
memory: "20Gi"  
ephemeral-storage: "20Gi"  
requests: # Typically same as limits for GPUs  
nvidia.com/gpu: "1"  
cpu: "2"  
memory: "20Gi"  
ephemeral-storage: "20Gi"  
# Volume mounts if needed for pre-downloaded models

Model-Specific Configurations:

The arguments and resource requests in the vLLM deployment vary significantly based on the Gemma model being served.

Gemma ModelGPU(s) (Type, Count)GKE Machine Type (Example)Key vLLM ParametersEst. Resources (CPU, Mem, Storage)
Gemma 3 1B-itL4, 1g2-standard-8tensor-parallel-size=12 CPU, 10Gi Mem, 10Gi Storage
Gemma 3 4B-itL4, 1g2-standard-8tensor-parallel-size=1, —max-model-len=32768, —max-num-seqs=42 CPU, 20Gi Mem, 20Gi Storage
Gemma 3 12B-itL4, 2 (or A100)g2-standard-48tensor-parallel-size=2 (for 2xL4), —max-model-len=16384, —max-num-seqs=44 CPU, 32Gi Mem, 32Gi Storage
Gemma 3 27B-itA100 80GB, 1a2-ultragpu-1gtensor-parallel-size=1, —swap-space=16, —gpu-memory-utilization=0.95, —max-model-len=32768, —max-num-seqs=410 CPU, 128Gi Mem, 120Gi Storage
          Table 1: Gemma Model Deployment Configurations on GKE 

Deployment Notes:

  1. Parameters like --max-model-len and --max-num-seqs are crucial for managing memory and concurrency.

  2. The values provided are good starting points, but they are highly dependent on the specific model variant and the expected workload characteristics (e.g., average prompt and completion lengths, desired batch sizes).

  3. Optimal values often require experimentation and tuning based on observed performance and resource utilization in a specific use case.

  4. For instance, a larger max-model-len allows for longer contexts but consumes more KV cache memory per sequence, potentially reducing the number of concurrent sequences (max_num_seqs) that can be processed.

  5. This represents a trade-off between handling very long contexts for a few users versus supporting more users with shorter contexts.

  6. The deployment process involves applying the manifest e.g. kubectl apply -f vllm-gemma-deployment.yaml and then waiting for the pods to become ready.

  7. It is essential to monitor the pod logs (kubectl logs -f -l app=gemma-server) to ensure the model weights are downloaded successfully and the vLLM server starts without errors.

  8. The initial model download can take several minutes depending on the model size and network speed.

But Is This Good Enough for Production?

The approach outlined so far in this section focuses on deploying pre-built vLLM containers and loading model weights directly from Hugging Face at runtime. This indeed simplifies the initial setup. However, for production environments, organizations often require greater control. This includes:

  • Custom Container Images: Building container images that bundle specific dependencies, security hardening measures, or pre-downloaded model weights. This accelerates startup times and ensures consistency across deployments.

  • Enhanced Security: Incorporating security measures such as vulnerability scanning, binary authorization, and hardened base images to mitigate risks.

  • Optimized Performance: Pre-downloading model weights to high-performance storage (e.g., SSD-backed PersistentVolumeClaims) or embedding them directly into the container image to reduce runtime delays.

These practices align with production-grade requirements, ensuring reliability, scalability, and security while minimizing operational risks.

Exposing and Testing Your Gemma Service

Once the vLLM deployment is running, it needs to be exposed for inference requests.

  1. Create a Kubernetes Service: A Service (e.g., ClusterIP for internal access, LoadBalancer for external access) exposes the vLLM deployment.

    apiVersion: v1  
    kind: Service  
    metadata:  
    name: llm-service  
    spec:  
    selector:  
    app: gemma-server  
    ports:  
    - protocol: TCP  
    port: 8000  
    targetPort: 8000  
    type: LoadBalancer \# Or ClusterIP
  2. Port Forwarding (for local testing with ClusterIP):

    kubectl port-forward service/llm-service 8000:8000  

    This command forwards traffic from the local machine to the service running in the cluster.

  3. Interacting with curl: Send a chat completion request (OpenAI API compatible):

    curl http://localhost:8000/v1/chat/completions \ 
    -H "Content-Type: application/json" \ 
    -d '{  
    "model": "google/gemma-3-4b-it",  
    "messages": [  
    {"role": "user", "content": "Explain the concept of
    PagedAttention in vLLM."}  
    ]  
    }'
  4. (Optional) Gradio Chat Interface: For a more interactive testing experience, a Gradio web interface can be deployed. This typically involves a separate Deployment and Service for the Gradio application, configured to point to the vLLM service endpoint.

Fortifying Your Deployment: Achieving Production Readiness

Deploying a model is just the first step. Ensuring it runs reliably, scales efficiently, performs optimally, remains secure, and operates cost-effectively in a production environment requires careful consideration of several key areas.

The Pillars of Production LLM Serving

Production readiness for LLM serving rests on five critical pillars:

  1. Scalability: The ability to handle varying loads and grow with demand.

  2. Reliability & High Availability: Ensuring the service remains operational and resilient to failures.

  3. Performance: Delivering low latency and high throughput.

  4. Cost Optimization: Maximizing resource utilization and minimizing expenditure.

  5. Security: Protecting the model, data, and infrastructure from

  6. Observability: Comprehensive observability are essential for understanding system behavior, diagnosing issues, and optimizing performance.

Scalability Strategies: Meeting Fluctuating Demand

LLM inference workloads can be bursty and unpredictable. A robust scaling strategy is essential.

  • Horizontal Pod Autoscaler (HPA): HPA automatically adjusts the number of vLLM pod replicas based on observed metrics. For LLMs, relying solely on CPU or generic GPU utilization can be misleading. It is far more effective to use vLLM-specific metrics exposed by the server, such as vllm:num_requests_running (number of requests currently being processed by the GPU) or vllm:num_requests_waiting (number of requests in the queue).
    Care must be taken when configuring HPA. For instance, scaling based only on vllm:num_requests_waiting can lead to "flapping" (rapid scaling up and down) if the system quickly processes the queue and then scales down prematurely. A more stable approach might involve a combination of metrics or custom metrics that reflect sustained load. HPA configurations should also include appropriate stabilization windows to prevent overly aggressive scaling reactions to transient metric fluctuations.

  • GKE Cluster Autoscaler (CAS): While HPA manages pod replicas, CAS manages the number of nodes in GPU node pools. When HPA scales up pods beyond the capacity of existing nodes, CAS provisions new GPU nodes. Conversely, it removes underutilized nodes. Setting appropriate minimum and maximum node counts for CAS is crucial for balancing availability and cost.

  • Node Auto-Provisioning (NAP): For more complex scenarios with diverse workload requirements, GKE’s Node Auto-Provisioning can automatically manage the creation and scaling of various node pool types, beyond those manually defined.

  • GKE Inference Quickstart: This GKE feature, aims to provide tailored best practices and configurations, including auto-generated scaling recommendations based on business needs. As it matures, it could simplify setting up effective scaling.

Ensuring Reliability & High Availability: Keeping the Service Robust

Maintaining continuous service availability is paramount for production systems.

  • Node Pool Design for Resilience: Configure GPU node pools to span multiple zones within a region (e.g., using --node-locations=REGION-a,REGION-b in gcloud container node-pools create commands ). This protects the service from outages affecting a single zone. However, GPU availability can vary across zones, so this needs to be factored into planning.

  • Resource Obtainability: Ensuring access to specialized resources like GPUs is critical.

    • Reservations: For critical production workloads, creating reservations for specific GPU types guarantees capacity, mitigating the risk of stockouts.

    • Spot VMs: These offer significant cost savings but can be preempted.They are suitable for fault-tolerant workloads or less critical environments. Strategies to handle preemptions, such as diverse instance types or fallback to on-demand, are necessary. Google Cloud offers smaller A3 High VMs with NVIDIA H100 GPUs (1g, 2g, or 4g) that support Spot VMs for cost-effective scaling.

    • Dynamic Workload Scheduler & Custom Compute Classes: GKE offers features for more granular control over resource allocation and fallback options to improve obtainability.

  • Pod Disruption Budgets (PDBs): PDBs limit the number of concurrently unavailable pods from a replicated application during voluntary disruptions (e.g., node upgrades, maintenance). This is essential for ensuring a minimum number of vLLM instances remain serving.

  • Graceful Pod Termination: Applications should handle the SIGTERM signal gracefully, allowing in-flight inference requests to complete before the pod shuts down. This involves configuring terminationGracePeriodSeconds appropriately in the Pod spec.

  • GKE Inference Gateway (Preview): This upcoming GKE feature aims to enhance high availability by enabling dynamic access to GPU and TPU capacity across regions and providing intelligent routing based on metrics like KV cache utilization.

  • Node Upgrade Strategies: GKE automates much of the node upgrade process. However, GPUs do not support live migration, meaning pods on nodes undergoing maintenance will be restarted. Strategies like surge upgrades (faster, but can briefly impact service) or blue-green upgrades (near-zero downtime, suitable for real-time inference) should be considered. GKE notifications can help prepare for such disruptions.

Performance Tuning Deep Dive: Squeezing Every Ounce of Power

Optimizing LLM inference performance involves tuning at multiple levels.

  • Optimal Machine and GPU Selection: As discussed in Table 1, matching accelerator memory and compute power to the model size and quantization level is fundamental. NVIDIA L4 GPUs are cost-effective for smaller models, while A100 or H100 GPUs are better suited for larger ones. Kubernetes node labels can be used to schedule pods onto nodes with specific GPU types, and resource limits ensure dedicated GPU access.

  • vLLM Parameter Tuning: Beyond the initial setup, several vLLM parameters can be tuned for optimal performance:

    • gpu_memory_utilization: This controls the percentage of GPU memory vLLM pre-allocates for the KV cache. A higher value provides more space for KV cache, potentially improving throughput for long sequences or larger batches, but leaves less for model weights.

    • max_num_seqs and max_num_batched_tokens: These parameters influence the maximum number of sequences processed concurrently and the total number of tokens in a batch, respectively. They directly impact batch size, concurrency, and memory usage.

    • tensor_parallel_size and pipeline_parallel_size: For models too large to fit on a single GPU, these parameters enable sharding the model weights (tensor_parallel_size) or distributing layers (pipeline_parallel_size) across multiple GPUs, increasing available memory per GPU for KV cache.

    • Chunked Prefill: vLLM offers an experimental feature called chunked prefill, which breaks down large prefill computations into smaller chunks. These chunks can then be batched with decode requests, potentially improving inter-token latency (ITL) and overall GPU utilization by better overlapping compute-bound prefill operations with memory-bound decode operations. Enabling this feature (--enable-chunked-prefill) changes the scheduling policy to prioritize decode requests. Performance can be tuned by adjusting max_num_batched_tokens (default 2048, which is optimized for ITL; larger values may improve throughput).

    • Preemption Handling: If vLLM frequently preempts requests due to insufficient KV cache space, strategies include increasing gpu_memory_utilization, decreasing max_num_seqs or max_num_batched_tokens, or increasing tensor/pipeline arallelism

  • Key Performance Indicators (KPIs): Monitoring specific KPIs is crucial for understanding and optimizing performance

    • Latency: Time to First Token (TTFT), Normalized Time Per Output Token (NTPOT), Time Per Output Token (TPOT), Inter-Token Latency (ITL), and overall request latency.

    • Throughput: Requests Per Second (RPS), Output tokens per second.

  • Model Server Optimization Techniques: vLLM inherently uses techniques like request batching and PagedAttention for efficient memory management and attention computation, which are key to low latencies.

  • Quantization: Although detailed implementation is beyond this scope, model quantization (reducing the precision of model weights) is a powerful technique to decrease model size and improve serving efficiency, thereby reducing resource requirements and potentially cost.

  • Optimizing Application Startup: Minimizing the time it takes for a vLLM pod to become ready is important, especially during scaling events.

    • Container Image Pull: Use optimized base images and consider GKE’s image streaming feature if available to accelerate image pulls.

    • Model Weight Loading: Pre-downloading model weights to a PersistentVolumeClaim (PVC) backed by high-performance SSD, building custom images with embedded weights, or optimizing loading from Google Cloud Storage can significantly reduce startup times compared to downloading from Hugging Face on every pod start.

Cost Optimization Tactics: Serving LLMs Without Breaking the Bank

LLM serving can be expensive due to accelerator usage. Several tactics can help manage costs:

  • Efficient Resource Utilization: This is the cornerstone of cost optimization. Avoid idling expensive GPU resources.

  • Right-Sizing Instances and GPUs: Select machine types and GPU configurations that closely match the model’s requirements without significant overprovisioning. GKE Inference Quickstart can provide recommendations.

  • Autoscaling: Dynamically adjusting pod replicas (HPA) and node counts (CAS) based on actual demand prevents paying for unused capacity.

  • Spot VMs: Leveraging Spot VMs for GPU nodes can lead to substantial savings (60-90% discounts). However, this requires workloads to be fault-tolerant, as Spot VMs can be preempted with short notice. Strategies for managing interruptions, such as using managed instance groups that can recreate Spot VMs or having a fallback to on-demand instances, are essential.

  • Committed Use Discounts (CUDs): For predictable, steady-state workloads running on Standard GKE nodes, CUDs offer significant discounts (up to 30% for 1-year, more for 3-year commitments) in exchange for committing to a certain level of resource usage.

  • GKE Autopilot vs. Standard Mode Cost Implications: Autopilot mode bills per pod based on CPU, memory, and ephemeral storage requests, offering operational simplicity. Standard mode bills per node (VM instance costs), providing more control and opportunities for cost savings through techniques like bin packing (densely packing pods onto fewer nodes).

  • Request Batching: vLLM’s continuous batching inherently improves GPU utilization by processing multiple requests together, which lowers the amortized cost per inference.

  • Fractional GPUs / GPU Sharing: While vLLM typically dedicates GPUs to its instances, it’s worth noting that Kubernetes supports GPU sharing mechanisms like NVIDIA Multi-Instance GPU (MIG) or time-slicing for certain workloads. These might be relevant for other components in the ML system or if future vLLM versions offer more granular GPU sharing.

  • Monitoring Spending: Utilize GKE usage metering and Google Cloud billing dashboards to track costs and identify areas for optimization.

Security Best Practices for LLM Serving on GKE

Securing LLM deployments involves protecting the infrastructure, the model, and the data.

  • Principle of Least Privilege: Grant only necessary permissions to users and service accounts via IAM and Kubernetes RBAC.

  • Role-Based Access Control (RBAC): Use Kubernetes RBAC for granular control over access to cluster resources. Manage users via groups for easier administration.

  • Network Policies: Implement network policies to restrict pod-to-pod communication and control traffic flow to and from external services. A default-deny policy, allowing only explicitly permitted traffic, is a strong security posture.

  • Private GKE Clusters: Enhance security by ensuring nodes have private IP addresses and the control plane is accessible only within the cluster’s Virtual Private Cloud (VPC) or via a specified private connection.

  • Shielded GKE Nodes: These nodes provide verifiable integrity of the node’s boot process and runtime kernel, protecting against rootkits and bootkits using secure boot and a virtual Trusted Platform Module (vTPM).

  • Regular GKE Upgrades: Keep GKE control plane and worker nodes updated with the latest security patches and Kubernetes versions. GKE offers automated upgrades and node auto-upgrade features.

  • Secret Management: For sensitive data like API keys (including the Hugging Face token), use robust secret management solutions like Google Cloud Secret Manager or HashiCorp Vault, integrated with application-layer secret encryption using Cloud KMS, rather than relying solely on unencrypted Kubernetes Secrets.

  • Container Image Security: Scan container images for vulnerabilities using tools like Google Artifact Registry scanning. Use minimal, trusted base images and ensure images contain only necessary components.

  • Binary Authorization: Enforce policies that only allow attested, approved container images to be deployed to GKE, providing a strong defense against running unauthorized or compromised code.

  • Model Armor: This GKE add-on, often mentioned with Inference Gateway, provides policies to enhance the security of the models themselves.

  • Disable Kubernetes Dashboard: If not essential for operations, the Kubernetes web UI should be disabled as it can be an additional attack surface.

  • CIS Benchmarks for GKE: Align GKE configurations with the Center for Internet Security (CIS) Benchmarks, which provide standardized security guidelines for Kubernetes.

Balancing Performance, Cost, and Reliability

Achieving production readiness involves a careful balancing act. Optimizing for performance, such as increasing tensor_parallel_size to handle larger models, directly impacts cost due to increased GPU requirements. Similarly, relying heavily on Spot VMs for cost savings introduces reliability trade-offs that must be mitigated with robust fault-tolerance mechanisms.

There is no one-size-fits-all configuration; the optimal setup depends on the specific application’s Service Level Objectives (SLOs), budget, and risk tolerance.

Furthermore, the GKE ecosystem for AI/ML is rapidly evolving. Features like Inference Quickstart, Inference Gateway, and Model Armor are often introduced in Preview. While these tools promise to automate and simplify many best practices, their preview status means they might be subject to change and may not yet have full production SLAs. Teams should carefully evaluate the current status and capabilities of such features before adopting them for critical workloads.

At Drizzle:AI, we help our customers navigate these production risks with confidence, leveraging battle-tested solutions and proven strategies. Our expertise ensures that you can adopt cutting-edge technologies while maintaining reliability, scalability, and security in your deployments. Keeping an eye on the development of these features is essential, as they can significantly enhance future deployments, and we are here to guide you every step of the way.

Extending Security Beyond Infrastructure

Security for LLMs extends beyond infrastructure hardening. While this guide focuses on GKE and vLLM security, a comprehensive strategy must also address model-specific vulnerabilities, including:

  • Prompt Injection: Protecting against malicious inputs designed to manipulate model behavior.
  • Data Leakage: Preventing sensitive information from being exposed through model outputs.
  • Training Data Security: Ensuring the integrity and confidentiality of training data and model artifacts.

Features like Model Armor hint at addressing these concerns at the platform level, but application-level safeguards and robust MLOps security practices remain crucial for a holistic security strategy.

Security at Drizzle:AI is foundational to our platform designs and implemented by default. We prioritize the security of LLM platforms at every level, ensuring robust protection for infrastructure, models, and data. While our current offerings deliver comprehensive security measures out of the box, we plan to introduce custom security offering in the future to address specific organizational needs and evolving threats. This commitment to security ensures that your AI deployments remain resilient, compliant, and trustworthy.

Table 3: Production Readiness Checklist for LLM Serving on GKE

AspectKey Best Practices/Considerations
ScalabilityHPA with vLLM-specific custom metrics (e.g., vllm:num_requests_waiting, vllm:num_requests_running). GKE Cluster Autoscaler for GPU node pools. Appropriate min/max replica/node counts. Consider Node Auto-Provisioning.
ReliabilityMulti-zone node pools. GPU Reservations for critical capacity. Pod Disruption Budgets. Graceful pod termination. Robust node upgrade strategy (e.g., Blue-Green).
PerformanceRight-size GPUs and machine types per model. Tune vLLM parameters (gpu_memory_utilization, max_num_seqs, tensor_parallel_size, chunked prefill). Optimize model loading. Consider quantization. Monitor key LLM KPIs.
CostLeverage autoscaling. Use Spot VMs for fault-tolerant workloads. Secure Committed Use Discounts for stable workloads. Right-size resources continuously. Monitor spending with GKE usage metering.
SecurityPrinciple of Least Privilege (IAM/RBAC). Network Policies (default-deny). Private GKE clusters. Shielded GKE Nodes. Regular GKE upgrades. Secure secret management (Cloud KMS). Container image scanning & Binary Authorization.

Supercharging Efficiency: The vLLM Production Stack in Action

Scaling Challenges and the vLLM Production Stack

While a single vLLM instance can serve models effectively, scaling out and managing multiple instances—potentially serving different models or model versions—introduces new challenges in routing, load balancing, and observability.

The vLLM Production Stack is an open-source reference implementation designed to address these challenges. It optimizes both model performance and operational efficiency for vLLM deployments on Kubernetes clusters. By leveraging intelligent routing, enhanced observability, and efficient resource utilization, the stack ensures that scaling vLLM deployments remains manageable and cost-effective.

Core Components and Their Roles

The vLLM Production Stack comprises three main components:

  1. Serving Engine: This consists of one or more vLLM instances. Each instance can run a different LLM or a different configuration of the same LLM. This allows for specialization, such as dedicating instances with specific GPU types or resource allocations to particular models.

  2. Request Router: This is a critical component that intelligently directs incoming inference requests to the most appropriate backend serving engine instance. It supports routing to endpoints serving different models and is aware of the underlying Kubernetes services for automatic service discovery and fault tolerance.

  3. Observability Stack: This component, typically built using Prometheus and Grafana, monitors the metrics exposed by the backend vLLM instances and the router itself, providing crucial insights into the health and performance of the entire serving system.

Optimizing Performance and Operations with the Stack

The vLLM Production Stack offers several advantages for production deployments:

KV Cache Reuse via Intelligent Routing

One of the most significant benefits of the vLLM Production Stack is the router’s ability to maximize Key-Value (KV) cache reuse. For stateful LLM interactions, such as multi-turn conversations, the KV cache stores the attention keys and values for previously processed tokens, avoiding redundant computation.

The router can use routing keys or session IDs to direct subsequent requests from the same session to the same vLLM backend instance. This ensures that the relevant KV cache is available, dramatically improving latency and throughput for conversational applications.

Supported routing algorithms include:

  • Round-Robin Routing: Distributes requests evenly across backend instances.
  • Session-ID Based Routing: Ensures requests from the same session are routed to the same backend instance.

Ongoing work includes more advanced techniques like prefix-aware routing, which could further enhance cache utilization by routing requests with common prefixes to the same backend. This state-aware routing is a substantial improvement over simple stateless load balancing, which might distribute session requests across different backends, nullifying KV cache benefits.

  • Fault Tolerance and High Availability: The router leverages Kubernetes service discovery to maintain a list of healthy backend instances. If an instance becomes unresponsive, the router automatically stops sending traffic to it, ensuring continuous service availability.

  • Enhanced Observability for Fine-Grained Insights: The stack provides a much richer set of metrics than a standalone vLLM deployment. The router itself exports metrics for each serving engine instance, including Queries Per Second (QPS), Time-To-First-Token (TTFT), and the number of pending, running, and finished requests. The integrated Grafana dashboard offers visualizations for:

    • Number of available (healthy) vLLM instances.

    • End-to-end request latency distributions.

    • TTFT distributions.

    • Number of running and pending requests per instance (valuable for scaling decisions).

    • Crucially, GPU KV Cache Usage Percentage and Hit Rate, which directly indicate the efficiency of the PagedAttention mechanism and the effectiveness of the routing strategy. This deep, application-specific monitoring is vital because generic infrastructure metrics (CPU, memory) are often insufficient to diagnose LLM-specific performance issues.

Deployment Considerations for the vLLM Production Stack

The vLLM project provides resources, including Helm charts, to facilitate the deployment of the Production Stack on Kubernetes platforms like GKE and AWS EKS. This deployment layers on top of the individual vLLM deployments discussed earlier, with the router managing traffic to multiple vLLM “serving engine” deployments.

Advantages and Trade-offs

While the vLLM Production Stack offers significant advantages in terms of performance optimization and operational insight, it also introduces additional components that need to be deployed, configured, and managed. These include:

  • Router: Manages traffic to multiple vLLM serving engine deployments, enabling intelligent KV cache-aware routing.
  • Observability Setup: Provides a more structured and comprehensive monitoring framework.
  • Deployment and Operation

This implies a trade-off: the advanced capabilities come at the cost of increased operational complexity compared to a simpler, single vLLM instance setup.


Drizzle:AI’s Fully Automated vLLM Production Stack

At Drizzle:AI, we simplify the complexities of deploying production-grade AI platforms by providing a fully automated vLLM Production Stack as part of our Accelerator Services. Using Terraform Infrastructure as Code (IaC) and GitOps workflows, we deliver a ready-to-use, fully managed solution tailored to your needs.

Our default setup includes intelligent KV cache-aware routing, consolidated observability, and optimized scaling strategies, ensuring your AI/LLM platform is production-ready from day one. With Drizzle:AI, you can focus on innovation while we handle the operational excellence required to scale your AI systems efficiently and securely.


Full-Throttle Automation: IaC, GitOps, and CI/CD

Manual operations are impractical and error-prone for managing complex, dynamic LLM serving workloads in production. Automation through Infrastructure as Code (IaC), GitOps, and robust CI/CD pipelines is essential for achieving consistency, repeatability, speed, and reliability.

Infrastructure as Code (IaC) with Terraform

IaC involves managing and provisioning infrastructure resources—such as secure VPC networks, GKE clusters, GPU node pools, and IAM policies—through declarative configuration files, with Terraform being a popular tool for this purpose and the main tool we use at Drizzle:AI

  • Benefits for GKE & GPU Workloads:

    • Reproducibility: Define your GKE environment (dev, staging, production) in code, ensuring consistency across deployments.

    • Version Control: Infrastructure changes are tracked in Git, providing an audit trail and rollback capabilities.

    • Automation: Automate the provisioning of complex GKE setups, including specific GPU node configurations, network settings, and security policies.

GitOps: A Paradigm for Continuous Delivery

GitOps is a paradigm for continuous delivery where Git serves as the single source of truth for both infrastructure and application configurations.

ArgoCD: Declarative GitOps for Kubernetes

ArgoCD is a declarative GitOps tool for Kubernetes that automatically synchronizes the desired state defined in Git repositories with the live state in the cluster.

  • Benefits for vLLM Deployments:

    • Automated Deployments: Kubernetes manifests for vLLM (as detailed in Section 2) are stored in Git. ArgoCD monitors the repository and automatically applies any changes to the cluster.

    • Auditability and Rollbacks: All changes are Git commits, providing a clear history. Reverting to a previous state is as simple as reverting a Git commit.

    • Consistency: Ensures that all environments (if managed via separate Git branches or directories) reflect the intended configuration.

  • Managing vLLM Applications: vLLM deployments are defined as ArgoCD Application Custom Resources (CRDs), which specify the source Git repository, path to the manifests, target cluster, and synchronization policies.

Robust CI/CD Pipelines for LLM Serving

Continuous Integration (CI) and Continuous Delivery (CD) pipelines automate the building, testing, and deployment of applications and their underlying models.

  • Continuous Integration (CI):

    • Triggers: Typically initiated by code pushes to a Git repository (e.g., changes to vLLM server code, Dockerfiles, model fine-tuning scripts, or new model artifacts).

      1. Linting & Static Analysis: Check code quality and identify potential issues.

      2. Testing: Execute unit tests, functional tests. For LLMs, this stage might also include model performance evaluation (e.g., against benchmark datasets) or accuracy checks.

      3. Build Custom vLLM Container Images: If not using pre-built images, this step compiles the vLLM server and potentially packages model weights or scripts to fetch them.

      4. Vulnerability Scanning: Scan the built container images for known security vulnerabilities using tools like Artifact Registry scanning.

    • Artifacts: The primary output is a versioned Docker image, pushed to a container registry (e.g., Google Artifact Registry).

    • Rapid Iteration: CI pipelines should be optimized for speed, ideally running in under 10 minutes to provide fast feedback to developers.

  • Continuous Delivery (CD):

    • Promotion: Promote tested and approved artifacts (container images) through different environments (e.g., development → staging → production). A key best practice is to promote the exact same immutable image artifact rather than rebuilding it for each environment, which ensures consistency and avoids introducing unintended changes. This is particularly crucial for LLM serving where model weights can be very large; rebuilding images with embedded models at each stage is inefficient and risky.

    • Deployment: Update Kubernetes manifests (e.g., changing the image tag) in the Git repository that ArgoCD monitors. ArgoCD then automatically synchronizes this change to the target GKE cluster.

  • Advanced Deployment Patterns

    For safer rollouts, consider deployment strategies such as:

    • Canary Deployments: Gradually shift traffic to the new version, allowing you to monitor its performance under partial load before fully rolling it out. This approach minimizes risk by enabling early detection of issues.

    • Blue/Green Deployments: Deploy the new version alongside the old version, then switch traffic to the new version once it is verified to be stable. This ensures a seamless transition and provides a fallback option in case of unexpected issues.

    These patterns are particularly useful for maintaining service reliability during updates and ensuring smooth transitions in production environments.

  • Key CI/CD Best Practices**:**

    • Maintain separate clusters or namespaces for different environments.

    • Ensure pre-production environments closely mirror production.

    • Integrate comprehensive automated testing at every stage of the pipeline.

    • Embed security practices early in the lifecycle (DevSecOps), including static code analysis, vulnerability scanning, and potentially using Binary Authorization to enforce that only signed, attested images can be deployed.

    • Manage secrets securely, avoiding hardcoding them in CI/CD scripts or manifests.


The combination of Terraform for infrastructure provisioning, ArgoCD for declarative application deployment, and a robust CI/CD pipeline enables a seamless “Git-to-Production” workflow. This approach ensures version-controlled, automated updates across infrastructure, Kubernetes configurations, vLLM server code, and model artifacts, reducing manual effort and minimizing errors.

For LLM serving, CI/CD pipelines must integrate MLOps principles. Beyond deploying application code, they should manage the lifecycle of LLMs, including model artifacts, validation, and versioning. Pipelines should integrate with model registries, trigger validation steps (e.g., performance or bias checks), and version models alongside serving container images.


At Drizzle:AI, we have the pillar Unified Automation with IaC & GitOps. We use a unified approach to automation. Your core infrastructure is built with Terraform (IaC), and your LLMs are deployed with Argo CD (GitOps), creating a single, auditable system for managing your entire platform.

Illuminating Performance: Comprehensive Monitoring and Observability

Effective monitoring and observability are non-negotiable for production LLM serving. They provide the necessary insights to understand system behavior, diagnose issues, identify performance bottlenecks, track resource utilization, and inform scaling decisions. LLMs introduce unique metrics beyond standard infrastructure monitoring, such as token generation rates, KV cache efficiency, and specific latency measures.

Essential vLLM and GPU Metrics to Monitor

A comprehensive monitoring strategy should track metrics from vLLM, the underlying GPUs, and Kubernetes itself.

Table 2: Key vLLM and GPU Metrics for Production Monitoring

Metric NameDescriptionWhy it’s Important for LLM ServingCollection Tool/Source
vllm:num_requests_runningNumber of requests currently running on the GPU(s).Indicates active load and GPU utilization for processing.vLLM /metrics
vllm:num_requests_waitingNumber of requests waiting in the queue to be processed.Key indicator of system backlog; high values suggest overload and need for scaling.vLLM /metrics
vllm:num_requests_finished_totalCumulative counter of successfully completed requests.Tracks overall throughput and successful processing.vLLM /metrics
vllm:time_to_first_token_seconds_bucketHistogram of Time To First Token (TTFT) latency.Critical for user-perceived responsiveness, especially in interactive applications.vLLM /metrics
vllm:inter_token_latency_seconds_bucketHistogram of Inter-Token Latency (ITL) during generation.Measures the speed of subsequent token generation; important for streaming and overall generation speed.vLLM /metrics
vllm:prompt_tokens_totalCumulative counter of processed prompt tokens.Tracks input load.vLLM /metrics
vllm:generation_tokens_totalCumulative counter of generated tokens.Tracks output volume and generation work.vLLM /metrics
vllm:gpu_cache_usage_percPercentage of GPU KV cache memory utilized.Crucial for PagedAttention efficiency; indicates if KV cache is nearing capacity, which can lead to preemption or OOM.vLLM /metrics
vllm:kv_cache_hit_rate (if available/derived)Rate at which KV cache lookups are successful.High hit rate indicates efficient KV cache reuse, reducing recomputation (especially with vLLM Production Stack router).vLLM /metrics / Router
DCGM_FI_DEV_GPU_UTILGPU utilization percentage.Measures how busy the GPU compute units are.DCGM / Prometheus Exporter
DCGM_FI_DEV_FB_USEDGPU framebuffer memory used.Tracks how much GPU memory is actively being used for model weights, KV cache, and activations.DCGM / Prometheus Exporter
DCGM_FI_DEV_POWER_USAGEGPU power consumption in watts.Useful for monitoring energy efficiency and thermal load.DCGM / Prometheus Exporter
  • Other Important Metrics: Metrics related to LoRA adapters and speculative decoding, if these features are in use, should also be monitored. Additionally, Kubernetes metrics such as pod restarts, resource saturation (CPU/memory at the node level), and HPA events are vital for maintaining a complete picture of system health and performance.

Building Insightful Grafana Dashboards

Grafana dashboards should be designed to provide actionable insights at a glance. Leveraging pre-built dashboards from vLLM or Cloud Monitoring is a good starting point. Key panels to include:

  • Overview: QPS, overall error rate, number of active vLLM instances.

  • Latency: Histograms and percentile views (P50, P90, P99) for TTFT, ITL, and end-to-end request latency.

  • Workload: Request queue length (vllm:num_requests_waiting), number of running requests (vllm:num_requests_running).

  • GPU Performance: GPU utilization, GPU memory usage (per pod/node), power consumption.

  • vLLM Internals: KV cache utilization percentage, KV cache hit rate (if available).

  • Token Throughput: Prompt tokens processed per second, generation tokens per second. An example NVIDIA GPU monitoring dashboard can also provide inspiration for GPU-specific visualizations.

Effective monitoring for LLMs requires correlating metrics to understand system behaviors. For example, a drop in KV cache hit rate might correlate with increased inter-token latency and changes in request patterns, traceable via logs or router metrics in the vLLM Production Stack. Dashboards should overlay metrics like request rates, latency percentiles, and KV cache usage to facilitate such analysis.

Robust monitoring is essential for autoscaling. Metrics used by HPA must accurately reflect vLLM load; otherwise, scaling actions will be ineffective. Monitoring forms a feedback loop: it informs scaling decisions, and scaling impacts should be observable in the system.

The vLLM project provides detailed metrics for diagnostics, but starting with a curated set of high-impact metrics (e.g., KV cache usage, latency histograms) is recommended. Enable verbose metrics only for specific needs, balancing diagnostic depth with performance overhead. For quick insights, vLLM’s LoggingStatLogger can output key statistics periodically.

Observability Pillar at Drizzle:AI: AI/LLM Platform Observability (The Cockpit)
You can’t fly blind. We’ll give you the tools to monitor everything under the hood.
We deploy a complete, out-of-the-box observability solution based on OpenTelemetry, Prometheus, and Grafana. This includes gathering telemetry in the form of metrics, traces, and logs coming from your AI/LLM Platform and the underlying infrastructure.
You get pre-built dashboards to monitor critical metrics as detaled in this blog, and overall cloud costs.

Conclusion: Your Blueprint for Production-Grade LLM Serving

This article has outlined a comprehensive journey from deploying Gemma models with vLLM on GKE to building a production-grade, automated, and observable serving infrastructure. It covered foundational setup, strategies for scalability, reliability, performance, cost optimization, and security, as well as advanced practices like the vLLM Production Stack, automation via IaC, GitOps, CI/CD, and robust monitoring.

The strength of this approach lies in the seamless integration of cutting-edge components: Google’s open and versatile Gemma models, vLLM’s optimized serving engine, GKE’s scalable Kubernetes platform, and tools like Terraform, ArgoCD, Prometheus, and Grafana. Together, these technologies form a powerful solution for addressing the challenges of LLM inference in production environments.

Achieving production excellence with LLMs demands diligence, a deep understanding of the underlying technologies, and a commitment to continuous improvement. The ability to deliver transformative AI services efficiently, reliably, and at scale is a significant competitive advantage.

The principles and practices shared here serve as a flexible blueprint rather than a rigid prescription. Implementation details will vary based on organizational needs, operational scale, and the unique requirements of each LLM application.

The true value lies in embracing these guiding principles: Automate Everything, Observe Continuously, Optimize Holistically, Secure by Design, and Iterate and Improve.

By adapting these principles, organizations can navigate the dynamic and rapidly evolving landscape of production LLM serving with confidence and success.

Drizzle:AI’s AI Platform Accelerator service is designed to navigate this complexity for you. Whether you choose our AI Blueprint for a head start, the full-service AI Launchpad, or our advanced Drizzle:AI Entreprise, we provide the expertise and automation to accelerate AI/LLMs to production. You get a modern, scalable, and secure platform that you Own Your AI Stack 100%, allowing you to focus on innovation.

Ready to deploy Gemma or other powerful LLMs like DeepSeek R1 without the months of manual effort and operational risk?

Book your free demo with Drizzle:AI today! Let’s discuss how we can accelerate your AI journey.

Discover Drizzle:AI Services!

Discover Drizzle:AI Technologies!

Further reads and references

  1. Serve Gemma open models using GPUs on GKE with vLLM | Kubernetes Engine, [https://cloud.google.com/kubernetes-engine/docs/tutorials/serve-gemma-gpu-vllm]

  2. About model inference on GKE [https://docs.cloud.google.com/kubernetes-engine/docs/concepts/machine-learning/inference]

  3. Scalable and Distributed LLM Inference on GKE with vLLM [https://github.com/GoogleCloudPlatform/accelerated-platforms/blob/main/docs/use-cases/inferencing/README.md]

  4. Optimization and Tuning vLLM[https://docs.vllm.ai/en/v0.8.2/performance/optimization.html]

  5. vLLM Production Stack: reference stack for production vLLM [https://blog.vllm.ai/production-stack/]

  6. Deploying LLMs in Clusters [https://blog.lmcache.ai/2025-02-20-aws/]

  7. Metrics --- vLLM [https://docs.vllm.ai/en/v0.8.5/design/v1/metrics.html]

Accelerate Your AI Journey with Our Production-Ready Platform and Expert Support

Discover how our cutting-edge platform and dedicated team can help you harness the power of AI to achieve your business goals. Take the first step towards innovation today.

Book a Demo
sales report