How plugins extend Genkit
Every plugin follows the same lifecycle:- Register — pass the plugin to
genkit({ plugins: [...] })(JS/TS),genkit.Init(ctx, genkit.WithPlugins(...))(Go), orGenkit(plugins=[...])(Python). - Lazy init — the registry calls
init()/Init()on first use, not at startup, so cold-start cost is minimised. - Resolve — when your code references
googleai/gemini-2.5-flash, the registry asks thegoogleaiplugin to materialise that action on demand. - List — the Dev UI calls
list()/list_actions()to enumerate every available model or embedder for the action explorer.
You can configure multiple plugins in the same Genkit instance — for example
googleAI() for prototyping and vertexAI() for production — and choose between them at call time by qualifying the model name with its provider prefix.Official plugins
JavaScript / TypeScript
Go
Python
Quick start
- TypeScript
- Go
- Python
The plugin interface
At its core, a plugin implements three methods:
In TypeScript the modern interface is
GenkitPluginV2 (from genkit/plugin). In Go plugins implement the api.Plugin interface. In Python plugins extend the abstract Plugin base class from genkit._core.plugin.
See Writing plugins for a complete walkthrough.
Related pages
Google AI plugin
Gemini, Imagen, Veo, and embeddings via the Gemini Developer API.
Vertex AI plugin
Enterprise access to Google models on Google Cloud.
Ollama plugin
Run Llama, Mistral, Gemma, and other models fully locally.
Firebase plugin
Firestore vector search and Firebase telemetry.
Writing plugins
Build your own plugin and publish it to npm.
RAG guide
Use retrievers and embedders together for retrieval-augmented generation.
