Gemini is pretty good with YouTube analysis. You can just drop a youtube link into gemini.google.com and ask to provide a summary. Here is an example for https://youtu.be/jCTvblRXnzg – a brief, meme-heavy overview of Google’s AlphaEvolve:

Other LLMs, not equipped with YouTube tools, might not be able to fetch the video content provided only with a link:

(funny enough, this particular LLM braggs about GPT-4o instead of Google’s AlphaEvolve).
Notes:
- While Gemini is a multimodal AI capable of understanding images and audio, its YouTube summarization feature primarily focuses on the textual content. It doesn’t typically analyze visual cues or nuances in the speaker’s tone to generate the summary;
- Summarizing long videos might be a challenge, for such tasks it’s better to first cut the video in chunks.
Goal of the tutorial
Let’s build and deploy a web application that summarizes YouTube videos using Google’s Gemini and deploy it with Google Cloud Run.

This tutorial is a modernized version of the code lab Build a YouTube Summarizer Codelab.
Prerequisites
- Python 3.x;
- Google Cloud SDK (
gcloud
) installed and configured; - A Google Cloud Project with billing enabled;
- Required APIs enabled in your Google Cloud Project (Cloud Build, Cloud Run, IAM, Vertex AI, etc. - refer to deployment scripts for specifics);
- Docker (for local building if not using Cloud Build).
Installation & Setup
-
Open terminal and clone the repository with code for this tutorial;
git clone git@github.com:Yorko/youtube-summarizer-cloud-run.git
-
Install
uv
– the modern Python dependency manager:pip install uv
-
Create a virtual env:
uv venv
-
Install Python dependencies with
uv
uv sync
-
Configure Google Cloud:
- Set your project ID:
gcloud config set project YOUR_PROJECT_ID
- Ensure your user account or service account has the necessary permissions (e.g., Cloud Run Admin, Cloud Build Editor, Service Account User, Vertex AI User).
- Set your project ID:
Local usage
- Run the Fast API backend:
make run_backend
- Run the Streamlit frontend (in a different terminal tab/window):
make run_frontend
- Access the application in your web browser:
http://localhost:8501
- Enter a YouTube video link (e.g. this one https://youtu.be/jCTvblRXnzg on AlphaEvolve by DeepMind), optionally add a prompt, and click “Generate Summary”.
Deployment to Google Cloud Run
The project includes a script to automate the build and deployment process.
- Review and modify
build_n_deploy.sh
: UpdatePROJECT_ID
,SERVICE_NAME
,DEPLOY_REGION
, andSERVICE_ACCOUNT
variables as needed for your environment. -
Build the container image using Google Cloud Build:
make build_cloud_image
-
Deploy the service to Cloud Run:
make deploy_cloud_run_service
This command deploys the container image built in the previous step, configuring the service account, minimum instances, memory, and allowing unauthenticated access by default. The script will output the URL of your deployed Cloud Run service. Visit this URL to test your deployed YouTube Summarizer!
-
In case your organization doesn’t allow unauthenticated access, you can proxy the service to localhost:
gcloud run services proxy ${SERVICE_NAME}
Just like with locally run application, this will open the app at https://localhost:8080.
Bonus challenges (optional):
- Explore the
scripts/enable_oauth_for_cloud_run.sh
script. Understand how it sets up a Load Balancer and Identity-Aware Proxy (IAP) to restrict access to authenticated users. Try implementing it for your service; - Modernaize the app: split front & back into different services and use
cloudbuild.yaml
to specify different Docker files for them; - Experiment with prompting.