Skip to content

AI provider fields

NovaVMS v5 ships a single VLM provider (Gemini 3.1 Flash-Lite via Vertex AI) plus a local Python AI Runtime sidecar running three CPU models (MobileCLIP2-B, YOLO26n, InsightFace buffalo_l). This page documents the environment-variable contract and the canonical model identifiers, plus the reference checksums used by the AI maintenance wizard.

Environment variables

Loaded from cloud/.env (development) or cloud/.env.prod (production) by the cloud server.

VariableDefaultRequiredPurpose
VERTEX_AI_PROJECTunsetyes for productionVertex AI GCP project. When set, Vertex AI Backend is used.
VERTEX_AI_LOCATIONunsetyes when VERTEX_AI_PROJECT setVertex AI region, e.g. us-central1 or global.
GOOGLE_CLOUD_PROJECTunsetoptionalSDK-native alias for VERTEX_AI_PROJECT.
GOOGLE_CLOUD_LOCATIONunsetoptionalSDK-native alias for VERTEX_AI_LOCATION.
GOOGLE_APPLICATION_CREDENTIALSunsetyes for Vertex AIAbsolute path to the Vertex AI service-account JSON used for Application Default Credentials.
GEMINI_MODELgemini-3.1-flash-litenoOverride the default VLM / judge model.
GEMINI_API_KEYunsetonly for dev / AI Studio fallbackAPI-key auth when VERTEX_AI_PROJECT is unset. AI Studio is geo-blocked from many production VPS regions; production should always use Vertex AI.
AI_RUNTIME_BASE_URLhttp://127.0.0.1:8091noURL of the local AI Runtime sidecar.
AI_RUNTIME_MAX_ACTIVE_REQUESTS1noConcurrent ai-runtime calls. Increase only after benchmark mode confirms CPU headroom.
AI_RUNTIME_ORT_THREADS4noONNX Runtime CPU thread count.
AI_RUNTIME_OPENVINO_THREADS4noOpenVINO inference engine thread count.

The legacy variables AI_PROVIDER, AI_DEFAULT_PROVIDER, AI_DEFAULT_MODEL, AI_ENABLED, AI_FRAME_COUNT_NORMAL, OPENAI_API_KEY, QWEN_API_KEY, and OLLAMA_BASE_URL are NOT consumed by v5. They were retired in the L12 cutover or superseded by the per-organization frame settings.

Model identifiers

The cloud client verifies the AI Runtime response carries these exact identifiers (cloud/internal/ai/runtime_client.go:16-21):

StageIdentifierSource artifact
Visual embeddingmobileclip2_bApple MobileCLIP2-B ONNX export
Object detectionyolo26n_openvinoUltralytics YOLO26n exported to OpenVINO IR
Face detection + recognitioninsightface_buffalo_lInsightFace buffalo_l ONNX bundle
VLM (non-blocking)gemini-3.1-flash-lite (default; GEMINI_MODEL override)Vertex AI

A response whose model_versions block does not exactly match the first three identifiers is rejected by the cloud client — the pipeline retries via the queue. This is the production safeguard against silent model swaps.

Reference checksums

cloud/config/reference_checksums.json is the source of truth. The AI maintenance wizard’s checksum preflight (GET /admin/ai-maintenance/preflight/checksums, handler at cloud/internal/ai/maintenance_handler.go:409) reads this file via h.configDir and compares SHA256s against the actual model files on disk. (ai-runtime/reference_checksums.json is a sibling reference used by the Python sidecar at runtime startup, but the cloud preflight reads its own copy under cloud/config/.)

ArtifactSHA256
MobileCLIP2-B image encoder144b1344f5f01f08af8be1077f0db5eec95bf0fd1e349c1e9ca6102724448486
YOLO26n OpenVINO XML1f6a35fb0008ebcfe3e28847b7c8b5db8f904d13b85ce349b6cb44f40e56faa2
InsightFace buffalo_l5838f7fe053675b1c7a08b633df49e7af5495cee0493c7dcf6697200b85b5b91

Five JPEG fixtures (person, dog, known face, low-light, motion blur) are checksummed separately for the eval harness — see ai-runtime/reference_checksums.json.

Embedding contract

PropertyValue
Visual frame embedding dimension512
Visual frame embedding normalizationL2 (norm must be in [0.99, 1.01])
Face embedding dimension512
Face embedding normalizationL2
Tag text embedding dimension512
Tag text embedding normalizationL2

Frame embeddings and face embeddings are different vector spaces even though they share a dimension. Face vectors live in event_faces.embedding; frame vectors live in frame_embeddings.embedding. They are never compared across tables (v5 PRD §P3).

Frame extraction defaults

Settingv5 defaultConstant
Frame count (uniform mode)8DefaultFrameCountV5
short_edge_px (historical name; maximum width)2560DefaultShortEdgePxV5
JPEG quality85DefaultJPEGQualityV5
Effective max frames cap8DefaultMaxFramesV5

Source: cloud/internal/ai/frame_extractor.go:33-51.

Detection knob defaults

These mirror the current database defaults and CHECK constraints through migrations 000091 and 000092.

KnobDefaultRange
jpeg_quality8550–100
short_edge_px (applied as maximum width)2560320–3840
runtime_active_requests11–8
max_frames81–16
uniform_frame_count81–16
frame_extraction_modeuniformuniform | scene
yolo_confidence0.350.05–0.95
face_in_person_min0.800.50–1.00
face_min_size_px6416–256
thinking_level_defaultminimalminimal | low
ai_v5_intelligence_enabledtruebool