On-Device vs Cloud AI: Build a Mobile Agent That Knows When to Ask
Route requests by capability and privacy, then make actions reviewable and recoverable.
A local model can summarize a note while the phone is offline. A cloud model can handle a more demanding request. Neither fact tells your app when it is allowed to send private content over the network—or whether a proposed action should run.
The architecture needs two separate decisions: where inference runs, and who authorizes an action.
Start with an explicit routing policy
For a meeting assistant, define rules before adding an automatic router:
- Local model ready and task supported: run locally.
- Local model downloading: show readiness state and retain manual editing.
- Local model unavailable and cloud processing allowed: offer or use the user's approved cloud path.
- Cloud disallowed or network unavailable: keep a manual path.
- Output fails validation: allow correction or retry; escalate only when permitted.
Capability checks, user preferences, task type, input size, network state, quality, latency, and cost can all affect the decision. A model's verbal confidence is not a calibrated correctness probability unless tested for that purpose.
The privacy boundary includes more than inference. Review logs, crash reports, analytics, retrieved content, and tool calls. A feature described as local should not silently upload the note through a fallback or telemetry path.
Treat the agent as a workflow
Selected note → local or cloud inference → proposed actions
→ validation → user preview → authorized execution
→ verify result → report outcome
A model can propose a task title and date. The app validates the fields, decides which tools are exposed, checks permissions, and executes through normal application code. A structured tool call is not authorization, and a valid date is not proof that the meeting note contained that date.
Use an allowlist of tools and validate their arguments at the execution boundary. Give each tool the least access needed. Treat notes, search results, and other retrieved content as untrusted data: text inside them cannot grant new permissions or override application policy.
Design for interruption and uncertainty
The user may navigate away, revoke permission, lose connectivity, or have the app terminated. Each operation should have an explicit state: proposed, approved, executing, confirmed, failed, or outcome unknown. Persist only what is required for recovery, protecting sensitive content appropriately.
Consider a task-creation call that succeeds on the server but times out before the client receives confirmation. Retrying without a stable idempotency key can create a duplicate. Use destination-supported idempotency where available; otherwise check state before retrying when feasible and surface uncertainty to the user.
Bound tool calls and runtime. Apple notes that tools can be called multiple times and in parallel; required tool-calling modes need an exit condition. Apple tool documentation
Evaluate the system, not just the model
Use a fixed set of meeting notes with explicit and missing dates, multiple tasks, no tasks, contradictory instructions, and injected instructions inside source text. Record:
- Grounded task and deadline accuracy.
- Unsupported claims and appropriate abstentions.
- User edits and approval rate.
- Availability, latency, and fallback rate by device.
- Duplicate actions, failed recoveries, and unknown outcomes.
- Cloud cost per verified completed task, where applicable.
Test offline mode, model unavailability, navigation during inference, app restart after an uncertain action, and permission changes. Keep prompts, model versions, device and OS versions with evaluation results so changes can be compared.
A release criterion
Ship only when the user can see what will happen, the application enforces the relevant permissions, failed or interrupted work has a recovery path, and you can measure whether proposed actions were correct. The model helps interpret intent; the application owns the boundary between a suggestion and an action.
Read Google's ML Kit GenAI overview, Apple's Foundation Models generation guide, and Google's Android AI Sample Catalog for platform-specific starting points.
Technical review: November 2026. Architecture is illustrative; verify implementation and platform behavior on target devices.
Comments
Join the discussionNo comments yet. Be the first to comment.




