← back to AbramsEgo

maxit-tasks/09-ollama-chat.md

18 lines

# AbramsEgo maxit-09 — AI chat panel wired to LOCAL Ollama (SPEC panel 7, unmetered)

Read ../SPEC.md. Build the natural-language chat over the snapshot. Use LOCAL Ollama so it's
$0/unmetered and does NOT consume the Anthropic Max session cap. MINIMAL edits, delimited
regions (merge follows) — ONE new route + ONE new panel.

1. server.js: add authed `POST /api/chat {q}` — build a compact context string from the current
   snapshot (costs, fleet, crons, sessions) and POST to Ollama:
   endpoints in priority order `http://192.168.1.133:11434` (Mac1) then `http://localhost:11434`
   (Mac2 fallback), model `qwen3:14b`, `stream:false`, ~8s timeout. If neither reachable, return a
   deterministic grounded summary from the snapshot (never call any paid API). Always include a
   cost line in the response payload: `$0 (local ollama)`.
2. public/index.html: add an "Ask AbramsEgo" chat panel (input + answer area) calling /api/chat.
3. Verify `node --check server.js` (syntax only; no server run / pm2). Commit
   `feat(chat): local-ollama AI chat panel ($0, cap-relieving)`.

Local only. No paid API, no keys, no deploy.