Generative AI on Vertex AI Cookbook
Stay organized with collections
Save and categorize content based on your preferences.
A collection of guides and examples for Generative AI on Vertex AI.
Explore more in the Generative AI Repository on GitHub.
Gemini Quickstarts
Intro to Gemini 2.5 Flash
Get started with Gemini 2.5 Flash in Vertex AI with the Gen AI Python SDK.
Intro to Gemini 2.5 Pro
Get started with Gemini 2.5 Pro in Vertex AI with the Gen AI Python SDK.
Intro to Gemini 2.5 Flash-Lite
Get started with Gemini 2.5 Flash-Lite in Vertex AI with the Gen AI Python SDK.
Get Started with the Multimodal Live API
Get started with Gemini 2.0 Multimodal Live API in Vertex AI using the Gen AI Python SDK
Gemini 2.0 Flash Image Generation in Vertex AI
Get started with Gemini Image Generation in Vertex AI.
Intro to Prompt Engineering
Learn the essentials and best practices of prompt engineering.
Function Calling with Gemini
Connect Gemini to external tools using function calling.
Grounding with Gemini
Connect Gemini to real-world data from Google Search or Vertex AI Search to improve response quality.
Batch Prediction with Gemini
Use Batch Prediction to run inference on a large number of examples.
Long Context Window
Use the Long Context Window to process large amounts of multimodal data.
Intro to Context Caching
Use context caching to store frequently used data.
Intro to Structured Output with the Gemini API
Learn to control Gemini API output formats for easier data processing.
Call Gemini by using the OpenAI Library
Learn how to call Gemini using Chat Completions.
Featured Tutorials
Creating Marketing Assets using Gemini 2.0 Flash
Learn how to combine the multimodal capabilities of Gemini and Grounding with Google Search to create a marketing campaign brief and marketing assets.
Get started with Chirp 3 HD Voices for Text-to-Speech
Learn about how to use Chirp 3 HD Voices, the latest generation of Google Text-to-Speech voices.
Get started with Chirp 2 for Speech-to-Text
Learn about how to use Chirp 2, the latest generation of Google's multilingual Automatic Speech Recognition models.
Intro to Imagen 4 Image Generation
Use Imagen 4 to create photorealistic images.
Imagen 3 Image Editing
Use Imagen 3 to edit photorealistic images using inpainting, outpainting, and Product Image Editing.
Get Started with Text Embeddings + Vertex AI Vector Search
Use AI's multitool, Embeddings, and Vertex AI Vector Search perform semantic matching.
Intro to LangGraph with Gemini
Learn how to combine LangGraph's workflow capabilities with Gemini's language understanding and generation skills to streamline and automate complex financial analysis tasks.
Create custom podcast episodes
Use Gemini, LangGraph, and Text-to-Speech to create custom podcast episodes.
Storytelling with Gemini and Text-to-Speech
Use Gemini and Text-to-Speech to create and read a story with multiple characters.
Analyze a codebase
Use Gemini to generate code, summarize a codebase, debug, improve code, and assess code.
LLM Security for developers
Learn about prompt injection attacks and how to mitigate them.
Intro to Agent Engine
Learn how to build and deploy an agent (model, tools, and reasoning) using Agent Engine.
Intro to Gen AI Evaluation Service
Evaluate Gemini responses using metrics and custom datasets.
Gemini Supervised Fine-tuning for Article Summarization
Learn how to fine-tune Gemini for article summarization.
Intro to Vertex AI RAG Engine
Build custom RAG workflows with Gemini and Vertex AI RAG Engine.
Document Processing with Gemini
Use Gemini to process documents for classification, extraction, and summarization.
Patents Document Understanding with Gemini
Use Gemini to process patent documents using classification, entity extraction, and object detection.
Build and deploy a Hugging Face smolagent using DeepSeek on Vertex AI
This notebook showcases how to deploy DeepSeek R1 Distill Qwen 32B from Hugging Face Hub on Vertex AI.
Multimodal Sentiment Analysis with Gemini
This notebook demonstrates multimodal sentiment analysis with Gemini by comparing sentiment analysis performed directly on audio with analysis performed on its text transcript.
Productivity Coaching with Gemini and Google Calendar
This notebook demonstrates how to use Gemini as your personal productivity coach, by connecting it to Google Workspace APIs.
Veo 3 Video Generation
In this tutorial, you will learn how to use the Google Gen AI SDK for Python to interact with Veo 3 and generate new videos from text prompts.
All Tutorials
Intro to Gemini 2.5 Flash
Get started with Gemini 2.5 Flash in Vertex AI with the Gen AI Python SDK.
View on GitHubIntro to Gemini 2.5 Pro
Get started with Gemini 2.5 Pro in Vertex AI with the Gen AI Python SDK.
View on GitHubIntro to Gemini 2.5 Flash-Lite
Get started with Gemini 2.5 Flash-Lite in Vertex AI with the Gen AI Python SDK.
View on GitHubGet Started with the Multimodal Live API
Get started with Gemini 2.0 Multimodal Live API in Vertex AI using the Gen AI Python SDK
View on GitHubGemini 2.0 Flash Image Generation in Vertex AI
Get started with Gemini Image Generation in Vertex AI.
View on GitHubIntro to Prompt Engineering
Learn the essentials and best practices of prompt engineering.
View on GitHubFunction Calling with Gemini
Connect Gemini to external tools using function calling.
View on GitHubGrounding with Gemini
Connect Gemini to real-world data from Google Search or Vertex AI Search to improve response quality.
View on GitHubBatch Prediction with Gemini
Use Batch Prediction to run inference on a large number of examples.
View on GitHubLong Context Window
Use the Long Context Window to process large amounts of multimodal data.
View on GitHubIntro to Structured Output with the Gemini API
Learn to control Gemini API output formats for easier data processing.
View on GitHubCall Gemini by using the OpenAI Library
Learn how to call Gemini using Chat Completions.
View on GitHubCreating Marketing Assets using Gemini 2.0 Flash
Learn how to combine the multimodal capabilities of Gemini and Grounding with Google Search to create a marketing campaign brief and marketing assets.
View on GitHubGet started with Chirp 3 HD Voices for Text-to-Speech
Learn about how to use Chirp 3 HD Voices, the latest generation of Google Text-to-Speech voices.
View on GitHubGet started with Chirp 2 for Speech-to-Text
Learn about how to use Chirp 2, the latest generation of Google's multilingual Automatic Speech Recognition models.
View on GitHubIntro to Imagen 4 Image Generation
Use Imagen 4 to create photorealistic images.
View on GitHubImagen 3 Image Editing
Use Imagen 3 to edit photorealistic images using inpainting, outpainting, and Product Image Editing.
View on GitHubGet Started with Text Embeddings + Vertex AI Vector Search
Use AI's multitool, Embeddings, and Vertex AI Vector Search perform semantic matching.
View on GitHubIntro to LangGraph with Gemini
Learn how to combine LangGraph's workflow capabilities with Gemini's language understanding and generation skills to streamline and automate complex financial analysis tasks.
View on GitHubCreate custom podcast episodes
Use Gemini, LangGraph, and Text-to-Speech to create custom podcast episodes.
View on GitHubStorytelling with Gemini and Text-to-Speech
Use Gemini and Text-to-Speech to create and read a story with multiple characters.
View on GitHubAnalyze a codebase
Use Gemini to generate code, summarize a codebase, debug, improve code, and assess code.
View on GitHubLLM Security for developers
Learn about prompt injection attacks and how to mitigate them.
View on GitHubIntro to Agent Engine
Learn how to build and deploy an agent (model, tools, and reasoning) using Agent Engine.
View on GitHubIntro to Gen AI Evaluation Service
Evaluate Gemini responses using metrics and custom datasets.
View on GitHubGemini Supervised Fine-tuning for Article Summarization
Learn how to fine-tune Gemini for article summarization.
View on GitHubIntro to Vertex AI RAG Engine
Build custom RAG workflows with Gemini and Vertex AI RAG Engine.
View on GitHubDocument Processing with Gemini
Use Gemini to process documents for classification, extraction, and summarization.
View on GitHubPatents Document Understanding with Gemini
Use Gemini to process patent documents using classification, entity extraction, and object detection.
View on GitHubBuild and deploy a Hugging Face smolagent using DeepSeek on Vertex AI
This notebook showcases how to deploy DeepSeek R1 Distill Qwen 32B from Hugging Face Hub on Vertex AI.
View on GitHubMultimodal Sentiment Analysis with Gemini
This notebook demonstrates multimodal sentiment analysis with Gemini by comparing sentiment analysis performed directly on audio with analysis performed on its text transcript.
View on GitHubProductivity Coaching with Gemini and Google Calendar
This notebook demonstrates how to use Gemini as your personal productivity coach, by connecting it to Google Workspace APIs.
View on GitHubVeo 3 Video Generation
In this tutorial, you will learn how to use the Google Gen AI SDK for Python to interact with Veo 3 and generate new videos from text prompts.
View on GitHubIntro to the Google Gen AI SDK
Intro to the Google Gen AI SDK.
View on GitHubGemini: An Overview of Multimodal Use Cases
How to prompt Gemini with multimodal data (text, documents, images, video, and audio).
View on GitHubPrompt Engineering, Evaluation, and Prompt Templating
Use Gen AI Evaluation Service SDK for prompt engineering and evaluation.
View on GitHubIntro to Multimodal Embeddings
Learn about multimodal embeddings.
View on GitHubTask Type Embeddings
Learn how to get better embeddings for your specific task.
View on GitHubHybrid Search with Vertex AI Vector Search
Learn how to use hybrid search with Vertex AI Vector Search combining semantic & keyword search.
View on GitHubAI Agents for Engineers (Evolution of AI Agents)
This notebook demonstrates 3 different approaches to generating essays using the Gemini API, Zero-Shot, Step-by-Step with LangChain, and Iterative with LangGraph.
View on GitHubHugging Face DLCs: Serving Gemma with Text Generation Inference (TGI) on Vertex AI
Learn how to deploy Google Gemma from the Hugging Face Hub on Vertex AI using the Hugging Face Deep Learning Container (DLC) for Text Generation Inference (TGI).
View on GitHubRunning a Gemma 2-based agentic RAG with Ollama on Vertex AI and LangGraph
This notebook showcases how to run a Gemma 2-based Agent with Ollama on Vertex AI and LangGraph.
View on GitHubHugging Face DLCs: Serving PaliGemma using Pytorch Inference on Vertex AI with Custom Handler
Learn how to deploy Google PaliGemma from the Hugging Face Hub on Vertex AI using the Hugging Face Deep Learning Container (DLC) for Pytorch Inference in combination with a custom handler.
View on GitHubHugging Face DLCs: Fine-tuning Gemma with Transformer Reinforcement Learning (TRL) on Vertex AI
Learn how to fine-tune Gemma with Transformer Reinforcement Learning (TRL) on Vertex AI.
View on GitHubGuess who or what app using Hugging Face Deep Learning container model on Vertex AI
Create a"Guess who or what" application using Vertex AI, Hugging Face Deep Learning container, an image generation open model, and Gemini to solve and visualize riddles.
View on GitHubVisualizing embedding similarity from text documents using t-SNE plots
Visualize embedding similarity from text documents using t-SNE plots.
View on GitHubVertex AI Vector Search Quickstart
Learn how to use Vertex AI Vector Search to find similar text documents.
View on GitHubAnomaly Detection of Infrastructure Logs using Gemini and BigQuery Vector Search
Learn how to large volumes of infrastructure logs using Gemini, vector embeddings and BigQuery Vector Search to perform anomaly detection.
View on GitHubLog Anomaly Detection & Investigation with Text Embeddings + BigQuery Vector Search
Learn how to large volumes of audit logs using Gemini, vector embeddings and BigQuery Vector Search to perform anomaly detection.
View on GitHubWorking with Data Structures and Schemas in Gemini Function Calling
Learn how to use Gemini Function Calling with data structures and schemas.
View on GitHubWorking with Parallel Function Calls and Multiple Function Responses in Gemini
Learn how to use parallel function calls and multiple function responses in Gemini.
View on GitHubIntroduction to ReAct Agents with Gemini & Function Calling
Learn how to use ReAct Agents with Gemini and Function Calling.
View on GitHubForced Function Calling with Tool Configurations in Gemini
Learn how to use forced function calling with tool configurations in Gemini.
View on GitHubUsing Gemini Function Calling to Get Real-Time Company News and Insights
Learn how to use Gemini Function Calling to get real-time company news and insights.
View on GitHubMultimodal Function Calling with the Gemini API & Python SDK
Learn how to use Gemini Multimodal Function Calling.
View on GitHubAdvanced RAG Techniques - Vertex RAG Engine Retrieval Quality Evaluation and Hyperparameters Tuning
Learn about advanced RAG techniques with evaluation and hyperparameter tuning.
View on GitHubVertex AI RAG Engine with Pinecone
Learn how to use Pinecone with Vertex AI RAG Engine.
View on GitHubVertex AI RAG Engine with Weaviate
Learn how to use Weaviate with Vertex AI RAG Engine.
View on GitHubVertex AI RAG Engine with Vertex AI Feature Store
Learn how to use Vertex AI Feature Store with Vertex AI RAG Engine.
View on GitHubVertex AI RAG Engine with Vertex AI Vector Search
Learn how to use Vertex AI Vector Search with Vertex AI RAG Engine.
View on GitHubVertex AI RAG Engine with Vertex AI Search
Learn how to use Vertex AI Search with Vertex AI RAG Engine.
View on GitHubDebugging and Optimizing Agents: A Guide to Tracing in Agent Engine
Learn how to use Tracing in Agent Engine.
View on GitHubDeploying a RAG Application with AlloyDB to Agent Engine
View on GitHubBuilding a Conversational Search Agent with Agent Engine and RAG on Vertex AI Search
View on GitHubBuilding a Multi-Agent RAG Application with LangGraph and Agent Engine
View on GitHubDeploying a RAG Application with Cloud SQL for PostgreSQL to Agent Engine
View on GitHubBuilding and Deploying a Google Maps API Agent with Agent Engine
View on GitHubBuilding and Deploying a LangGraph Application with Agent Engine in Vertex AI
View on GitHubBuilding a Multimodal Chatbot for Warranty Claims using Gemini and Vector Search in Vertex AI
View on GitHubMultimodal Retrieval Augmented Generation (RAG) using Gemini API in Vertex AI
View on GitHubLlamaIndex with Vertex AI Vector Search to perform question answering RAG
View on GitHubMultimodal Retrieval Augmented Generation (RAG) with Gemini, Vertex AI Vector Search, and LangChain
View on GitHubReAct (Reasoning + Acting) + Custom tool for Healthcare NL API + Gemini + LangChain
View on GitHubMultimodal retail recommendation: using Gemini to recommend items based on images and image reasoning
View on GitHubUse Gen AI Evaluation SDK to Evaluate Models in Vertex AI Studio, Model Garden, and Model Registry
View on GitHubEvaluate Generated Answers from RAG using Rapid Evaluation and Dataflow ML with Vertex AI Pipelines
View on GitHubEvaluate Generated Answers from RAG for QA with Gen AI Evaluation Service SDK
View on GitHubGen AI and LLM Security - ReAct and RAG Attacks & Mitigations
View on GitHubResponsible AI with Gemini API in Vertex AI: Safety Ratings and Thresholds
View on GitHubVertex AI Search - Querying Blended Data Apps and Summarization with Gemini
View on GitHubBuilding a Research Multi Agent System - a Design Pattern Overview with Gemini 2.0
View on GitHubEvaluating Agents - Evaluate a CrewAI agent with Vertex AI Gen AI Evaluation
View on GitHubEvaluating Agents - Evaluate a LangGraph agent with Vertex AI Gen AI Evaluation
View on GitHubInteractive Loan Application Assistant (Financial Services)
View on GitHubEvaluate a CrewAI agent on Vertex AI Agent Engine (Customized template)
View on GitHubEvaluating a LangChain Agent on Vertex AI Agent Engine (Prebuilt template)
View on GitHubEvaluate a LangGraph agent on Vertex AI Agent Engine (Customized template)
View on GitHubWhat's next
- Learn about LLMs, Vertex AI, and Generative AI models with Generative AI beginner's guide.
- Explore more resources in the Generative AI GitHub repo.