Skip to main content
The Ollama plugin connects Genkit to an Ollama server running on your machine or a private host. This enables fully local, private AI inference — your data never leaves your network. Use cases:
  • Development and testing without API costs or rate limits
  • Privacy-sensitive applications where data cannot leave the premises
  • Air-gapped environments
  • Comparing open-source models against hosted ones within the same flow

Prerequisites

1

Install Ollama

Download and install Ollama from ollama.com. The Ollama server starts automatically and listens on http://localhost:11434.
2

Pull a model

Run ollama list to see what you have installed.
3

Verify the server is running

Installation

Configuration

Plugin options

Generating text

Dynamic model resolution

If you don’t pre-declare models in the plugin config, Genkit will ask Ollama to resolve the model on first use — provided it is already pulled:
Embedding models must be declared upfront with their dimensions value because the Ollama API does not expose dimensionality metadata. Models can be resolved dynamically.

Model configuration

Pass generation options directly:

Embeddings

Combine the Ollama embedder with @genkit-ai/dev-local-vectorstore for a fully local RAG pipeline with no external dependencies.

Multi-turn chat

Function calling (tools)

Several Ollama models support OpenAI-compatible tool calling. The plugin automatically enables tools for known-compatible models (Llama 3.1/3.2, Mistral, Qwen 2.5, Phi-4, and others):

Remote Ollama server

Point the plugin at any reachable Ollama server (e.g. a GPU workstation on your LAN or a private VM):

Multimodal input

Models like llava and bakllava accept images alongside text. Send them as data URIs or base64 strings:

Google AI plugin

Hosted Gemini models with more capabilities.

Sessions

Maintain conversation history across multiple turns.

RAG guide

Build retrieval pipelines with local embeddings.

Tools

Let models call functions during generation.