Integration · @namzu/ollama
Namzu × Ollama.Local models, no key and no egress.
A local Ollama server: no key, no egress, text streaming.
Install.
pnpm add @namzu/sdk @namzu/ollama@namzu/sdk is a peer dependency, so install both. The SDK needs zod@^3 too.
Why pair the kernel with Ollama.
Ollama owns model weights and inference; Namzu owns the runtime around them: sessions, budgets and the turn loop. A turn can be driven by a model on your own machine with no key and no egress.
- The driver talks to a local Ollama server (default
http://localhost:11434, orOLLAMA_HOST) through theollamaclient. Any model your server has pulled can be named per call. - It streams text. It does not send tool schemas and maps text content only, so image attachments are dropped; the kernel's capability check says so before a turn needs either.
timeoutcovers the whole request, not just the first byte, because the failure it exists for is a local server that accepts the socket and never answers.- Local models in the terminal app are reached through this package.
Example.
import { ProviderRegistry, runAgent } from '@namzu/sdk'
import { registerOllama } from '@namzu/ollama'
registerOllama() // once, at startup
// Local-first: nothing leaves the machine.
const model = 'llama3.2'
const { provider } = ProviderRegistry.create({ type: 'ollama', model })
const { output } = await runAgent({ provider, model, prompt: 'Hello' })
console.log(output)Configure.
Configuration (type: 'ollama')
- hoststring
- Ollama server. Defaults to
http://localhost:11434or theOLLAMA_HOSTenvironment variable. - modelstring
- Default model; overridable per call.
- fetchtypeof fetch
- Fetch override, for example to add headers.
- timeoutnumber (ms)
- Deadline for each request. Absent means none.
What the driver declares.
- StreamingYes
- Tool callsNot sent
- Image attachmentsDropped
- Document attachmentsNot mapped
Ship Ollama agents on a runtime you can own.
Ollama owns the model runner. Namzu owns the runtime. The package is a thin adapter, not a wrapper, so you keep everything Ollama ships and add the kernel concerns you do not get from the model API alone.