Skip to main content

waken-ollama

CI License: MIT

Ollama Target adapter for Waken — "nginx for AI agents." Routes a waken Event to a local or self-hosted Ollama daemon via the official ollama Python SDK and returns a Response.

Why Ollama fits here particularly well

Every other Target adapter in this ecosystem wraps a cloud API and needs an API key (ANTHROPIC_API_KEY, GEMINI_API_KEY, ...). Ollama needs none of that — it's a daemon that runs on hardware you already control, the same "no external services" idea behind Waken itself: waken keeps all its own state (sessions, scheduled jobs, the retry queue) in one local SQLite file instead of reaching for Docker, Redis, or Postgres. waken-ollama extends that same idea to the model itself — no cloud account, no billing, no secret to manage, just a local process talking to another local process.

Install

pip install waken-ollama

Prerequisite: Ollama must already be installed and running — either locally (ollama serve, or the desktop app, which starts it automatically) or as a self-hosted daemon reachable over the network — with the model you intend to use already pulled:

ollama pull llama3.2

This adapter only talks to an already-running daemon; it doesn't install Ollama, start it, or pull models on your behalf. If the daemon isn't reachable, calls raise a ConnectionError — that's a setup problem to fix on the machine running Waken, not something this adapter papers over.

Usage

from waken import Runtime
from waken_ollama import OllamaAdapter

runtime = Runtime()
runtime.target("ollama", OllamaAdapter(model="llama3.2"))
runtime.run()
waken send ollama "Build tic tac toe." --wait

By default OllamaAdapter talks to http://127.0.0.1:11434, or whatever OLLAMA_HOST is set to in the environment — the ollama SDK's own convention, read automatically. Point it at a remote/self-hosted daemon with host=:

runtime.target("ollama", OllamaAdapter(model="llama3.2", host="http://gpu-box:11434"))

Ollama's /api/chat endpoint has no server-side conversation state, unlike Claude's resume or OpenAI's previous_response_id — the full message history has to be resent on every call. OllamaAdapter keeps a waken session_id -> list of chat messages map internally and grows it in place across turns of the same event.session_id, so a multi-turn conversation picks up where it left off without the caller managing history itself. Extra keyword arguments passed to OllamaAdapter(...) are forwarded to ollama.AsyncClient(...).

Development

git clone https://github.com/WakenHQ/waken-ollama
cd waken-ollama
pip install -e ".[dev]"
pytest

Tests mock ollama.AsyncClient entirely — no local Ollama daemon or network access is needed to run the suite.

License

MIT

Metadata

Release files for waken-ollama 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waken-ollama 0.1.0
File Size Uploaded
waken_ollama-0.1.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for waken-ollama 0.1.0
File Interpreter ABI Platform
waken_ollama-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / waken_ollama-0.1.0.tar.gz

Download URL waken_ollama-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1ab7d51bea573128d99582eaad56a7d97c550dec1d1bf68199c45de256ad5d26
BLAKE2b-256 checksum
How to use checksums
9f9e0ad733ef0239867e903cbbd1a4f4128c97ca57d5971098769d2f0b6742b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Release files / waken_ollama-0.1.0-py3-none-any.whl

Download URL waken_ollama-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8d4e9d1f318cdc72cfa2b4d7cd4dd73b30e212016a39d93c6104ed0b53da5ac
BLAKE2b-256 checksum
How to use checksums
1a725af25a4ce71e2a7364c17f562670c7f998052906c57f009d96a2167b0ccf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page