Part 1 - I Wanted the Model to Stay on the Phone
Why running language models locally matters for privacy, exploring llama.cpp and ARM NEON acceleration, and the realities of moving beyond toy chat boxes.
Articles, guides, and engineering series by Dhruv Patel.
An in-depth 6-part engineering series exploring what it really takes to build an offline-first, on-device multimodal AI workstation for Android and iOS using Kotlin Multiplatform, C++20 / NDK, llama.cpp, and Google LiteRT.
Why running language models locally matters for privacy, exploring llama.cpp and ARM NEON acceleration, and the realities of moving beyond toy chat boxes.
How a simple 'attach file' button turned into an offline ingestion pipeline for 25+ formats using pure RFC 1951 Deflate and memory-mapped chunks.
Handling the hardest bugs: Android Low Memory Killer (LMK) evictions, GPU driver crashes on Vulkan, thermal throttling, and native lifecycle management.
Integrating on-device diffusion models with Google LiteRT and Bonsai Image Ternary 4B, managing dynamic feature delivery, and preventing mobile GPU overheating.
Refactoring a monolithic mobile app into a multi-module MVI platform with clean offline boundaries, strict state stores, and zero cloud leaks.
Engineering dual-model speculative drafting for 2x decoding speed, isolating GPU driver segmentation faults in a native fork() sandbox, and streaming fault tolerance.