How Do You Deploy an Embedding Model on GCP?
Deploying an embedding model on GCP with SIE requires configuring a GPU cluster using the SIE Terraform module for Google Cloud, deploying the inference server with Helm, and connecting via the SIE SDK. Your data stays within your GCP project, costs are up to 50× lower than managed API pricing, and the full deployment takes under 30 minutes.
Why deploy on GCP?
Google Cloud is a strong choice for self-hosted embedding inference when:
- Your application stack already runs on GCP (GKE, Cloud Run, BigQuery)
- You need to keep data in a specific region for compliance (GDPR, data residency)
- You want to use Google’s A100 or L4 TPU-adjacent GPU fleet
- You’re optimising costs with GCP committed use discounts or spot VMs
SIE’s GCP Terraform module provisions everything needed: a GKE cluster, GPU node pools, autoscaling, and networking, all within your own GCP project.
Prerequisites
- A GCP project with billing enabled
- GPU quota approved for your target region (request via GCP console if needed)
- Terraform installed (
>= 1.3) - Helm installed (
>= 3.0) gcloudCLI authenticated (gcloud auth application-default login)kubectlinstalled
Step 1: Configure with Terraform
# main.tfmodule "sie" { source = "superlinked/sie/google" version = "~> 1.0"
project_id = "your-gcp-project-id" region = "us-central1"
# One L4 pool on spot capacity; add pools for other GPU types gpu_node_pools = [ { name = "l4-pool" machine_type = "g2-standard-8" gpu_type = "nvidia-l4" gpu_count = 1 min_node_count = 0 max_node_count = 6 spot = true }, ]}
output "kubectl_config_command" { value = module.sie.kubectl_config_command}
output "workload_identity_annotation" { value = module.sie.workload_identity_annotation}terraform initterraform planterraform apply # provisions the GKE cluster and GPU node poolTerraform creates a GKE cluster with an L4 GPU node pool and the Workload Identity service account the SIE pods run under. The GCP deployment guide covers multi-pool setups.
Step 2: Deploy the inference server
# Authenticate kubectl with your new GKE cluster$(terraform output -raw kubectl_config_command)
# The annotation output is "key=email"; the chart takes the email.WI_SA=$(terraform output -raw workload_identity_annotation | cut -d= -f2)
# Install the chart from GHCR. Worker pools default to off, so enable the L4 pool.helm upgrade --install sie oci://ghcr.io/superlinked/charts/sie-cluster \ -n sie --create-namespace \ --set "serviceAccount.annotations.iam\.gke\.io/gcp-service-account=$WI_SA" \ --set workers.pools.l4.enabled=true \ --set workers.pools.l4.bundles.default.minReplicas=1To scale workers with demand, add --set keda.install=true --set autoscaling.enabled=true.
Step 3: Verify
kubectl get pods -n sie
# Reach the gateway from your machinekubectl -n sie port-forward svc/sie-sie-cluster-gateway 8080:8080 &
curl http://localhost:8080/health# → JSON with the gateway status, its workers and the models they serveStep 4: Start encoding
from sie_sdk import SIEClientfrom sie_sdk.types import Item
client = SIEClient("http://localhost:8080") # the port-forward from step 3
results = client.encode( "BAAI/bge-m3", [ Item(text="self-hosted inference on GCP"), Item(text="keep embeddings within your Google Cloud project"), ],)
print(f"Encoded {len(results)} docs, dim={len(results[0]['dense'])}")GCP GPU selection guide
| GPU | Machine type | Best for |
|---|---|---|
| A100 40GB | a2-highgpu-1g | High-throughput, large models |
| A100 80GB | a2-megagpu-16g | Very large models (7B+) |
| L4 | g2-standard-4 (spot) | Cost-efficient standard workloads |
| T4 | n1-standard-4 + T4 | Dev/staging, cost-sensitive |
GCP L4 spot VMs offer excellent price-performance for BGE-M3 and similar models. Spot preemption is handled by SIE’s cluster gracefully, with requests rerouted to healthy nodes.
Enabling GPU quota on GCP
GCP requires explicit quota approval for GPU instances. If you see quota errors during terraform apply:
- Go to IAM & Admin → Quotas in the GCP Console
- Search for
NVIDIA_A100_GPUSorNVIDIA_L4_GPUSin your target region - Click Edit Quotas, request the number you need (start with 4-8)
- Approval typically takes a few hours for small quotas
Cost comparison: GCP self-hosted vs managed APIs
Encoding 100M documents with BGE-M3 (avg 256 tokens each):
| Option | Cost estimate |
|---|---|
| OpenAI text-embedding-3-small | ~$1,300 |
| Voyage AI | ~$800 |
| SIE on GCP L4 spot (on-demand) | ~$25-40 |
The self-hosted cost varies by GPU utilisation and run time, but the savings are substantial at scale.
Frequently asked questions
Does SIE support GKE Autopilot? SIE works with both GKE Standard and GKE Autopilot. Autopilot simplifies node management but has more constraints on GPU configuration. Standard mode gives more control for GPU workloads.
Can I use Workload Identity with SIE? Yes. The Terraform module configures Workload Identity by default, so SIE pods can access GCS buckets or Secret Manager without service account key files.
What regions have good GPU availability on GCP?
us-central1 and us-east1 typically have the best A100 and L4 availability. europe-west4 is the best European option. Check GCP’s GPU availability dashboard before choosing a region.