Answer five short questions about frequency, intensity, plan, protective factors, and personal resources — and get routed to the right Montréal support, from telephone lines to psychiatric emergency.
Try an example:
As LLMs become embedded in everyday tools used by children and teenagers, a vulnerable young person expressing a mental health crisis in a chat interface is no longer a hypothetical. safe-minds is a lightweight, privacy-first pipeline that classifies risk in real time and routes to the right help — from a phone call to a mobile crisis team to psychiatric emergency.
Stage 1 catches unambiguous crisis language in microseconds at zero cost. Stage 2 handles nuance — context, tone, and passive ideation — using a local LLM.
Pattern-based scan. CRISIS hits fast-path directly to emergency response — no model call needed.
Microsoft's Phi-3-mini (3.8B) runs locally on Apple Silicon via MPS. Handles nuance regex can't catch.
Designed to run on any device, with full audit trails for regulatory review — aligned with EU AI Act requirements for high-risk AI in healthcare.
microsoft/Phi-3-mini-4k-instruct — 3.8B params, strong instruction-following, runs in float16 on Apple Silicon via MPS.
No data sent to external APIs. Model runs locally via PyTorch MPS backend — critical for HIPAA/PIPEDA-compliant deployments.
Every assessment produces structured JSON: risk level, confidence, indicators, reasoning, model used, and UTC timestamp.
Regex pre-filter handles obvious cases at zero cost. LLM stage only fires when nuanced contextual reasoning is needed.
Triage logic routes to verified Montréal crisis resources — SPC Montréal, Tracom, Douglas Institute, and 911 — based on severity.
System prompt encodes AFSP / KHP guidelines. Model never provides methods, always validates distress, always surfaces resources.
Developed for Championing AI for Good: Building Safer AI for Youth Mental Health — co-organized by Mila, Bell, Buzz HPC, and Kids Help Phone.
"AI has a clear capacity to expand the reach of mental health professionals — yet this potential is matched by equally significant risks. How do we ensure AI systems do not cause harm when engaging with individuals in crisis?"
— Hackathon opening conference, Mila × KHP