llm-d quickstart on GKE TPU¶
Use this guide for your first llm-d deployment on GKE TPU: the router (EPP) in front of two vLLM-TorchTPU replicas, verified with a request, then optionally fronted by a GKE-managed Gateway. It follows llm-d's quickstart, which deploys the Optimized Baseline in Standalone Mode, and swaps the default NVIDIA overlay for a TPU one. Chapter 20 explains each object and why the TPU fields must agree; Optimized baseline is the full version of this path.
Prerequisites¶
-
A GKE cluster with a TPU node pool that matches one of these shapes (TPU on llm-d is GKE only, vLLM on TorchTPU):
Shape Machine type Node selectors Chips per pod Devices Model the overlay serves v6e 2x4, one hostct6e-standard-8ttpu-v6e-slice,2x4google.com/tpu: 88 Qwen/Qwen3-32B, TP=8TPU7x 2x2x1, one hosttpu7x-standard-4ttpu7x,2x2x1google.com/tpu: 48 Qwen/Qwen3.5-397B-A17B-FP8, DP=8 x TP=1, EPThe overlays run 2 replicas, so you need two slices. A TPU7x chip is two devices, which is why 4 chips give 8. - A boot disk sized for the checkpoint: weights download once per node into
/var/cache/huggingface. Use at least 200 GB for Qwen3-32B on v6e and 1 TB for Qwen3.5-397B-A17B-FP8 on TPU7x. The 100 GB node auto-provisioning default is evicted mid-download. -kubectlandhelmon your machine, and a Hugging Face token exported asHF_TOKEN. - For step 7 only: the Gateway API enabled on the cluster and a proxy-only subnet, as Google's "Deploy GKE Inference Gateway" page describes.
Steps¶
1. Get the llm-d repository and set the environment¶
export branch="release-1.0"
git clone https://github.com/llm-d/llm-d.git && cd llm-d && git checkout ${branch}
export REPO_ROOT=$(realpath $(git rev-parse --show-toplevel))
source ${REPO_ROOT}/guides/env.sh
export GUIDE_NAME="quickstart"
export NAMESPACE=llm-d-quickstart
export MODEL=Qwen/Qwen3-32B # Qwen/Qwen3.5-397B-A17B-FP8 on TPU7x
guides/env.sh defines the chart URLs and versions (ROUTER_STANDALONE_CHART, ROUTER_GATEWAY_CHART, ROUTER_CHART_VERSION), GAIE_URL and CURL_TEST_IMAGE that later steps use.
Check: echo ${ROUTER_CHART_VERSION} ${CURL_TEST_IMAGE} prints two non-empty values.
2. Install the Gateway API Inference Extension CRDs¶
On GKE 1.34.0-gke.1626000 or later with the Gateway API enabled (--gateway-api=standard, always on in Autopilot), GKE installs and manages the Gateway API Standard-channel CRDs and the v1 InferencePool CRD: skip the apply. On earlier versions:
# GAIE_URL is automatically calculated from GAIE_VERSION at ${REPO_ROOT}/guides/env.sh
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api-inference-extension/${GAIE_URL}/v1-manifests.yaml
To install both CRD sets yourself, bash ${REPO_ROOT}/guides/recipes/gateway/install-gateway-crds.sh does it from the same environment.
Check:
kubectl api-resources --api-group=gateway.networking.k8s.io
kubectl api-resources --api-group=inference.networking.k8s.io
lists resources such as gateways, httproutes and inferencepools.
3. Create the namespace and the token Secret¶
kubectl create namespace ${NAMESPACE} --dry-run=client -o yaml | kubectl apply -f -
kubectl create secret generic llm-d-hf-token \
--from-literal="HF_TOKEN=${HF_TOKEN}" \
--namespace "${NAMESPACE}" \
--dry-run=client -o yaml | kubectl apply -f -
Check: kubectl get secret llm-d-hf-token -n ${NAMESPACE} shows the Secret. The model servers read the key HF_TOKEN from it.
4. Deploy the router in Standalone Mode¶
Standalone Mode runs the EPP with a built-in Envoy proxy, so no Gateway is needed yet:
helm install ${GUIDE_NAME} \
${ROUTER_STANDALONE_CHART} \
-f guides/recipes/router/base.values.yaml \
-f guides/optimized-baseline/router/optimized-baseline.values.yaml \
-n ${NAMESPACE} --version ${ROUTER_CHART_VERSION}
On TPU7x, add -f guides/optimized-baseline/router/tpu-v7.values.yaml after the second values file: it hashes prefixes on the engine's 4352-token blocks, tracks the full 262k context and uses the affinity gate measured on that topology.
Check: helm list -n ${NAMESPACE} shows the release deployed, and kubectl get service ${GUIDE_NAME}-epp -n ${NAMESPACE} exists.
5. Deploy the TPU model servers¶
The quickstart's default overlay is vLLM on NVIDIA GPUs (guides/optimized-baseline/modelserver/gpu/vllm/base/). The TPU overlays live beside it, GKE only:
export ACCELERATOR_TYPE=tpu/v6 # tpu/v7 for TPU7x
kubectl apply -n ${NAMESPACE} -k guides/optimized-baseline/modelserver/${ACCELERATOR_TYPE}/vllm/gke/
bash ${REPO_ROOT}/guides/scripts/wait-for-pods-ready.sh -l llm-d.ai/guide=optimized-baseline -n ${NAMESPACE}
The overlays use the vllm/vllm-torchtpu:v0.29.0 image through the torch-tpu-vllm image component, annotate pods cluster-autoscaler.kubernetes.io/safe-to-evict: "false", run the Deployment with strategy: Recreate (TPU node pools are fixed-size) and drain on shutdown (15 s preStop, --shutdown-timeout=45, 75 s grace period).
Check: the wait script returns and kubectl get pods -n ${NAMESPACE} shows every model server Running and 1/1 ready. Startup is weight download plus XLA compilation and takes minutes on the first start.
6. Send a test request¶
export IP=$(kubectl get service ${GUIDE_NAME}-epp -n ${NAMESPACE} -o jsonpath='{.spec.clusterIP}')
kubectl run curl-test --rm -i --restart=Never \
--image=${CURL_TEST_IMAGE} \
--namespace="${NAMESPACE}" \
--env="IP=${IP}" \
--env="MODEL=${MODEL}" \
-- /bin/sh -c 'curl -sS -X POST "http://${IP}/v1/completions" -H "Content-Type: application/json" -d "{\"model\": \"${MODEL}\", \"prompt\": \"How are you today?\"}"'
The address is a ClusterIP, so the request runs from a temporary pod inside the cluster.
Check: the response is a JSON completion naming ${MODEL}. To check that routing is cache-aware and not only up, run the shared-prefix test in Optimized baseline, step 5.
7. Optional: front the pool with a GKE Gateway¶
For traffic from outside the cluster, replace Standalone Mode with Gateway Mode. Uninstall the standalone release first (helm uninstall ${GUIDE_NAME} -n ${NAMESPACE}), then deploy a GKE Gateway, choosing the load balancer:
LLM_D_VERSION=main # Use 'main' for latest, or a release tag like 'v0.7.0'
GATEWAY_CLASS=gke-l7-regional-external-managed # gke-l7-rilb for VPC-internal traffic
kubectl apply -n ${NAMESPACE} -k "https://github.com/llm-d/llm-d/guides/recipes/gateway/${GATEWAY_CLASS}?ref=${LLM_D_VERSION}"
kubectl get gateway -n ${NAMESPACE} llm-d-inference-gateway
Wait until PROGRAMMED shows True. Then install the router in Gateway mode with the GKE provider, which creates the HTTPRoute:
export ROUTER_BASE_VALUES="${REPO_ROOT}/guides/recipes/router/base.values.yaml"
export ROUTER_VALUES="${REPO_ROOT}/guides/optimized-baseline/router/optimized-baseline.values.yaml"
export PROVIDER_NAME=gke
export MONITORING_VALUES=
helm install ${GUIDE_NAME} \
${ROUTER_GATEWAY_CHART} \
-f ${ROUTER_BASE_VALUES} \
${MONITORING_VALUES} \
-f ${ROUTER_VALUES} \
--set provider.name=${PROVIDER_NAME} \
--set httpRoute.create=true \
--set httpRoute.inferenceGatewayName=llm-d-inference-gateway \
-n ${NAMESPACE} --version ${ROUTER_CHART_VERSION}
export IP=$(kubectl get gateway llm-d-inference-gateway -n ${NAMESPACE} -o jsonpath='{.status.addresses[0].value}')
curl -X POST http://${IP}/v1/completions \
-H 'Content-Type: application/json' \
-d '{
"model": '\"${MODEL}\"',
"prompt": "How are you today?"
}' | jq
provider.name=gke matters: the default none renders no HealthCheckPolicy, so the Gateway marks the backends unhealthy and requests fail with 503. With an external Gateway the curl runs from your machine.
Check: the Gateway shows PROGRAMMED True, kubectl describe httproute ${GUIDE_NAME} -n ${NAMESPACE} has a Reconciled condition with reason ReconciliationSucceeded, and the request returns a completion.
8. Clean up¶
helm uninstall ${GUIDE_NAME} -n ${NAMESPACE}
kubectl delete gateway llm-d-inference-gateway -n ${NAMESPACE} # only after step 7
kubectl delete namespace ${NAMESPACE}
Check: kubectl get namespace ${NAMESPACE} reports NotFound once deletion completes.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
Model server pod Pending with no clear error |
Node selectors, chip request and machine type disagree | Match the prerequisites table: google.com/tpu: 8 on tpu-v6e-slice 2x4, 4 on tpu7x 2x2x1 |
| Pod evicted during the first start, node recycled | Boot disk too small for the checkpoint under /var/cache/huggingface |
At least 200 GB (v6e, Qwen3-32B) or 1 TB (TPU7x, Qwen3.5-397B) |
Pod restarted by its startupProbe while compiling |
Probe budget shorter than a cold compile | Persist the compile cache and size the startupProbe for the cold case (Startup) |
| Model server node removed while serving | OPTIMIZE_UTILIZATION autoscaler sees an idle node by CPU |
The overlay's safe-to-evict: "false" annotation; keep it in your own manifests |
Gateway never PROGRAMMED=True |
Gateway API not enabled, no proxy-only subnet, or an unsupported GKE version | kubectl describe gateway llm-d-inference-gateway -n ${NAMESPACE}; complete the prerequisites |
HTTPRoute not accepted |
parentRefs or backendRefs name the wrong Gateway or InferencePool |
kubectl describe httproute ${GUIDE_NAME} -n ${NAMESPACE} |
| Gateway returns 503 | Router installed with provider.name=none |
Reinstall with --set provider.name=gke |
fault filter abort |
The request does not match the HTTPRoute rules, or backend routing is misconfigured |
Check the route's Reconciled condition |
| Empty Gateway address | The Gateway still waits for its load balancer | Check that the cluster supports external load balancers |