Event-Driven Traffic Congestion Intelligence Platform — Predictive ML, Resource Optimization, Offline LLM Copilot, and Real-Time Command Center for Bengaluru Traffic Operations.
Five distinct layers — from raw data ingestion through AI inference to the React command interface. Each layer communicates via well-defined interfaces.
Our own domain-specific language model for traffic operations. Runs on CPU, requires no internet, and is contextually aware of the active incident at all times.
Whisper (tiny.en, offline) converts officer voice commands to text. WebSpeech API browser fallback. Domain vocabulary boost for traffic terms — "SilkBoard", "deploy", "barricade". <300ms recognition on CPU. Hindi + English support.
Coqui (offline neural synthesis) reads Naxerion responses aloud. Priority-adjusted prosody — CRITICAL alerts use urgent tone. WebSpeechSynthesis as browser fallback. First audio in <500ms. Edge WASM deployable.
All components run on a single edge device — Raspberry Pi 5, Intel NUC, or a standard laptop — with zero internet dependency.
Raspberry Pi 5 (8GB) / Intel NUC / Laptop. All AI models, FastAPI server, and React build co-located. Local WiFi for field device connectivity.
Every API endpoint, all ML models, Naxerion LLM, STT/TTS, and map tiles function without internet. SQLite for local data persistence. Sync on reconnect.
Real-time incident metrics, officer utilization, queue depth, and zone heat maps computed from local data — no cloud stream required.
A lightweight pub/sub store syncs the active incident context across all 6 React screens in real-time — no Redux, no boilerplate.
Global singleton holds: eventCause, zone, junction, lat/lon, priority, roadClosure, durationMin, officers, barricades, diversions. Any component update instantly propagates to all 6 pages via useActiveEvent() hook.
Recharts Area + Bar charts fed by FastAPI data. Monthly trend (planned vs unplanned), cause distribution, zone heat map, officer utilization — all computed from the loaded Pandas DataFrame on-device.
Select an incident on Command Center → all screens instantly reflect updated context
12 production endpoints across 5 modules. FastAPI 0.137 · Uvicorn ASGI · Pydantic v2 · Auto OpenAPI docs.
| METHOD | ENDPOINT | MODULE | PURPOSE | KEY FIELDS |
|---|---|---|---|---|
| GET | /health | System | Server status + loaded model names | status, data_loaded, models_loaded[] |
| GET | /api/analysis/summary | Analysis | Aggregate KPI summary of all incidents | total_events, avg_duration_min, road_closures_required |
| GET | /api/analysis/cause-distribution | Analysis | Incident count grouped by cause | [ {cause, count} ] |
| GET | /api/analysis/timeline | Analysis | Monthly planned vs unplanned trend | [ {month, planned, unplanned, total} ] |
| GET | /api/analysis/hotspots | Analysis | Geo-tagged incident list for Leaflet map | [ {lat, lon, cause, priority, road_closure, address} ] |
| GET | /api/analysis/lessons-learned | Analysis | Repeat junction patterns + recommendations | top_repeat_junctions[], top_zones[], causes_by_delay[] |
| POST | /api/predict/predict-all | Predict | RF + GB inference — priority, closure, duration | predicted_priority, priority_confidence, predicted_duration_minutes |
| GET | /api/predict/feature-importances | Predict | RF feature importance scores for visualization | { "zone": 0.23, "hour": 0.18, ... } |
| POST | /api/optimize | Optimize | OR-Tools MIP — optimal officer + barricade count | recommended_officers, recommended_barricades, expected_reduction_percentage |
| POST | /api/similarity | RAG | Cosine similarity — top-K historical incident matches | matches[]: { similarity_score, historical_action, address } |
| POST | /api/simulate | Simulate | M/D/1 queue simulation — before vs after intervention | simulation_timeline[], metrics.overall_delay_reduction_percentage |
| WS | /ai/live-stream | Naxerion | WebSocket — streaming LLM token output + live alerts | Server-sent token stream, alert event payloads |
From raw incident input to AI-generated playbook — 7 deterministic stages with measured latencies.
0.137.10.49.03.0.32.4.61.9.01.5.39.15.67552.13.418+CSS vars6+SVG iconsArea/Bar/PieOSM/EsriHMR proxystrictGGUF Q4CPU onlytiny.enoffline9.15NumPylocal cachecachedFive concrete differentiators that make this solution stand out from 60,000+ competing teams.
Not using GPT/Gemini API — we built and fine-tuned our own model on traffic operations data. Runs offline on CPU. No team in this competition can claim a custom offline LLM for their domain.
OR-Tools Mixed Integer Program — not heuristics, not rules. Provably optimal officer and barricade deployment minimizing cost subject to capacity constraints. Solved in <200ms.
Officers speak commands in the field → Whisper STT → Naxerion generates tactical plan → Coqui TTS reads it back. Hands-free AI operations. Entire pipeline offline in <3 seconds.
HTML5 Canvas renders actual animated car queues in 4 lanes. Vehicles physically drain as you increase officers/barricades via sliders. Visual proof of intervention impact — unique in this competition.
Run uvicorn app.main:app --port 8000 + npm run dev → entire platform live. No .env secrets, no cloud keys, no network. Select incident → Generate Plan → Naxerion responds in <3s → TTS reads it aloud → map updates. Demonstrable in one screen, zero setup.