MLOps & Deployment

MLOps & Deployment on Google Cloud is the practice of packaging, deploying, monitoring, evaluating, tuning, and operating generative AI models and agents across Vertex AI, Agent Platform, Cloud Run, GKE, BigQuery, and related services. It covers both managed workflows and custom serving patterns for Gemini, open models, RAG systems, batch prediction, fine-tuning, and agent runtimes.

Synthesized across 29 notebooks. See the source pages under Notebooks below for line-level grounding.

This area is about moving from notebook experimentation to repeatable cloud execution: containerized agents, managed agents, Vertex AI endpoints, Cloud Run GPU services, GKE model servers, batch pipelines, evaluation pipelines, and tuning jobs.

The recurring pattern is to make configuration explicit, store artifacts in Cloud Storage or BigQuery, validate locally before deployment, grant precise IAM roles, and poll asynchronous jobs until terminal states before consuming outputs.

Production readiness depends heavily on authentication, quota, region compatibility, service-account permissions, cleanup, and observability. Many examples are tutorials or previews, so engineers should treat them as deployment blueprints rather than turnkey production systems.

Canonical workflow

  1. Set project, region, bucket, dataset, model, and service configuration explicitly through environment variables or config files.
  2. Enable required APIs and verify authentication, billing, quotas, IAM roles, and service-agent permissions before creating resources.
  3. Package the workload reproducibly using Dockerfiles, requirements.txt, Terraform, managed SDK configuration, or Cloud Storage model artifacts.
  4. Validate locally where possible, including agent behavior, custom handlers, serving containers, tool definitions, datasets, and request schemas.
  5. Deploy to the appropriate runtime: Agent Runtime, Managed Agents, Vertex AI endpoints, Vertex AI Pipelines, Cloud Run GPU, GKE, Cloud Functions, or Dataflow.
  6. Monitor asynchronous operations by polling job, endpoint, pod, batch prediction, tuning, pipeline, or trace state until terminal status.
  7. Inspect outputs with targeted sampling, row-level metrics, aggregate metrics, traces, logs, or prediction calls instead of assuming success.
  8. Clean up endpoints, agents, buckets, datasets, repositories, clusters, Cloud Run services, pipeline jobs, and local artifacts after testing.

Best practices

See MLOps & Deployment - Best Practices for the full distilled guide.

  • Keep project, region, model, bucket, endpoint, and runtime settings explicit and reusable through config files or environment variables.
  • Use reproducible packaging: Dockerfile, requirements.txt, setup.py, Terraform, managed SDK deployment options, or Cloud Storage model snapshots depending on the runtime.
  • Test agents, custom handlers, tool definitions, serving containers, and prediction paths locally before deploying to Agent Runtime, Agent Engine, Vertex AI, Cloud Run, or GKE.
  • Store durable session state, memory, datasets, pipeline artifacts, model artifacts, and evaluation outputs outside ephemeral runtimes using managed services such as Vertex AI Sessions, Memory Bank, Cloud Storage, BigQuery, or Vertex AI Experiments.
  • Use dedicated service accounts and grant explicit roles for Vertex AI, Artifact Registry, Cloud Storage, Cloud Build, Cloud Run, Cloud SQL, Secret Manager, Dataflow, GKE, and Discovery Engine as required.
  • Keep production services private by default with IAM authentication; avoid tutorial-only unauthenticated Cloud Run, Toolbox, or function deployments in production.

Key models & APIs

  • Vertex AI API / Agent Platform API (aiplatform.googleapis.com), Vertex AI Agent Runtime / Agent Engine, Google ADK with agent_engines.AdkApp, Managed Agents API with google-genai, google-cloud-aiplatform with agent_engines, langchain, prediction, and tuning extras, Vertex AI Sessions, VertexAISessionService, VertexAiMemoryBankService, and Memory Bank, Vertex AI Pipelines, BatchPredictionJob, VertexNotificationEmailOp, DataflowPythonJobOp, and WaitGcpResourcesOp, Rapid Evaluation API and integrated Gen AI Evaluation, BigQuery, BigFrames, Cloud Storage, Artifact Registry, Cloud Build, Secret Manager, Cloud SQL, Cloud Run, GKE, Cloud Functions, Cloud Trace, and Vertex AI Search / Discovery Engine, Vertex AI Model Garden SDK and Terraform-based Model Garden deployment, Ollama, vLLM, Hugging Face Text Generation Inference, Hugging Face PyTorch DLCs, TRL SFT, LoRA, and LiteLLM OpenAI-compatible APIs, Gemini models: gemini-3.1-flash-lite, gemini-2.5-flash, gemini-2.5-flash-001, gemini-2.0-flash, gemini-2.0-flash-001, gemini-1.5-flash-002, Embedding model: text-embedding-005, Open models: Gemma 2, Gemma 3, google/gemma-2b, google/gemma-7b-it, google/paligemma-3b-mix-448, PaliGemma, Qwen3:8b, Qwen/Qwen2.5-0.5B, Llama 3.1, Llama 3.2, Llama 4 Scout, PLLuM-12B-chat, Stable Diffusion XL, FLUX.1-dev, DeepSeek-R1, and xsanskarx/thinkygemma-4b, Agent and preview models: antigravity-preview-05-2026

Notebooks (29)

Agents & ADK (4)

Gemini (8)

Open Models (16)

Vertex AI Search (1)


Part of the Generative AI Google Brain · MLOps & Deployment - Best Practices