@nightowlsdev/provider-ollama
Adapter/ModelRun Night Owls swarms on local models via Ollama, no API key, no per-token cost.
What it does
Exposes `ollamaModels(opts?)`, a model factory for `defineSwarm({ modelFactory })`. It talks to a local Ollama daemon through its OpenAI-compatible endpoint via the first-party `@ai-sdk/openai-compatible` provider (`createOpenAICompatible`), mapping a bare model id (e.g. `llama3.1`) to an AI SDK `LanguageModelV3`. Unlike the hosted providers it needs NO API key, only a `baseURL` (default `http://localhost:11434/v1`, overridable via `OLLAMA_BASE_URL`). Use a tool-calling-capable model so delegation and skills work; local models meter at $0. Ships a `nightOwlsPlugin` manifest for CLI scaffolding; it composes with the hosted adapters, so `createModelFactory` can route cheap tasks to the local daemon and the rest to a frontier model. Imports only its AI SDK provider, zero `@mastra/*`.
Install
pnpm add @nightowlsdev/provider-ollamaKey exports
- ollamaModels
- nightOwlsPlugin
Usage
import { defineSwarm } from "@nightowlsdev/core";
import { ollamaModels } from "@nightowlsdev/provider-ollama";
// Local models via Ollama, no API key. Reads OLLAMA_BASE_URL (default http://localhost:11434/v1).
const swarm = defineSwarm({ agents, modelFactory: ollamaModels() }); // MODEL_ID is a bare id, e.g. llama3.1