Vertex AI Plugin
The Vertex AI plugin is now part of the unified@genkit-ai/google-genai package, which provides access to both Google AI (Gemini Developer API) and Vertex AI models.
This page documents the Vertex AI functionality within the
@genkit-ai/google-genai plugin. For the complete plugin documentation including Google AI features, see Google GenAI Plugin.Installation
Quick Start
Authentication
Vertex AI supports two authentication methods:Application Default Credentials (Production)
The standard method for production deployments. Uses credentials from:- Service account on Google Cloud Platform
- User credentials from
gcloud auth application-default loginlocally
- Google Cloud Project with billing enabled
- Vertex AI API enabled
- Proper IAM permissions
Vertex AI Express Mode (Development)
Streamlined access using just an API key, without billing setup. Ideal for:- Quick experimentation
- Learning and prototyping
- Generous free tier quotas
projectId or location.
Available Models
Gemini Models
gemini-2.5-flash- Fast, efficient for most tasksgemini-2.5-pro- Advanced reasoning and complex tasksgemini-1.5-flash- Previous generation fast modelgemini-1.5-pro- Previous generation advanced model
Image Generation
imagen-3.0-generate-002- High-quality image generation
Music Generation
lyria-002- AI music generation (Vertex AI exclusive)
Embeddings
text-embedding-005- Text embeddings
Usage Examples
Text Generation
Multimodal Input
Structured Output
Text Embeddings
Image Generation with Imagen
Music Generation with Lyria
Using in Flows
Configuration Options
Plugin Configuration
Model Configuration
Vertex AI Features
Vertex AI offers enterprise features beyond the Gemini Developer API:Enterprise Capabilities
- IAM Integration - Google Cloud IAM for access control
- VPC Support - Private networking options
- Audit Logging - Comprehensive audit trails
- Data Residency - Regional data processing
- SLA Support - Enterprise service level agreements
Advanced Features
- Fine-tuning - Custom model training
- Model Garden - Access to multiple model families
- Lyria Music Generation - AI-powered music creation
- Batch Prediction - Efficient bulk processing
- Model Monitoring - Performance tracking
Pricing
Vertex AI uses Google Cloud billing. See Vertex AI Pricing for details. Express Mode offers generous free tier quotas for experimentation.Best Practices
Development vs Production
Development:Error Handling
Rate Limiting
Implement retry logic for production applications:Migration from Legacy Plugin
If migrating from the old@genkit-ai/vertexai package:
Old:
Links
- Vertex AI Documentation
- Vertex AI Express Mode
- Vertex AI Pricing
- Google GenAI Plugin - Full plugin documentation
- Source Code