On-device AI: the landscape and the judgment
Why inference is moving onto the phone, the five tiers of Apple intelligence, and the architecture judgment — where does this feature's model actually live?
By the end you will be able to
- Argue the four forces that pull inference on-device — and the workloads that stay server-side
- Place any AI feature on the five-tier ladder, walking down only on requirement failures
- Quote the on-device model's honest constraints (size, context, device floor) from Apple's own docs
- Design for unavailability — the enum every on-device feature must handle
Product asks for "an AI summary of the user's monthly spending" in your banking app. What is the first architectural question a senior engineer asks?
Why inference is moving onto the phone
Four forces, and every one of them is sharper in fintech than almost anywhere else:
- Privacy as a feature, not a policy. Data that never leaves the device needs no consent screen for cloud processing, no data-processing agreement, no residency analysis. "The prompt is generated entirely on device — personal entries stay personal" is Apple's own developer pitch, and for regulated data it converts an AI feature from a compliance project into a product feature.
- Latency. No round trip: first tokens in tens of milliseconds, streaming as the model generates. Categorising a transaction as the cell renders is feasible; a 900ms server hop per cell is not.
- Cost. The platform model is free at any scale — zero marginal cost per request. A feature that calls a metered cloud API on every keystroke has a unit-economics problem; the same feature on-device has none.
- Offline. The model in your pocket works on a plane. Any feature built on it inherits the offline story your sync lesson (D2-04) fought so hard for.
And the honest counterweight, immediately: serious workloads still live server-side. Fraud models score transactions on the backend where they see the whole graph, not one phone's slice. Long-document analysis and deep reasoning outgrow a small model. The skill interviews actually probe is not "put everything on the phone" — it is knowing which tier each feature belongs to, and saying why.
The five-tier ladder
Apple's stack is a ladder. The senior habit: start at the top, walk down only when a genuine requirement fails.
| Tier | What | Costs you | Fails when |
|---|---|---|---|
| 0 — Built-in frameworks | Vision (OCR), Natural Language, Speech, Translation | nothing — no model shipped, no prompt written | the task needs open-ended generation |
| 1 — Platform model, on-device | Foundation Models framework: the ~3B Apple model on the phone | 4,096-token context; eligible devices only | context, capability, or device floor |
| 2 — Private Cloud Compute | Apple's server models behind the same framework (iOS 27+) | network required; entitlement + quotas; 32K context | you need a frontier model or your own stack |
| 3 — Third-party models | Claude/Gemini via the LanguageModel protocol (iOS 27+), or plain HTTPS APIs | per-token cost, data leaves the device, DPAs | cost or privacy kills it |
| 4 — Your own model | Core ML / Create ML / MLX — a model you convert, compress, ship | the whole ML engineering discipline | (this is the floor) |
Two things make this ladder more than a slide from a keynote. First, tier 0 is criminally underused — receipt scanning is Vision's RecognizeTextRequest, not a prompt. Second, since iOS 27 tiers 1–3 sit behind one Swift API: LanguageModelSession takes a model, and Apple's on-device model, Apple's cloud model, and third-party providers all conform to the same LanguageModel protocol. The routing decision became a value you pass, which is precisely what makes it testable architecture instead of vendor lock-in.
Note what the policy did not need: a quality ranking of models. Requirements route features; benchmarks break ties. (And one honest asterisk: a fraud-scoring model isn't on this ladder at all — it lives server-side, where it can see patterns across millions of accounts. Knowing what doesn't belong on the phone is part of the answer.)
The constraints, quoted not vibed
The on-device model is a ~3-billion-parameter language model, quantised aggressively to fit a phone. Apple documents — in the framework's own overview — that it is not suited to basic math, code generation, or complex logical reasoning, and it is not a general-knowledge chatbot. What it is built for: summarise, extract, classify, tag, rewrite, generate short structured content — which happens to be most of what product actually asks for.
Three numbers to say in an interview:
- 4,096 tokens per session — instructions, prompts, and outputs all draw from one budget. Roughly 3–4 English characters per token; roughly one character per token for Chinese, Japanese and Korean — the same feature holds a quarter of the conversation in Tokyo that it holds in London.
- The device floor: Apple Intelligence hardware — iPhone 15 Pro or newer, A17 Pro/M1-class iPads and Macs. A meaningful slice of your installed base cannot run tier 1 at all, for years yet.
- Zero — the marginal cost per request, and also the amount of your data Apple trains on from these calls.
A support-chat feature spends 400 tokens on instructions, then each turn costs ~600 tokens (user message + model reply). The session throws contextSizeExceeded when the 4,096-token budget would be blown. Which turn dies?
let contextSize = 4096
let instructions = 400
let perTurn = 600
var used = instructions
var turn = 0
while true {
turn += 1
if used + perTurn > contextSize {
print("turn \(turn): throws contextSizeExceeded")
break
}
used += perTurn
print("turn \(turn): ok — \(used)/\(contextSize) used")
}Design for unavailable — always
Tier 1 is a conditional capability, and the framework makes the conditions explicit. Real API, worth reading closely even before the deep-dive lesson:
import FoundationModels
let model = SystemLanguageModel.default
switch model.availability {
case .available:
// build the AI path
case .unavailable(.deviceNotEligible):
// hardware floor: feature hidden or served another way — forever, on this device
case .unavailable(.appleIntelligenceNotEnabled):
// user's choice: invite, never nag
case .unavailable(.modelNotReady):
// model still downloading — transient; retry later
case .unavailable(let other):
// future reasons: degrade gracefully
}
Three different unavailability reasons, three different product responses — a permanent hardware floor, a respected user choice, and a transient download. Shipping an AI feature without designing all three paths is the new "works on my Wi-Fi".
The PM's launch plan says: "AI spending summaries for all users at launch — it's on-device, so it's free." What does the senior review flag?
Why this is worth your study hours
Three signals, stated the way you'd defend the investment to a skeptical tech lead. The platform is committing: three consecutive WWDCs of escalating investment — the framework itself (2025), then multimodal input, Private Cloud Compute access, and the third-party LanguageModel protocol (2026) — with the core framework going open source. Adoption is real: within months of iOS 26, dozens of mainstream apps shipped Foundation Models features — journaling summaries, document Q&A, spending categorisation — because AI slots into existing product surfaces, unlike the AR wave that demanded new ones. The skill compounds: because tiers 1–3 share one API, what you learn is not "Apple's model" but session management, guided generation, tool calling and routing judgment — portable across every provider that conforms.
The counterweight, one more time, because honesty is the house style: nobody is hiring "on-device ML engineers" by the thousand. They are hiring senior iOS engineers who can also make these calls — and putting "chose tiers for AI features; shipped the unavailability design" in your interview stories is exactly the pool-narrowing this track is for.
Encode the ladder
Implement the tier policy — the reasoning you would narrate in a system-design interview. Requirements route; walk down only on failure.
The budget that decides your UX
Model the context ledger: sessions accumulate tokens and die at the ceiling. Your function reports how many full exchanges a design gets before the wall — the number that decides whether "chat" is even the right UI.
Take an app you know well — your bank's, ideally. Choose five AI-shaped features (at least one perception task, one generation task on sensitive data, one long-context task). For each: assign a tier, name the requirement that placed it there, and write the one-sentence unavailability plan for below-the-floor devices. Then mark the one feature you would refuse to put on-device at all, and say why in compliance language.
You can now:
- Argue the four on-device forces and name the workloads that stay server-side
- Route features down the five-tier ladder by requirement, not by hype
- Quote the constraints — ~3B, 4,096 tokens, the device floor — and Apple's own not-for list
- Treat unavailability as a designed product state with three distinct causes
Next up: tier 0 in depth — the intelligence frameworks that ship no model at all.