Skip to main content
A Genkit plugin is a reusable unit of functionality that registers one or more actions — models, embedders, retrievers, indexers, evaluators, or tools — into the Genkit registry. Plugins are the right abstraction when you want to:
  • 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
If you need a single model for your own app, calling ai.defineModel() directly is simpler and you don’t need a plugin.

Plugin interfaces by language

The current interface is GenkitPluginV2, created with genkitPluginV2 from genkit/plugin:
The older 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

The community naming convention is genkitx-<provider> for unofficial plugins.
3

Export from index.ts

4

Build and publish

Look at the source of @genkit-ai/ollama or @genkit-ai/firebase for real-world plugin patterns — both are relatively compact and show the full lifecycle including model definition, resolver, and list functions.

Registering other action types

Plugins can register any Genkit action, not just models:

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.