On-Device AI for Phones: Running Compact Models on iOS and Android
On-device AI runs compact models directly on the phone for speed and privacy. This guide covers Core ML, Core AI, and LiteRT, plus how to ship a model.
By Galactic News Editorial · Published 2026-11-20T19:39:24+00:00 · Updated 2026-11-20T19:39:24+00:00
On-Device AI for Phones: Running Compact Models on iOS and Android
On-device AI runs machine learning models directly on the phone, with no server call. That means lower latency, no network dependency, and data that stays on the device. It also means tight limits on model size, memory, and battery. This guide covers the frameworks that make it work on iOS and Android, how to pick a compact model, and the steps to ship one.
On-Device AI Phones iOS Android: Why Run Models Locally
Cloud AI is easy to build. The app sends data to a server and gets an answer back. That round trip costs time and money. It also sends user data off the device. On-device inference removes the round trip. Apple describes its Core AI framework as loading and running models entirely on device, with zero server dependencies and zero token costs. Google's LiteRT does the same for Android, iOS, web, and IoT, running inference entirely on-device.
On-device AI fits some features better than others. Image classification, object detection, text summarization, and short text generation work well. Long conversations and large reasoning tasks do not. A phone cannot hold a frontier-scale model. It can hold a compact model that handles a narrow job well. The design question is always the same. What is the smallest model that does this job well enough?
The iOS Stack: Core ML, Core AI, and Foundation Models
Core ML is Apple's framework for running trained models in apps. Developers convert a model from PyTorch, TensorFlow, or scikit-learn with the coremltools Python library. The model becomes a .mlpackage or .mlmodel file. Xcode generates a Swift class from it. The app calls the prediction method and gets results back. Core ML dispatches work to the Neural Engine, GPU, or CPU as needed. The Neural Engine is present in Apple silicon from the A11 Bionic onward.
Apple has also introduced Core AI, a newer framework for loading and running models entirely on device. It offers a Swift API, ahead-of-time compilation for fast load times, and fine-grained control over inference memory. It targets everything from compact vision models to large-scale generative AI across iPhone, iPad, Mac, and Apple Vision Pro. For text generation on newer devices, Apple Foundation Models gives apps access to the on-device language model behind Apple Intelligence, on iOS 26 and later.
Model size shapes the design. A 1B-parameter model in int4 quantization runs around 500 to 700 MB. A 3B model in int4 runs around 1.5 to 2 GB. Core ML is most practical for models in the 1B to 3B range on-device. Larger models belong on a server or on a Mac with unified memory. The App Store has a 4 GB on-demand resource limit per app download. Budget the model size against that limit early.
The Android Stack: LiteRT and On-Device LLMs
LiteRT is Google's on-device inference engine, formerly TensorFlow Lite. It deploys ML and generative AI models on Android, iOS, web, and IoT. Models use the FlatBuffers format with the .tflite extension. The current LiteRT 2.x release adds the CompiledModel API, a modern runtime interface built to maximize hardware acceleration. Android apps need a minimum SDK of 24, which covers Android 7.0 and later.
For language models, LiteRT-LM runs on-device LLMs such as Gemma on Android. The workflow has five steps. Check the toolchain and SDK requirements. Install the LiteRT packages. Obtain a model in .tflite format. Run inference and verify the results. Then choose the hardware backend: CPU, GPU, or NPU. LiteRT picks the accelerator per device, including Qualcomm and MediaTek NPUs. Quantization is the main lever for shrinking a model. Int4 and int8 quantization cut size and speed up inference, with a small accuracy cost.
| Framework | Platform | Best for | Model format |
|---|---|---|---|
| Core ML | iOS, macOS, watchOS, tvOS | Custom vision, NLP, and audio models | .mlpackage / .mlmodel |
| Core AI | iPhone, iPad, Mac, Vision Pro | On-device models, incl. generative AI | Core AI assets |
| Foundation Models | iOS 26+ with Apple Intelligence | Text generation and summarization | System model |
| LiteRT | Android, iOS, web, IoT | Vision, audio, and generative AI | .tflite |
| LiteRT-LM | Android | On-device LLMs such as Gemma | .tflite |
Choosing and Shipping a Compact Model
Start with the job, not the model. Define the input, the output, and the quality bar. A photo tagger needs a vision classifier. A reply suggester needs a small language model. A document scanner needs OCR plus a summarizer. Each job points to a different model family. Open model families such as Gemma, Llama, Mistral, and Qwen publish compact variants sized for phones. Check the license before shipping. Not every open model allows commercial use in an app.
Then convert and quantize. Use coremltools for Core ML or the LiteRT converter for Android. Test int8 first. Drop to int4 only if the quality holds. Measure on real devices, not on a simulator. The Neural Engine and the NPU behave differently from a desktop CPU. Profile load time, first-token latency, and memory use. A model that loads slowly will feel broken, even if inference is fast.
- Define the job and the quality bar. Write down the input, the output, and what good enough means.
- Pick a compact model family. Start with 1B to 3B parameters. Check the license for commercial use.
- Convert and quantize. Use coremltools for iOS or the LiteRT converter for Android. Test int8, then int4.
- Measure on real devices. Profile load time, latency, memory, and battery on the oldest supported phone.
- Ship with a fallback. If the model fails to load, degrade gracefully. Offer a cloud option or a simpler local path.
- Update models like code. Bundle a new model with an app update, or download it on demand within the size limits.
Bottom line
On-device AI on phones is practical today for narrow, well-defined jobs. Core ML and Core AI cover iOS. LiteRT covers Android and cross-platform work. The hard parts are model size, quantization quality, and real-device performance. Pick the smallest model that clears the quality bar. Measure on the oldest phone you support. Ship with a fallback. The payoff is real: faster responses, no server bill per request, and user data that never leaves the device.