How I built a mental health companion that never connects to the internet, and why the most important safety decisions have nothing to do with the AI.
The Problem
Mental health conversations are the most private conversations you can have. If you're telling something to an AI about suicidal thoughts, trauma, or shame, you need to know — really know — that those words don't go anywhere.
But every AI companion app I could find sends your words to a cloud server. Your most vulnerable moments, stored on someone else's machine, processed by someone else's model, governed by someone else's privacy policy. That felt wrong.
So I built NilaMind — an open-source Android app that runs a 1.5B-parameter language model entirely on your phone. No cloud. No account. No analytics. Not even your voice leaves the device.
Here's how every piece of the architecture works, and why the safety design matters more than the model.
The Stack at a Glance
| Layer | Technology |
|---|---|
| UI | React 19, Tailwind 4, Vite 6 |
| Mobile Shell | Capacitor 8 (Android) |
| LLM Runtime | llama.cpp (C++, JNI bridge) |
| Default Model | Qwen2.5-1.5B-Instruct Q4_K_M GGUF |
| Voice Input | Vosk WASM (on-device STT) |
| Crisis Classifier | MiniLM via ONNX Runtime Web |
| Storage | Dexie (IndexedDB) + AES-256-GCM |
| Identity | BIP39 (no-account recovery phrase) |
Running llama.cpp on Android
The inference engine is
APK:
Important: NilaMind is not a medical device, not therapy, and not a crisis service. It's an experimental self-help tool. If you are in crisis, contact emergency services or a crisis line.
- It's shared openly so others can learn from it and build on it. If you're struggling, you're not alone.*
SOCIAL SHARE CARD GENERATOR