Ollama Target adapter for Waken — routes waken Events to a local/self-hosted Ollama daemon.
Project description
waken-ollama
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waken_ollama-0.1.0.tar.gz.
File metadata
- Download URL: waken_ollama-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ab7d51bea573128d99582eaad56a7d97c550dec1d1bf68199c45de256ad5d26
|
|
| MD5 |
69a0691c886cb6884aaa307122e00f5a
|
|
| BLAKE2b-256 |
9f9e0ad733ef0239867e903cbbd1a4f4128c97ca57d5971098769d2f0b6742b9
|
Provenance
The following attestation bundles were made for waken_ollama-0.1.0.tar.gz:
Publisher:
publish.yml on WakenHQ/waken-ollama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_ollama-0.1.0.tar.gz -
Subject digest:
1ab7d51bea573128d99582eaad56a7d97c550dec1d1bf68199c45de256ad5d26 - Sigstore transparency entry: 2082018392
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-ollama@a871e4c004282e859be8efb360703dbebce9dded -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a871e4c004282e859be8efb360703dbebce9dded -
Trigger Event:
push
-
Statement type:
File details
Details for the file waken_ollama-0.1.0-py3-none-any.whl.
File metadata
- Download URL: waken_ollama-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8d4e9d1f318cdc72cfa2b4d7cd4dd73b30e212016a39d93c6104ed0b53da5ac
|
|
| MD5 |
f0b4f821784ec02f18524c1a70d48ab1
|
|
| BLAKE2b-256 |
1a725af25a4ce71e2a7364c17f562670c7f998052906c57f009d96a2167b0ccf
|
Provenance
The following attestation bundles were made for waken_ollama-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on WakenHQ/waken-ollama
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_ollama-0.1.0-py3-none-any.whl -
Subject digest:
d8d4e9d1f318cdc72cfa2b4d7cd4dd73b30e212016a39d93c6104ed0b53da5ac - Sigstore transparency entry: 2082018433
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-ollama@a871e4c004282e859be8efb360703dbebce9dded -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a871e4c004282e859be8efb360703dbebce9dded -
Trigger Event:
push
-
Statement type: