@genkit-ai/google-genai package is the unified Google plugin for Genkit. It exports two initializers:
googleAI— connects to the Gemini Developer API (Google AI Studio). Best for prototyping, quick experiments, and apps that don’t need a Google Cloud project.vertexAI— connects to Google Cloud Vertex AI. Best for production workloads, enterprise compliance, and access to Vertex-only features. See the Vertex AI plugin page for the full Vertex story.
googleAI.
The older
@genkit-ai/googleai package is superseded by @genkit-ai/google-genai. Migrate by changing your import and plugin initializer — the model reference syntax is identical.Installation
- TypeScript
- Go
- Python
Configuration
API key
Obtain a free API key from Google AI Studio and set it as an environment variable:- TypeScript
- Go
- Python
Plugin options (TypeScript)
TheGoogleAIPluginOptions interface exposes these fields:
Available models
The plugin dynamically discovers available models from the API. Pre-registered known models include:
You can use any model ID supported by the underlying SDK — new models appear automatically without a plugin update.
Basic text generation
- TypeScript
- Go
- Python
Model configuration
Pass aGeminiConfig object alongside the model reference to tune generation:
GeminiConfig fields include:
Structured output
- TypeScript
- Go
Multimodal input
Gemini 2.5 models accept text, images, audio, video, and PDFs in the same request:Function calling (tools)
Embeddings
- TypeScript
- Go
- Python
Embedder config
Image generation (Imagen)
Google Search grounding
Ground responses with real-time web data:Related pages
Vertex AI plugin
Enterprise Gemini access with GCP credentials.
Structured output
Type-safe JSON generation with Zod schemas.
Multimodal
Working with images, audio, and video.
Tools
Give models access to functions and external data.
