Running a language model directly on a phone sounds like the obvious future. Nothing leaves the device, there's no server bill, and it works on a plane. All of that is true. But phones are not small servers, and treating them like one is the fastest way to ship an app that drains batteries and crashes on half your users' devices.
These are the questions we answer before writing any code.
Why run models on the device at all
There are three good reasons, and it helps to know which one you're optimising for:
- Privacy. The text never leaves the phone, which matters for notes, messages and anything personal.
- Speed. No network round trip, so short tasks like autocomplete or classification feel instant.
- Cost and reach. No per-request server cost, and the feature still works with a weak connection.
If none of these is essential for your feature, a server model is usually simpler and more capable.
Memory is the real limit
A model's size in memory is roughly its number of parameters multiplied by the bytes used to store each one. Quantization stores weights with fewer bits, which shrinks the model at some cost to quality.
| Precision | Bytes per parameter | Approximate size of a 1 billion parameter model |
|---|---|---|
| 16-bit | 2 | About 2 GB |
| 8-bit | 1 | About 1 GB |
| 4-bit | 0.5 | About 0.5 GB |
Those are the weights alone. The operating system, your app and the model's working memory all need room too, and mobile operating systems close apps that use too much.
Pick the model by the phone, not the other way round
Your users' phones vary enormously. Rather than choosing one model and hoping, check the device and pick a model that fits, or fall back to a server. On Android, total memory is available from ActivityManager:
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val memoryInfo = ActivityManager.MemoryInfo()
activityManager.getMemoryInfo(memoryInfo)
val totalGb = memoryInfo.totalMem / (1024.0 * 1024 * 1024)
// Leave plenty of headroom: the OS and the app need memory too.
val modelFile: String? = when {
totalGb >= 8 -> "assistant-3b-q4.bin"
totalGb >= 6 -> "assistant-1b-q4.bin"
else -> null // too tight: use the server model instead
}The thresholds are a starting point. Measure on real devices, especially the older and cheaper phones your users actually have.
Battery and heat decide how long it runs
Generating text keeps the processor busy, and phones slow themselves down when they get warm. A model that feels quick for one answer can become sluggish after a few minutes of continuous use.
Design for short bursts: summarise a note, suggest a reply, classify a message. Long conversations are a better fit for the server.
Always keep a way back to the server
Treat on-device inference as an optimisation, not a dependency. If the model can't load, runs out of memory or produces a poor answer, the feature should quietly fall back to a server model rather than fail.
What we'd tell a team starting today
Start with the smallest model that does the job, test on the cheapest phone you support, and keep the server path working from day one. The best on-device feature is one users never have to think about.

