Deploying LLMs on Google Cloud Vertex AI

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1566 services
Deploying LLMs on Google Cloud Vertex AI
Medium
~3-5 days
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1317
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1226
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    925
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1156
  • image_logo-advance_0.webp
    B2B Advance company logo design
    620
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    894

When Vertex AI becomes a bottleneck

We've been deploying LLMs on Vertex AI for over 5 years and know why the standard Model Garden falls short for high‑load systems. In practice, you face cold start endpoints, inefficient autoscaling, and uncontrollable GPU billing. For a SaaS product with p99 latency under 500 ms, you need a custom image with vLLM, TGI, or Triton. We use vLLM with prefix caching and block size 16 — this yields up to 3x throughput improvement on repeated prompts.

Over 50+ projects we've accumulated the practice of turning Vertex from a black box into a predictable platform. On one financial trading project we reduced cold start from 12 seconds to 300 ms by keeping one replica active. GPU savings from proper quantization reached 35%, translating to roughly $2,500 per month saved on a four‑GPU setup.

Why standard Model Garden doesn't fit high‑load systems

Out‑of‑the‑box models from Model Garden deploy with a single command, but you lose control over batch size, max-model-len, quantization, and scheduler selection. For high loads you need a custom image with vLLM or Triton. vLLM’s prefix caching gives up to 3x throughput gain on repeated prompts.

How we deploy LLMs: step‑by‑step

  1. Model and infrastructure audit. Evaluate latency and throughput requirements, choose GPU/TPU and quantization type (INT4 vs FP16).
  2. Containerization with vLLM or TGI. Build a Docker image with optimised parameters — health check, predict route, env vars for Vertex AI Endpoints.
  3. Endpoint and autoscaling setup. Configure min_replica_count, max_replica_count, custom metrics custom.googleapis.com|model/requests_per_replica.
  4. Monitoring and alerting. Cloud Monitoring dashboard: latency p50/p95/p99, GPU utilization, token count, error rate.
  5. Documentation and training. Runbook for developers, terraform config for repeatable deployment.

Estimated timeline: 7 to 14 business days. Cost is calculated individually.

Minimizing cold starts

Cold starts occur when the endpoint scales to zero or on first call after idle. Vertex AI does not preload the model into memory. We work around this in two ways: set min_replica_count=1 for critical services (small additional cost) or use warm‑up requests via Cloud Scheduler.

# Warm up endpoint every 30 seconds
from google.cloud import aiplatform
import requests

def warm_endpoint(endpoint_name: str):
    warm_payload = {"prompt": "ping", "max_tokens": 1}
    # call rawPredict
    response = requests.post(
        endpoint_name,
        json=warm_payload,
        headers={"Authorization": f"Bearer {token}"}
    )

On a financial trading project we cut cold start from 12 seconds to 300 ms — simply kept one replica active and added client‑side keep‑alive. Contact us to discuss your scenario.

Inference choice: Cloud TPU or GPU?

Characteristic TPU v5e (8‑chip) NVIDIA A100 (80GB, 1x)
Throughput (tokens/s) ~4500 (Llama 3 8B, batch=64) ~2100
Cost per hour Higher Lower
Vertex availability Only us‑central2‑b Many regions
Setup complexity High (JAX, MaxText) Medium (PyTorch, CUDA)

Tensor Processing Unit — Google's specialised chip. Internal tests on Llama 3 8B with batch=64.

TPU v5e delivers roughly 2x more throughput per dollar for large batches, but ties you to us‑central2‑b. For production with multi‑regional HA we recommend GPU or a hybrid: TPU for batch processing, GPU for online inference.

How to configure autoscaling and monitoring?

Vertex AI automatically publishes metrics to Cloud Monitoring, but they are insufficient. We add custom metrics: generated tokens count, prefix cache hit rate (prefix_cache_hit_rate), time to first token (TTFT). This allows quick detection of model degradation after an update.

# Custom metric in Cloud Monitoring
from google.cloud import monitoring_v3

client = monitoring_v3.MetricServiceClient()
series = monitoring_v3.TimeSeries(
    metric={"type": "custom.googleapis.com/model/tokens_per_second"},
    resource={"type": "global"},
    points=[{
        "interval": {"end_time": {"seconds": now}},
        "value": {"double_value": tokens_per_sec}
    }]
)
client.create_time_series(name=project_name, time_series=[series])
Example configuration for Llama 3 70B
machine_type: g2-standard-24
accelerator_type: NVIDIA_A100_80G
accelerator_count: 4

vLLM vs TGI for inference

Parameter vLLM TGI
Throughput (batch=1) ~1200 tok/s ~1000 tok/s
Prefix caching support Yes Limited
Customisation flexibility High Medium

vLLM outperforms TGI by 1.2x in throughput for single requests and has more advanced caching.

What's included

  • Model and infrastructure audit — analyse requirements, select GPU/TPU, recommend quantization.
  • Containerization — build Docker image with vLLM or TGI, configure health check and predict route.
  • Deploy on Vertex AI Endpoints — set up autoscaling, custom metrics, and monitoring.
  • Documentation — runbook for developers, terraform config for repeatable deployment.
  • Team training — knowledge transfer on operations and alerting.
  • Technical support — 2 weeks of post‑deployment support, guaranteed stable operation under load.

Why choose us

  • Over 5 years experience in MLOps and LLM deployment
  • 50+ deployed models, including Llama 3, Mistral, Gemma, Qwen
  • Certified Google Cloud Professional ML Engineers
  • Full lifecycle support: from model selection to operation, ensuring stable performance

You can save up to 40% on GPU costs with proper autoscaling and quantization. Get a consultation for your project — we'll evaluate the optimal deployment architecture and estimate the budget.

Sample deployment via Vertex AI Endpoints

from google.cloud import aiplatform

aiplatform.init(project="my-project", location="us-central1")

# Upload model from GCS
model = aiplatform.Model.upload(
    display_name="llama3-8b-vllm",
    artifact_uri="gs://my-bucket/models/llama3-8b/",
    serving_container_image_uri="us-docker.pkg.dev/vertex-ai/prediction/pytorch-gpu.2-2:latest",
    serving_container_command=[
        "python", "-m", "vllm.entrypoints.openai.api_server",
        "--model=/gcs/models/llama3-8b/",
        "--tensor-parallel-size=1",
        "--max-model-len=8192",
        "--host=0.0.0.0",
        "--port=8080"
    ],
    serving_container_ports=[{"containerPort": 8080}],
    serving_container_health_route="/health",
    serving_container_predict_route="/v1/completions",
    serving_container_environment_variables={
        "TRANSFORMERS_CACHE": "/gcs/hf_cache/",
    }
)

# Deploy endpoint
endpoint = aiplatform.Endpoint.create(display_name="llama3-8b-endpoint")
model.deploy(
    endpoint=endpoint,
    deployed_model_display_name="llama3-8b-v1",
    machine_type="g2-standard-12",     # 1x L4 GPU
    accelerator_type="NVIDIA_L4",
    accelerator_count=1,
    min_replica_count=1,
    max_replica_count=10,             # autoscaling
    traffic_percentage=100,
)

Request a consultation — we'll find the optimal configuration for your workload.