Emergency — handle Gemini and AI Runtime degraded modes
NovaVMS v5 ships a single VLM provider (Gemini 3.1 Flash-Lite via Vertex AI) plus a local AI Runtime sidecar running three CPU models. There is no second VLM provider to fail over to — the multi-provider AI_PROVIDER=openai toggle was retired in the L12 cutover. This runbook covers the two degraded modes operators DO have control over.
Mode 1: Gemini degraded
Symptom: gemini_judge_usage continues to climb but the “VLM understanding” tab on AI evidence panels stops populating; OR AIModelHealthCards Gemini card flips to a degraded badge; OR cloud logs show gemini AnalyzeEvent permanent failure for sustained periods.
Cloud behaviour:
- Deterministic alert rules continue to fire (do not require Gemini).
- Search falls back to the rule-based query parser (Phase 2 path).
- Contextual alert judges return a “Gemini degraded” error code; the judge is skipped and the compiled rule treats it as a non-match by default.
- New events still reach
indexedbecause indexing does not call Gemini.
Operator action:
-
Confirm the outage at https://status.cloud.google.com/ (Vertex AI). If it’s region-localised, you can flip
VERTEX_AI_LOCATIONto a different region incloud/.env.prod:Terminal window sed -i "s/^VERTEX_AI_LOCATION=.*/VERTEX_AI_LOCATION=us-east1/" cloud/.env.prod && \docker compose restart cloud'The cloud container restarts in < 30 seconds. Verify with
docker logs novavms-cloud --tail=50 | grep gemini. -
If the outage is global to Vertex AI, announce a degraded mode in
#novavms-incidents. There is no second VLM to fail over to. NovaVMS continues to function for indexing, search (rule parser), and deterministic alerts. -
If a partial org-level disable helps (for example, a customer’s contextual judges are spending too much during a Gemini brownout), set
vlm_understanding_enabled = falseon the org viaPATCH /api/v1/ai/settings/features. The admin can do this from/admin/ai → AI features → Scope matrix. -
When Vertex AI recovers, flip the region back and restart the cloud container. The non-blocking VLM understanding layer drains automatically as the queue runs through pending summaries.
Mode 2: AI Runtime degraded
Symptom: /admin/ai → AI Runtime — Model health shows any of MobileCLIP2-B / YOLO26n / InsightFace as Degraded, Unloaded, or Unknown for more than a refresh cycle; OR cloud logs show ai-runtime retries exhausted for sustained periods; OR GET /api/v1/admin/ai-runtime/health returns {"ok": false, ...}.
Cloud behaviour:
- Cloud client (
cloud/internal/ai/runtime_client.go) retries 3 times with backoff (500ms then 5s, 3s per-attempt timeout). - Persistent failures mark per-event evidence stages failed; events do NOT reach
indexeduntil the runtime recovers. - Search against already-indexed events continues — only new events stall.
Operator action:
-
SSH to the cloud host and check the AI Runtime container:
Terminal window If it’s down or restart-looping, check the logs:
Terminal window -
Common AI Runtime failure modes:
- Model checksum mismatch: run
/admin/ai → Maintenance wizard → Run checksum preflight. Any non-matching SHA256 indicates a bad model artifact; rebuild the AI Runtime container with the canonical artifact fromai-runtime/reference_checksums.json. - OOM: the v5 RSS budget is < 3 GB warm. If the host is OOM-killing the container, free memory on the host or move to a larger instance.
- Port collision: the sidecar binds
127.0.0.1:8091by default. Confirm nothing else has claimed the port.
- Model checksum mismatch: run
-
If the AI Runtime is fully down and recovery will take more than a few minutes, set the org-level master toggle
ai_v5_intelligence_enabled = falseon every affected org viaPATCH /api/v1/ai/settings. This stops events from piling up inpendingand lets operators see the failure clearly in/admin/ai. -
After recovery, flip
ai_v5_intelligence_enabledback on. Stalled events (those captured during the outage) do not auto-retry; trigger them viaPOST /api/v1/ai/reprocesswith{"scope": "failed"}or{"scope": "date_range", "date_from": ..., "date_to": ...}.
Common variations
- Tighter per-org scope. If only one org is affected, use the per-feature flags at
/admin/ai → AI features → Scope matrixto disable specific stages (e.g. only object detection) without halting indexing. - AI Studio fallback for dev only. Setting
GEMINI_API_KEYwithoutVERTEX_AI_PROJECTroutes Gemini calls to AI Studio’s public endpoint. Production HostHatch hosts are geo-blocked from that endpoint — keep Vertex AI on for prod.
Related
- Configure AI for your organization — admin tuning surface
- AI provider fields — Vertex AI configuration reference
- Event has no AI evidence — per-event triage
- Feature-flag rollout — slower per-org rollout when not in an outage