Why On-Device AI?

For a decade the default answer to "where does the AI run?" was "someone else's GPU, over the network." On-device AI flips that: the model runs on the phone in the user's hand, and once you internalize what that changes — privacy, offline capability, latency, and cost all at once — a whole class of apps becomes possible that a cloud API can't build.

Most AI applications send the user’s data to a server, run a model there, and send the answer back. That works, but it carries assumptions — a network connection, a per-request bill, and the user’s data leaving their device — that aren’t always acceptable. On-device AI (edge AI) runs the model locally, on the phone, tablet, or laptop itself. This series is about building that with Gemma (Google’s open model family) and Flutter, and it starts with the question that justifies all the constraints ahead: why run AI on-device at all?

The four reasons, and why they compound

On-device AI is worth its real difficulties because it delivers four benefits simultaneously — and it’s the combination, not any single one, that makes it compelling:

The reason to notice the combination is that each addresses a different failure mode of cloud AI, and many real products need several at once. A personal finance app needs privacy and wants zero per-user inference cost. A field tool needs offline and low latency. When two or more of these matter, on-device stops being an optimization and becomes the right architecture.

The local-first philosophy

On-device AI is the AI expression of a broader idea: local-first software, where the user’s data and the app’s core functionality live on their device rather than on a server, with the cloud as an optional enhancement rather than a requirement. Local-first apps are private by construction, work offline, respond instantly, and don’t hold the user hostage to a service staying online or a subscription staying paid.

This philosophy fits a specific and growing class of applications especially well:

If you’re building an app where the user’s data is the product and their trust is the moat, local-first with on-device AI aligns the architecture with the promise: we can’t misuse your data because we never receive it. That’s a claim a cloud app can only ask users to believe; a local-first app can prove it.

What you give up

Honesty requires naming the trade-off, because on-device AI is not free — it exchanges cloud’s problems for edge’s constraints, the subject of the next post:

The engineering craft of on-device AI is getting the four benefits while managing these four costs — and the rest of the series is exactly that craft.

When to choose on-device (and when not)

On-device AI is the right call when the benefits align with your product’s needs — but it’s not universal, and choosing it dogmatically is as wrong as ignoring it:

The decision is the same requirements-driven trade-off analysis as any architecture choice (the AI Architecture Decisions series’ method applies): match the tool to the constraints. On-device AI has simply become a viable option it wasn’t a few years ago — small models got good, and the runtimes to execute them on phones matured.

Where the series goes

From here the series is practical: the constraints of the edge (what makes phones different from servers), quantization (how you make a model fit), the on-device runtime (how inference actually executes on phone hardware), running Gemma on Flutter (the concrete code), on-device RAG and memory (retrieval without a server), privacy and local-first design (the architecture), and shipping (model delivery, app size, updates). Throughout, the concrete stack is Gemma + Flutter, but the principles transfer to any on-device model and framework. The goal by the end: build a private, offline-capable, zero-inference-cost AI feature that runs entirely in the user’s hand.

Key takeaways

Further reading

Sources & References

Gemma open model family
Flutter on-device LLM plugin