Skip to content

hive: ollama-worker — WorkerBee that calls Ollama's HTTP API - #48

Open
adiled wants to merge 1 commit into
mainfrom
hives/ollama-worker
Open

hive: ollama-worker — WorkerBee that calls Ollama's HTTP API#48
adiled wants to merge 1 commit into
mainfrom
hives/ollama-worker

Conversation

@adiled

@adiled adiled commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

A new hive that implements a WorkerBee for local LLMs via Ollama.
Sends prompts to Ollama's /api/chat endpoint and streams the response back over thrum.

Why

hum had no worker bee for local LLMs — only claude-cli (requires Anthropic CLI) existed as an inference worker. ollama-server and openai-server are API gateways (foragers), not workers. This fills the gap.

How

  • New hives/ollama-worker/ crate with WorkerBee trait impl
  • Worker emits thrum chi events directly (chi:"chunk", chi:"finish", chi:"error") instead of claude's stream-json format
  • Modified serve.rs (nest-common) to pass through chi events without translation, so any worker can emit thrum events natively
  • Default model: smollm:1.7b (the smallest Ollama model), configurable via OLLAMA_WORKER_MODEL / OLLAMA_WORKER_MODELS

Tested

curl -X POST http://127.0.0.1:14620/v1/chat/completions   -H "Content-Type: application/json"   -d '{"model":"smollm:1.7b","messages":[{"role":"user","content":"say hi"}],"stream":false}'

Returns valid OpenAI-compatible response with model output. Streaming also works.

Sends prompts to Ollama's /api/chat endpoint and streams the
response back over thrum. Run any local LLM Ollama supports.

Also modifies serve.rs (nest-common) to pass through chi events
directly instead of requiring claude's stream-json format, so
workers that emit thrum events work natively.

Ollama-worker registers as a worker bee with configurable models
via OLLAMA_WORKER_MODEL / OLLAMA_WORKER_MODELS env vars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant