Skip to main content

Ollama logoOllama

Ollama is available through the AI SDK. Install the provider package to use their models with Mastra.

For detailed provider-specific documentation, see the AI SDK Ollama provider docs.

Ollama isn't a model router provider, so model strings like ollama/<model> don't resolve. Pass a model instance from ollama-ai-provider-v2 to the agent's model option instead.

To use this provider with Mastra agents, see the Agent Overview documentation.

Installation
Direct link to Installation

npm install ollama-ai-provider-v2
On this page