- Wrap an external model API (e.g. a third-party provider or an internal service)
- Bundle related capabilities (model + embedder + retriever from the same provider)
- Distribute a reusable integration as an npm/PyPI package
ai.defineModel() directly is simpler and you don’t need a plugin.
Plugin interfaces by language
- TypeScript (v2 API)
- Go
- Python
The current interface is The older
GenkitPluginV2, created with genkitPluginV2 from genkit/plugin:genkitPlugin helper (wraps a Genkit instance) is still used by some plugins but genkitPluginV2 is preferred for new work.Plugin lifecycle
Minimal plugin example
The following TypeScript example creates a plugin that registers a custom text-generation model:Python plugin example
When to write a plugin vs. defineModel directly
Publishing to npm
1
Scaffold the package
2
Add peer dependencies
genkitx-<provider> for unofficial plugins.3
Export from index.ts
4
Build and publish
Registering other action types
Plugins can register any Genkit action, not just models:Related pages
Plugins overview
All official and community plugins at a glance.
Models
How Genkit models, requests, and responses are structured.
RAG guide
Define retrievers and indexers for your knowledge base.
Dev tools
Inspect your plugin’s registered actions in the Genkit Dev UI.
