- 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
ollama list to see what you have installed.3
Verify the server is running
Installation
- TypeScript
- Go
- Python
Configuration
- TypeScript
- Go
- Python
Plugin options
Generating text
- TypeScript
- Go
- Python
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
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 likellava and bakllava accept images alongside text. Send them as data URIs or base64 strings:
Related pages
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.
