I present Health Passport, a privacy-first medical document scanner that processes prescriptions, lab reports, and medical records entirely on-device using six NPU-accelerated AI models running on Qualcomm Snapdragon 8 Elite via NexaSDK. Where 80% of health apps share data with third parties, Health Passport achieves true HIPAA-compliant data handling by eliminating cloud uploads entirely — no data leaves the device. The system implements a Smart Pipeline Router that automatically dispatches user input (text, camera, voice) to the appropriate model, with a time-to-first-token of 446ms and decode throughput of 19 tok/s on the Hexagon NPU. A conversational RAG interface lets users query their own Health Vault: "What are my current medications?" Phase 1 finalist and Grand Prize winner of the Nexa AI × Qualcomm On-Device Bounty (official winners page). Officially recognized for showcasing "the true potential of private, fast, on-device AI."
Medical data privacy is broken in a way most patients don't see. A 2024 BMJ study found that 80% of health applications share user data with third-party advertising and analytics services. Healthcare data breaches cost $10.93M per incident — the highest of any industry (IBM, 2023). And yet the dominant paradigm for medical AI applications routes sensitive data through cloud APIs, creating attack surfaces at every hop.
I have personal experience with fragmented medical records across 7+ countries. Every time I switch doctors, I repeat my entire medical history because there is no portable, privacy-preserving way to carry structured health data. The problem isn't that medical AI doesn't exist — it's that existing solutions require you to trust corporations with your most sensitive data in exchange for using them.
The alternative is now technically feasible. The Qualcomm Snapdragon 8 Elite's Hexagon NPU runs 4B-parameter language models at 1,049 tok/s prefill throughput — faster than many cloud APIs. NexaSDK (ai.nexa:core:0.0.24) provides the inference runtime with NPU, CPU, and GPU backends. The missing piece was a well-designed application layer that turns raw model output into structured, portable health records — and routes between LLM, OCR, VLM, and ASR models automatically based on user input type.
Zero Trust by Default: No network calls for inference. No cloud storage. No analytics. The device is the trust boundary. Data never leaves the user's hardware.
| Model | Type | Size | Speed | Role |
|---|---|---|---|---|
| Qwen3-4B Instruct | LLM ⭐ | ~4GB | 19 tok/s decode | Brain — medical Q&A, RAG, reasoning |
| PaddleOCR | OCR ⭐ | ~100MB | <1s/page | Document text extraction |
| Parakeet ASR | Speech | ~600MB | Real-time | Voice input transcription |
| OmniNeural-4B | VLM | ~4GB | ~15 tok/s | Vision analysis (experimental) |
| EmbedGemma | Embed | ~300MB | Instant | RAG embeddings / memory |
| Llama-3.2-3B Turbo | LLM | ~3GB | ~15 tok/s | Alternate lighter LLM |
| Metric | Value |
|---|---|
| Time to First Token | 446 ms |
| Prefill Throughput | 1,049 tok/s |
| Decode Throughput | 19 tok/s |
| Average Response | ~220 tokens |
| OCR Scan Time | <1 second |
| APK Size | 299 MB |
| Concurrent NPU Models | Up to 6 |
The Smart Pipeline Router automatically dispatches input to the correct model — text queries go through RAG lookup then LLM, camera input routes to OCR or VLM, and voice input is transcribed by ASR before RAG+LLM processing. First launch auto-downloads the three essential models (LLM + OCR + ASR). No model picker, no configuration — the app routes input to the right model automatically.
The core innovation is a prompt-engineered pipeline that transforms unstructured medical images into machine-readable JSON with consistent field structure:
| Category | Fields | Example |
|---|---|---|
| Document Type | Classification | Lab Report / Prescription / Receipt / X-Ray |
| Metadata | Date, Facility, Doctor | 2026-02-15, St. Luke's, Dr. Santos |
| Findings | Test, Result, Reference, Status | WBC, 7.2, 4.5-11.0, NORMAL |
| Medications | Name, Dosage, Frequency, Duration | Amoxicillin, 500mg, TID, 7 days |
| Action Items | Follow-ups, Refills | Recheck CBC in 2 weeks |
The extraction prompt explicitly requests JSON output with predefined keys. Medical abbreviations (bid, tid, qid) are expanded into plain language. Reference ranges are included alongside results for immediate clinical context. The output is deterministic enough to feed directly into structured health record systems.
| Dimension | Cloud API (GPT-4V, etc.) | Health Passport (On-Device) |
|---|---|---|
| Data transmission | ✗ Sent to external servers | ✓ Never leaves device |
| HIPAA compliance | ✗ Requires BAA, audit trails | ✓ No PHI in transit |
| Network dependency | ✗ Required for every query | ✓ Fully offline capable |
| Cost per query | ✗ $0.01-0.10/image | ✓ $0.00 (device cost only) |
| Latency | 2-5s (network + inference) | 2-5s (inference only) |
| Breach risk | ✗ $10.93M average cost | ✓ No centralized target |
Real-world on-device AI deployment surfaced engineering problems absent from cloud deployments. The project required 16 engineering iterations across bug fixes, UX improvements, and architectural pivots — documented in a structured iteration log:
| Challenge | Root Cause | Solution |
|---|---|---|
| VLM outputs garbage | OmniNeural-4B on NPU produces "Reactive Reactive..." infinite loops | Garbage detection: count consecutive identical tokens, auto-stop after 8 repeats |
VLM only outputs <think> tags | NPU VLM config passed enable_thinking=true producing empty reasoning loops | Disabled thinking mode for vision models; regex-strip think tags from all output |
| Download interrupted by phone sleep | Multi-GB model downloads (4GB+) interrupted when screen turns off | Acquired PARTIAL_WAKE_LOCK during download; .complete marker for integrity |
| Screen flickers during streaming | notifyDataSetChanged() on every token → full RecyclerView redraw | Throttled UI updates to ~12fps (80ms interval) + notifyItemChanged(pos) |
| NPE on model load | modelFile() returns null for NPU baseUrl directory-based models | safeModelPath fallback to modelDir().absolutePath across 6 crash sites |
Medical applications fail when users don't feel safe, regardless of the actual security architecture. Health Passport uses a custom Material Design 3 dark theme (#070707 background, #0D0D0D surface, #10B981 emerald accent) to create a calm, clinical environment. A persistent "🔒 On-Device" badge makes the privacy architecture visible and constant. The Health Vault browser organizes records by body system, timeline, and protocol — all as editable markdown files with no proprietary formats.
Users can interact through three modalities: type health questions, scan documents with the camera, or speak naturally. The app routes each input to the correct model automatically. Real-time token streaming shows responses building word-by-word, with throttled UI updates (80ms intervals) to eliminate visual jitter.
Health Passport was personally invited to the Qualcomm × Nexa AI On-Device Bounty based on prior work on low-cost biosensor systems (Somach EMG interface, arXiv paper on Pareto-optimal model selection for EMG control). Phase 1 finalist and Grand Prize winner (official winners page). Officially recognized by Nexa AI and Qualcomm on LinkedIn for showcasing "the true potential of private, fast, on-device AI" through "creative and practical" deployment of Snapdragon hardware and the NexaSDK. The project was developed on the Qualcomm Device Cloud (QDC) using a Snapdragon 8 Elite QRD8750 virtual device with 1,000 free NPU compute minutes.