Skip to main content

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 login locally
Requirements:
  • 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
Learn more about Express Mode
Note: When using Express Mode, don’t provide projectId or location.

Available Models

Gemini Models

  • gemini-2.5-flash - Fast, efficient for most tasks
  • gemini-2.5-pro - Advanced reasoning and complex tasks
  • gemini-1.5-flash - Previous generation fast model
  • gemini-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:
Production:

Error Handling

Rate Limiting

Implement retry logic for production applications:

Migration from Legacy Plugin

If migrating from the old @genkit-ai/vertexai package: Old:
New:
The API remains compatible for most use cases.