System design
System Design Workflow
The diagram is the fast reference for explaining the product out loud or to a driver-facing engineer. The breakdown underneath it is the same workflow with the exact file, function, and parameter behind every box, for anyone who wants to check the code directly.
Visual reference
Radio call → verdict, top to bottom
One audio clip splits into two model paths, merges into a single structured record, runs through four independent evidence checks in parallel, and converges into one verdict. Nothing here is a single black-box score — every arrow is a real function call, mapped out in detail underneath the diagram.
For technical Q&A
System Design Workflow
What happens, in order, when a radio call comes in — and exactly which file and function does it. Every parameter below is a real, measured value, not a placeholder.
Audio in → Transcription
The driver's radio call (raw audio) is converted into text. This is the “translation” step — speech to words.
model distil-whisper/distil-large-v3.5-ct2 (via faster-whisper)
where in code services/radio_ai/app/asr.py → transcribe()
parameters live in Model ID + pinned version: services/radio_ai/app/config.py → ModelConfig
Tone / Voice Analysis
The raw audio itself (not the words) is scored for how the driver sounds — calm, stressed, or tired.
- ·Arousal — how excited/tense the voice sounds
- ·Fatigue_Exhaustion — how tired the voice sounds
- ·Recording_Quality — how clean the audio is
- ·Background_Noise — how much noise is in the clip
Fatigue ≥ 1.1 → FATIGUED. Else if Arousal ≥ 2.565 → ELEVATED_AROUSAL. Else → CALM. Low quality/high noise doesn't change the label — it lowers the confidence score instead.
model laion/voiceclap-commercial (encoder + attribute heads)
where in code services/radio_ai/app/tone.py → score_waveform(), map_to_label()
parameters live in services/radio_ai/app/config.py → ToneThresholds class — Arousal threshold 2.565, Fatigue threshold 1.1
Complaint Category
The transcribed words are matched against 5 fixed problem categories — sorted, not diagnosed.
model sentence-transformers/all-MiniLM-L6-v2 (embedding + prototype similarity)
where in code services/radio_ai/app/complaint_classifier.py → classify()
parameters live in services/radio_ai/app/config.py → ClassifierConfig class — 5 category descriptions + similarity margin 0.16
Evidence Engine — the solution being generated
This is where the actual answer gets built: is the car really behaving differently, has this happened before, and how much warning did the call give. Plain statistics, not a model.
- ·baseline.py → compare_to_baseline() — this lap vs. the driver's own last 5 laps at this corner
- ·retrieval.py → best_match() — search past incidents for a similar report
- ·lead_time.py → measure_lead_time() — seconds between the call and the measurable change
- ·recurrence.py → assess_recurrence() — does the driver's own wording say “again”/“still”
where in code services/evidence_memory/
Final Output → Incident Assessment
Everything above is combined into one verdict — sent to the dashboard as a single JSON record, never a raw score.
where in code services/core_api/app/pipeline.py → evaluate_incident()
parameters live in Served over HTTP by services/core_api/app/main.py → /v1/incidents/{id}