# AI/ML orchestration on Cloud Run documentation

[Read product documentation](https://docs.cloud.google.com/run/docs/ai/overview.md.txt)
Cloud Run is a fully managed platform that lets you run your containerized applications, including
AI/ML workloads, directly on Google's scalable infrastructure. It handles the infrastructure for
you, so you can focus on writing your code instead of spending time on operating, configuring,
and scaling your Cloud Run resources. Cloud Run's capabilities
provide the following:

- **Hardware accelerators**: access and manage GPUs for inference at scale.
- **Frameworks support**: integrate with the model serving frameworks you already know and trust such as Hugging Face, TGI, and vLLM.
- **Managed platform**: get all the benefits of a managed platform to automate, scale, and enhance the security of your entire AI/ML lifecycle while maintaining flexibility.

<br />

Explore our tutorials and best practices to see how Cloud Run can optimize your AI/ML workloads.

## Documentation resources

Find quickstarts and guides, review key references, and get help with common issues.

### Run AI solutions

- Concept

  [Explore AI use cases](https://docs.cloud.google.com/run/docs/ai/use-cases.md.txt)

- Concept

  [Host AI agents](https://docs.cloud.google.com/run/docs/ai-agents.md.txt)

- How-to

  [Host A2A agents](https://docs.cloud.google.com/run/docs/host-a2a-agents)

- How-to

  [Deploy A2A agents](https://docs.cloud.google.com/run/docs/deploy-a2a-agents.md.txt)

- How-to

  [Host MCP servers](https://docs.cloud.google.com/run/docs/host-mcp-servers.md.txt)

- How-to

  [Use the Cloud Run remote MCP server](https://docs.cloud.google.com/run/docs/use-cloud-run-mcp.md.txt)

- Tutorial

  [Build and deploy a remote MCP server](https://docs.cloud.google.com/run/docs/tutorials/deploy-remote-mcp-server.md.txt)

- Tutorial

  [Build and deploy an AI agent using ADK](https://docs.cloud.google.com/run/docs/ai/build-and-deploy-ai-agents/deploy-adk-agent.md.txt)

- Concept

  [Code execution](https://docs.cloud.google.com/run/docs/code-execution.md.txt)

- Concept

  [Browser and OS automation](https://docs.cloud.google.com/run/docs/browser-automation.md.txt)

- Tutorial

  [Quickstart: Build and deploy a Python (LangChain) web app](https://docs.cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-langchain-service.md.txt)

- Tutorial

  [Quickstart: Build and deploy a Python (smolagents) web app](https://docs.cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-smolagents-service.md.txt)

### Inference with GPUs

- Tutorial

  [Run LLM inference on Cloud Run GPUs with Gemma 4 and Ollama](https://docs.cloud.google.com/run/docs/tutorials/gpu-gemma-with-ollama.md.txt)

- How-to

  [Run Gemma 4 models on Cloud Run](https://docs.cloud.google.com/run/docs/run-gemma-on-cloud-run.md.txt)

- Tutorial

  [Run LLM inference on Cloud Run GPUs with Hugging Face](https://docs.cloud.google.com/run/docs/tutorials/gpu-gemma2-with-transformers-js.md.txt)

- Best practice

  [Best practices: Cloud Run services with GPUs](https://docs.cloud.google.com/run/docs/configuring/services/gpu-best-practices.md.txt)

- Tutorial

  [Fine tune LLMs using GPUs with Cloud Run jobs](https://docs.cloud.google.com/run/docs/tutorials/gpu-finetune-with-jobs.md.txt)

- Tutorial

  [GPU-accelerated video transcoding with FFmpeg on Cloud Run jobs](https://docs.cloud.google.com/run/docs/tutorials/video-encoding.md.txt)

- Best practice

  [Best practices: Cloud Run jobs with GPUs](https://docs.cloud.google.com/run/docs/configuring/jobs/gpu-best-practices.md.txt)

- Best practice

  [Best practices: Cloud Run worker pools with GPUs](https://docs.cloud.google.com/run/docs/configuring/workerpools/gpu-best-practices.md.txt)

### Troubleshoot

- Concept

  [Cloud Run troubleshooting strategies](https://docs.cloud.google.com/run/docs/troubleshooting/overview.md.txt)

- How-to

  [Troubleshoot all Cloud Run issues](https://docs.cloud.google.com/run/docs/troubleshooting.md.txt)

- How-to

  [Troubleshoot with Gemini Cloud Assist](https://docs.cloud.google.com/run/docs/troubleshooting/overview.md.txt#troubleshoot-with-gemini-cloud-assist)

- How-to

  [Troubleshoot with Gemini Cloud Assist investigations](https://docs.cloud.google.com/run/docs/troubleshooting/overview.md.txt#use-investigations)

## Related resources

Explore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Use case Use cases

### [Safely run AI-generated code in Cloud Run sandboxes](https://cloud.google.com/blog/topics/developers-practitioners/google-cloud-run-sandboxes-are-in-public-preview/)


Run untrusted, AI-generated code safely by deploying Cloud Run sandboxes that execute execution environments inside isolated gVisor-based containers.

Security Sandboxes AI Code Execution

<br />

Use case Use cases

### [A Guide to AI Cold Starts on Cloud Run](https://cloud.google.com/blog/topics/developers-practitioners/a-guide-to-ai-cold-starts-on-cloud-run)


Optimize cold-start latency for containerized LLM inference on Cloud Run using serverless configuration settings and architecture design pattern tuning.

Cold starts Latency Optimization LLMs

<br />

Use case Use cases

### [Securing AI agents with MCP Authorization](https://medium.com/google-cloud/securing-ai-agents-with-mcp-authorization-5cd8a552c45b)


Configure and enforce Model Context Protocol (MCP) authorization rules to secure remote tool connectivity for AI agents deployed on Cloud Run.

Security MCP Agents

<br />

Use case Use cases

### [AI Studio unlocks full-stack vibe coding with Cloud Run, Firebase, and Cloud SQL, no credit card required](https://cloud.google.com/blog/products/databases/vibe-coded-ai-studio-apps-with-firestore-firebase-cloud-sql)


Deploy full-stack applications to Cloud Run directly from Google AI Studio's Build Mode with integrated Firebase and Cloud SQL backup support.

AI Studio Firebase Cloud SQL vibe coding

<br />

Use case Use cases

### [Run your AI inference applications on Cloud Run with NVIDIA GPUs](https://cloud.google.com/blog/products/application-development/run-your-ai-inference-applications-on-cloud-run-with-nvidia-gpus)


Use NVIDIA L4 GPUs on Cloud Run for real-time AI inference, including fast cold-start and scale-to-zero benefits for Large Language Models (LLMs).

GPUs LLMs

<br />

Use case Use cases

### [Cloud Run: the fastest way to get your AI applications to production](https://cloud.google.com/blog/products/application-modernization/using-cloud-run-for-ai-applications)


Learn how to use Cloud Run for production-ready AI applications. This guide describes
use cases such as traffic splitting for A/B testing prompts, RAG (Retrieval-Augmented Generation) patterns, and connectivity to vector stores.

AI applications traffic splitting for A/B testing RAG patterns vector stores connectivity to vector stores

<br />

Use case Use cases

### [AI deployment made easy: Deploy your app to Cloud Run from AI Studio or MCP-compatible AI agents](https://cloud.google.com/blog/products/ai-machine-learning/ai-studio-to-cloud-run-and-cloud-run-mcp-server)


One-click deployment from Google AI Studio to Cloud Run and the Cloud Run MCP (Model Context Protocol) server to enable AI agents in IDEs or agent SDKs and deploy apps.

MCP servers deployments Cloud Run

<br />

Use case Use cases

### [Supercharging Cloud Run with GPU power: A new era for AI workloads](https://medium.com/google-cloud/supercharging-cloud-run-with-gpu-power-a-new-era-for-ai-workloads-3c54fcf60cae)


Integrate NVIDIA L4 GPUs with Cloud Run for cost-efficient LLM serving. This guide emphasizes scale-to-zero and provides deployment steps for models like Gemma 2 with Ollama.

LLMs GPU Ollama Cost Optimization

<br />

Use case Use cases

### [Still packaging AI models in containers? Do this instead on Cloud Run](https://medium.com/google-cloud/still-packaging-ai-models-in-containers-do-this-instead-on-cloud-run-a0219e625bca)


Decouple large model files from the container image using Cloud Storage FUSE. Decoupling improves build times, simplifies updates, and creates a more scalable serving architecture.

Model Packaging Cloud Storage FUSE Best Practices Large Models

<br />

Use case Use cases

### [Package and deploy your machine learning models to Cloud Run with Cog](https://medium.com/google-cloud/package-and-deploy-your-machine-learning-models-to-google-cloud-with-cog-ac6e20a19ac1)


Use the Cog framework that is optimized for ML serving to simplify packaging and deployment of containers to Cloud Run.

Cog Model Packaging Deployment Tutorial

<br />

Use case Use cases

### [Deploying \& monitoring ML models with Cloud Run --- Lightweight, scalable, and cost-efficient](https://sauravkum780.medium.com/deploying-monitoring-ml-models-with-cloud-run-lightweight-scalable-and-cost-efficient-8be3e011ddc9)


Use Cloud Run for lightweight ML inference and build a cost-effective monitoring stack by using native Google Cloud services like Logging and BigQuery.

Monitoring MLOps Cost Efficiency Inference

<br />

## Related videos