Why On-Device AI?
Latency is zero. Privacy is absolute (data never leaves the phone). Apps work offline. Server costs are zero.
CoreML for iOS
Apple's framework is optimized for the Apple Neural Engine (ANE). It's incredibly power-efficient. Convert PyTorch/TF models using CoreML Tools.
TensorFlow Lite
The standard for Android (and cross-platform). It runs on CPU, GPU, or NPU (Neural Processing Unit) via NNAPI delegates.
Model Optimization
Mobile models must be small. Use Quantization (reducing precision from float32 to int8) to shrink model size by 4x with minimal accuracy loss.
Vision Framework
Don't train models for everything. iOS Vision framework provides built-in face detection, text recognition (OCR), and barcode scanning out of the box.
Privacy Implications
This is a major selling point. "We process your photos on your phone, not our servers" builds massive trust with users.
Battery Consumption
Running neural nets drains battery. Batch process when charging implies, or use specialized low-power chips (NPU/ANE) whenever possible.