AI-101 Build Checklist โ working 101 prototype¶
Ordered path to a working AVA + local-LLM extension 101 that obeys SOP 19. No cloud AI โ STT, LLM and TTS all run on-prem. Do these in order; do not enable 101 for students until Phase 2 gates pass. ๐ = SOP-locked, non-negotiable.
Legend: [ ] todo ยท โ
verified fact ยท โ ๏ธ must verify on our stack.
0. Prerequisites¶
- [ ] Confirm the QEMU VM is up and 111 works today (baseline): call 111 โ ANSWERED (already proven โ in ../deploy/qemu/README.md).
- [ ] Read Integration-Plan.md and deployment.md.
- [ ] No cloud sign-off needed (nothing leaves campus). Instead, confirm budget/availability of a dedicated AI host (see ยง1). Internal 196 only until quality is proven.
1. Decide the AI host + pick the local model โ ๏ธ (the critical prerequisite)¶
- [ ] ๐ You need a capable host. The current TCG VM cannot run the local models in real time (~15s+/turn). Choose (b) a dedicated CPU/GPU box on the mgmt LAN (deployment.md ยง1). Option (a) in-VM is wiring/smoke-test only, not a working 101.
- [ ] Size the hardware to the model (decision to record):
- LLM: Llama 3.1 8B or Qwen2.5 7B instruct, ~4โ5 GB VRAM at Q4 (fits an 8 GB GPU); larger quant/model โ more VRAM. Target GPU turn latency ~0.5โ2s.
- STT: faster-whisper (small/medium) or Vosk; TTS: Piper โ modest, but budget headroom on top of the LLM.
- โ ๏ธ TODO for the user: confirm final model + GPU (VRAM) sizing before Phase 1.5b.
- [ ] If a GPU host: install NVIDIA driver + Container Toolkit;
nvidia-smiworks. - [ ] Verify Docker + Docker Compose v2 present (
docker compose version); install if missing โ ๏ธ.
2. Get AVA running (STT/TTS wired, model pulled)¶
- [ ]
git cloneAVA into/opt/ava; read its own README for exact steps. - [ ] Enable ARI in Asterisk bound to localhost/mgmt only; create ARI user
avawith a strong password (ari.conf,http.conf) โ ๏ธ. - [ ]
agent setupโagent check --local: ARI reachable, transport = AudioSocket โ , local STT/LLM/TTS load. - [ ]
ollama pull qwen2.5:7b-instruct(orllama3.1:8b-instruct); place faster-whisper and Piper model files intolocal_ai_server. After first pull the host can run air-gapped. - [ ] Confirm Stasis app registers:
asterisk -rx "ari show apps"showsasterisk-ai-voice-agentโ .
3. Local model management (NO keys) ๐¶
- [ ] ๐ No LLM API key exists โ inference is local. Confirm
config/ai-agent.local.yamlpoints the LLM at the local Ollama/llama.cpp endpoint (e.g.http://localhost:11434), never an external URL. - [ ] The only secret is the ARI credential in
/opt/ava/.env(chmod 600, git-ignored โ ). - [ ] Pin model versions/digests; back up model files so a rebuild needs no internet.
- [ ] Confirm
.envandconfig/ai-agent.local.yamlare in.gitignore.
4. Configure the upes-ecs-101 agent¶
- [ ] In
config/ai-agent.local.yaml: agent slugupes-ecs-101, pipeline = fully local (faster-whisper + Ollama/llama.cpp + Piper) โ . - [ ] Paste the SOP 19 system prompt (opening / collect / escalation / hard limits) from Integration-Plan ยง3.2.
- [ ] Enable only the
transfertool (โ ext111) + a post-call HTTP hook. ๐ Do NOT enable close / false-alarm / page / voicemail-instead-of-escalate. - [ ]
agent config validatepasses โ .
5. Add the dialplan (196 + 101 + fallback)¶
- [ ] Add
ctx_ai_196,ctx_ai_101,ctx_ai_fallbackto ../config/extensions_custom.conf (Integration-Plan ยง4). - [ ] Record prompt
upes-ecs/ai-unavailable(SOP 19 failure line) into the sounds dir (SOP 28). - [ ]
include => ctx_ai_196in ctx_staff / ctx_ert only (NOT ctx_student). Leavectx_ai_101out of student contexts for now. - [ ] Reload dialplan; test order 198 โ 196 โ 101 โ 111.
6. Prove escalation (101 โ 111) ๐¶
- [ ] Call 196, run a mock "student fainted in Hostel A" scenario โ AI classifies Medical/
High โ
transferโ caller lands inert_emergency_queue(existing 111 flow). - [ ] Verify the escalation phrase / "I want a human" / "emergency" all transfer to 111.
- [ ] Confirm
INCIDENT_IDsurvives the transfer (or thatctx_emergency_111mints one) โ ๏ธ.
7. Prove fallback (any failure โ 111) ๐¶
- [ ] Stop AVA (
docker compose stop), call 101/196 โ hearai-unavailableโ routed to- This is the most important test.
- [ ] Stop the local model (
ollama stop/ killlocal_ai_server) โ AVA errors out of Stasis โ fallback โ 111. - [ ] Simulate transfer-to-111 fail โ critical missed AI emergency record created +
ERT alerted (
missed_incident.shpath) โ ๏ธ. - [ ] Confirm 111 is identical with AVA up vs down.
8. Incident logging (ai_* fields)¶
- [ ] Build the small post-call endpoint /
ai_incident.shthat writesai_summary,ai_detected_category,ai_detected_location,ai_urgency_hint,ai_questions_completedkeyed byINCIDENT_ID(Integration-Plan ยง5). - [ ] Verify a 101 incident shows
source_number=101,ai_triage_enabled=true,transferred_to_111,transfer_time, and is ERT-editable (SOP 12 ยง5). - [ ] Confirm AI cannot close an incident (no such tool; only ERT Lead closes) ๐.
9. Health checks¶
- [ ] Add a 101-only, non-blocking AVA probe to the health script (never flips system/111 to Critical on its own) โ deployment.md ยง5.
- [ ] Green: engine up, ARI app present, STT/LLM/TTS up, 196+101 answer, 101โ111 transfer,
fallback, response time,
ai_*written.
10. Pilot & advance (per SOP 19 ยง10)¶
- [ ] Phase 1.5a: 196 internal only โ soak test, tune prompt/latency.
- [ ] Phase 1.5b: enable 101 for ERT test extensions; Incident Commander reviews + approves prompt/routing.
- [ ] Before Phase 2 (students): ๐ confirm the dedicated AI host meets the latency
budget, record the (already-local) privacy decision
(Integration-Plan ยง3.3),
then add
include => ctx_ai_101to student/staff contexts. No cloud approval needed. - [ ] Document the kill switch (remove include / stop AVA โ callers get 111) in the ERT runbook.
Definition of done (prototype)¶
196 answers with local-LLM triage ยท 101 escalates urgent/unclear to 111 ยท any AI
failure falls back to 111 ยท ai_* pre-brief logged and ERT-editable ยท 111 works with AVA
fully stopped ยท no cloud, no API keys, nothing leaves campus ยท privacy decision
recorded for the Phase 2 gate.