Implement local Ollama generation provider #62

Merged
lost-rob0t merged 6 commits from agent/issue-21-ollama-generation into main 2026-07-21 23:30:38 +00:00
lost-rob0t commented 2026-07-21 21:18:43 +00:00 (Migrated from github.com)

Hey Codex here.

Closes #21.

Scope

  • implement the shared GenerationProvider contract for a loopback-only Ollama endpoint
  • add explicit extraction, summarization, and answering model roles
  • discover context length, vision support, structured-output support, and availability
  • enforce redacted-only input, bounded request/response sizes, bounded concurrency, timeout, and cooperative cancellation
  • forbid Ollama requests while capture is active and never invoke model download APIs
  • require schema-validated {"text": "..."} model output before constructing a domain response

TDD evidence

Red phase:

PYTHONPATH=src /tmp/local-recall-venv/bin/pytest -q tests/unit/providers/test_ollama.py
# non-zero: local_recall.providers.ollama did not exist

Green phase:

PYTHONPATH=src /tmp/local-recall-venv/bin/pytest -q tests/unit/providers/test_ollama.py
12 passed in 0.18s

Full repository gate:

./scripts/check
140 files already formatted
All checks passed!
0 errors, 0 warnings, 0 informations
195 passed in 1.56s
verified 8 failure modes
repository policy checks passed

The remote head was re-read after publication and all six issue-scoped files exactly match the validated local content.

Risk

The built-in transport intentionally supports only plain HTTP loopback origins and bounded, non-streaming responses. It does not pull models or silently fall back to a remote provider. If Ollama is unavailable, provider calls fail with sanitized errors while capture and indexing remain independent.

CI

Current-head GitHub checks are pending and remain the final validation gate.

Hey Codex here. Closes #21. ## Scope - implement the shared `GenerationProvider` contract for a loopback-only Ollama endpoint - add explicit extraction, summarization, and answering model roles - discover context length, vision support, structured-output support, and availability - enforce redacted-only input, bounded request/response sizes, bounded concurrency, timeout, and cooperative cancellation - forbid Ollama requests while capture is active and never invoke model download APIs - require schema-validated `{"text": "..."}` model output before constructing a domain response ## TDD evidence Red phase: ``` PYTHONPATH=src /tmp/local-recall-venv/bin/pytest -q tests/unit/providers/test_ollama.py # non-zero: local_recall.providers.ollama did not exist ``` Green phase: ``` PYTHONPATH=src /tmp/local-recall-venv/bin/pytest -q tests/unit/providers/test_ollama.py 12 passed in 0.18s ``` Full repository gate: ``` ./scripts/check 140 files already formatted All checks passed! 0 errors, 0 warnings, 0 informations 195 passed in 1.56s verified 8 failure modes repository policy checks passed ``` The remote head was re-read after publication and all six issue-scoped files exactly match the validated local content. ## Risk The built-in transport intentionally supports only plain HTTP loopback origins and bounded, non-streaming responses. It does not pull models or silently fall back to a remote provider. If Ollama is unavailable, provider calls fail with sanitized errors while capture and indexing remain independent. ## CI Current-head GitHub checks are pending and remain the final validation gate.
Sign in to join this conversation.
No description provided.