Add fox as primary AI summarizer with cube fallback #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "orbit-5-fox-primary-cube-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summaries run through a single Ollama backend (cube/qwen3 via
OLLAMA_URL). A single backend means summarization stalls whenever that host is down, and it can't take advantage of fox (gemma4:26b), which produced tighter summaries at comparable latency in a 4-article comparison. This makes fox the primary summarizer with cube as an automatic fallback.Solution
fox is served by llama-swap and speaks only the OpenAI-compatible
/v1/chat/completionsAPI — it 404s on Ollama's/api/chat— so a config-only switch isn't possible. This adds anAnalyzerinterface with two implementations (OllamaClient,OpenAIClient) sharing the Norwegian prompt and JSON-extraction logic, plus aFallbackAnalyzerthat tries the primary first and retries the fallback on any error (but not on context cancellation / shutdown).To avoid a config trap, the existing
OLLAMA_URL/OLLAMA_MODELkeep configuring the fallback backend — so the deployed unit, which already setsOLLAMA_URL=cube, needs no change. A newAI_URL/AI_MODEL/AI_API(defaulthttp://fox:11434,gemma4:26b,openai) configures the primary. The Ollama client timeout is raised 30s→60s to tolerate cold model loads (~48s observed).This re-ports work originally written against an orphaned repo line (old PR #4, preserved on
orbit-main-archive) onto the canonical codebase.Verification
go build+go vetclean; all AI/config tests pass. The 4 pre-existing failures on this branch (snapshot/desk OIDC tests) are unchanged frommain— not introduced here. The OpenAI/Ollama client paths were validated live against fox and cube earlier.Deploy note
Not for deploy until approved. On deploy, summaries switch cube→fox automatically (fox is the default primary); cube remains the fallback via the unit's existing
OLLAMA_URL. No unit change required.Closes #5
Closing without merge: this work is already on
main. The deploy-from-git branch (PR #8) was accidentally branched off this one, so its squash merge (06d456b) bundled the full fox/cube AI feature along with the deploy change.mainhas the complete, wired feature (build + AI tests pass). Tracked by #5.Pull request closed