The framework gives every iOS app a free on-device language model through one Swift API. Here is what it is, what it can and cannot do, who can run it, and why September 2026 is the moment to build on it.
TL;DR
- The Foundation Models framework, shipped with iOS 26 and expanded in iOS 27 on 14 September 2026, lets your app call the same on-device model that powers Apple Intelligence. No API key, no server, no per-token bill.
- The on-device model is about 3 billion parameters with an 8,192-token context. It is built for short, bounded tasks: classify, summarise, extract, tag, route. It is not built to be ChatGPT.
- When you need more, the same API reaches a larger model on Private Cloud Compute with a 32,000-token context and reasoning. Apps under 2 million first-time downloads use it at no cloud cost.
- Since iOS 27 the same session can also be backed by Claude, Gemini, or an open model you ship yourself. Your app code does not change; only the model behind it does.
- It only runs on iPhone 15 Pro and later, M-series iPads and Macs, and Vision Pro, in 16 languages, and not for accounts in mainland China. Your app must handle "unavailable" gracefully, and this series will show how.
This is the first of six articles on building with the framework. Each one is written from a module of a starter kit I am shipping alongside the series, so the code exists before the prose does.
What the framework actually is
Apple Intelligence has been running a language model on iPhones since late 2024, but until iOS 26 only Apple's own features could use it. The Foundation Models framework opened that model to third-party apps through a native Swift API: you create a session, give it instructions, send it a prompt, and get a response. Everything happens on the device.
Three properties make it different from calling a cloud model.
It is free at any scale. There is no inference bill because there is no inference server. An app with ten users and an app with ten million users pay the same for on-device generation, which is nothing.
It works offline and never uploads the prompt. The user's text stays in the user's memory. For anything touching health, finance, messages, or photos, that changes what you can build and what your privacy label says.
Output can be typed. Instead of asking for JSON and parsing a string, you declare a Swift type with a few annotations and the framework guarantees the response matches it. The model cannot return a field you did not define or a value outside the guide you gave it. Article 2 covers this in depth.
The framework arrived with iOS 26, iPadOS 26, macOS Tahoe 26, and visionOS 26 in September 2025. The 2026 update, announced at WWDC in June and released with iOS 27 this month, is where it grew from "a small model in your app" into a full model-routing layer.
What runs where
This is the part most coverage blurs. There are now four places a request can go, and the same session API addresses all of them.
| On-device model | Private Cloud Compute | Third-party cloud | Local open models | |
|---|---|---|---|---|
| Since | iOS 26 | iOS 27 | iOS 27 | iOS 27 |
| Size | About 3 billion parameters | Larger, Apple does not publish a count | Claude, Gemini, any provider | Whatever you ship via Core AI or MLX |
| Context window | 8,192 tokens | 32,000 tokens | Provider's limit | Model's limit |
| Reasoning | No | Yes, with selectable depth | Provider dependent | Model dependent |
| Image input | Yes, since iOS 27 | Yes | Provider dependent | Model dependent |
| Cost to you | Nothing | Nothing under 2 million first-time downloads | Provider's per-token price | Nothing, but you carry the model size |
| Data leaves the device | Never | Yes, to Apple silicon servers with no prompt storage | Yes, to the provider | Never |
| Works offline | Yes | No | No | Yes |

Your app code stays the same. Only the model behind the session changes.
The on-device model is the one this series is mostly about, because it is the one with zero marginal cost and zero privacy exposure. Apple's own numbers for it: mixed 2-bit and 4-bit quantisation averaging 3.7 bits per weight, roughly 0.6 milliseconds of time-to-first-token per prompt token, and about 30 tokens per second of generation on an iPhone 15 Pro. Apple's benchmarks place it ahead of Phi-3-mini, Mistral-7B, Gemma-7B, and Llama-3-8B on their instruction-following evaluations.
The context window doubled from 4,096 tokens at launch to 8,192 in iOS 26.4, and the framework now exposes the context size and a token counter so you can budget prompts instead of guessing.
Private Cloud Compute is Apple's answer to "but my task needs a bigger model." Requests go to Apple silicon servers, prompts are not stored, and the privacy claims are verifiable by independent researchers. For developers there is no account, no key, and no billing setup. If your app is in the App Store Small Business Program, meaning under 2 million total first-time downloads, the cloud model costs nothing. Larger apps get higher limits through iCloud+.
The third-party route is the surprising one. iOS 27 introduced a Language Model protocol. Anthropic and Google publish Swift packages that conform to it, so a session backed by Claude or Gemini is a one-line swap. You pay the provider directly and handle their keys yourself, which Apple is explicit about: never in the binary, always through the Keychain.
What you get in the box
Beyond raw generation, the framework ships the pieces you would otherwise build yourself.
Guided generation. Declare a struct, annotate its fields with plain-language guides, and the model fills it. Enums, nested types, arrays, and numeric ranges all work. This is the feature that makes the small model useful, because a 3 billion parameter model that must return one of four categories is far more reliable than one asked to write free text.
Tool calling. The model can invoke functions you define, with typed arguments, and use the result in its answer. iOS 27 added system tools you do not have to write: OCR and barcode reading from the Vision framework, and a Spotlight-backed search tool that gives you fully local retrieval over the user's own content.
Streaming. Responses arrive as partial results you can render as they generate, including partially filled typed structures, so a form can populate field by field.
Sessions with memory. A session holds instructions and a transcript, so multi-turn interactions work without you managing history. iOS 27's Dynamic Profiles let one session switch instructions, tools, and even the backing model mid-conversation while keeping the transcript.
Image input. Since iOS 27 the on-device model accepts images alongside text, at any size and aspect ratio. Larger images cost more tokens and more latency, but there is no cropping or preprocessing on your side.
An evaluations framework. New in 2026, a Swift framework for measuring whether your prompts and features behave as intended across many inputs, with statistics rather than a unit test that passes on one example.
Adapters. You can train a small LoRA adapter for a specialised task and ship it with your app. Most apps will not need this, and it is out of scope for the series.
Who can actually run it
This is where a lot of first projects go wrong. The framework compiles for every device, but the model only exists on some of them.
| Requirement | Detail |
|---|---|
| iPhone | iPhone 15 Pro, 15 Pro Max, every iPhone 16 and later |
| iPad | Any model with M1 or later |
| Mac | Any Apple silicon Mac, M1 or later |
| Vision Pro | Supported |
| Apple Watch | Series 9 and later, paired, for Private Cloud Compute since watchOS 27 |
| Apple Intelligence | Must be switched on by the user and the model downloaded |
| Languages | English, Chinese (simplified and traditional), Danish, Dutch, French, German, Italian, Japanese, Korean, Norwegian, Portuguese, Spanish, Swedish, Turkish, Vietnamese |
| Regions | Unavailable for devices bought in mainland China or accounts based there. Some features limited in the EU |
In practice that means the iPhone 12, 13, 14, and the base 15 will never run the on-device model. That is a large share of the installed base in India and most of the world. Your app has to work without it.
The framework tells you why the model is unavailable with one of three reasons: the device is not eligible, Apple Intelligence is switched off, or the model is still downloading. Each deserves a different response in your UI. Not eligible means hide the feature or route to the cloud. Switched off means a one-line prompt to enable it. Downloading means wait and retry. The starter kit's first module is exactly this decision tree, because it is the one every app needs and the one nobody writes about.
A note on development machines: the model runs in the iOS Simulator only when the host Mac has Apple Intelligence enabled, and the Mac, Xcode, and simulator runtime must all be version 26 or later. I hit the "Apple Intelligence not enabled" reason on my own M1 Pro until I matched Siri's language to the system language, which is the requirement the settings pane quietly enforces.
What it is not good at
Apple is unusually direct about this, and the series will be too.
- Long documents. 8,192 tokens is roughly 6,000 words including your instructions and the model's answer. Summarising a contract is a cloud job.
- Open-ended reasoning. The on-device model does not reason step by step. Multi-hop questions, planning, and maths go to Private Cloud Compute, which does.
- World knowledge. A 3 billion parameter model knows far less than a frontier model. Ask it to work on the text you give it, not to recall facts.
- Being a chatbot. It can hold a conversation, but a general assistant is not what it was tuned for and users will notice.
- Guardrails. The model refuses some legitimate requests, and Apple says false positives improved in iOS 27 with more to come. Test your real prompts, not toy ones.
- Unsupported languages. Tamil, Hindi, and most Indian languages are not on the list. If your users write in them, the on-device route is not available yet.
The pattern that comes out of this list is the one the whole series builds toward: use the on-device model for the cheap, bounded, private decisions, and route only what it cannot do to a larger model. Done well, the on-device model handles most requests and the cloud bill shrinks to a fraction of what it would be.
The cost argument, in numbers
Take a modest AI feature: classify each incoming item into one of a few categories and pull out two fields. Call it 500 tokens in, 50 out, 20 times per user per day.
| Cloud API at typical small-model rates | On-device model | |
|---|---|---|
| Per request | Roughly $0.0001 to $0.0005 | $0 |
| 10,000 daily users, monthly | $600 to $3,000 | $0 |
| 100,000 daily users, monthly | $6,000 to $30,000 | $0 |
| Backend to build and run | Yes | No |
| Privacy review for user data leaving the device | Yes | No |
The cloud figures vary by provider and model, and a careful team would cache and batch. The point is not the exact number. The point is that a feature which needed a business case now needs an afternoon.
A first run on my own machine
Before writing this I compiled a small test against the framework on an M1 Pro MacBook. A support ticket went in as text, and a typed structure came out with two fields: which department owns it and how severe it is, on a scale I defined in a one-line guide. The first, cold call took about three seconds, most of it loading the model. Warm calls are well under a second on the Mac, and an iPhone 15 Pro will be slower than an M1 Pro. I will publish proper device numbers in article 6 once I have a supported phone in hand.
If that example sounds familiar, it is the same idea as TypeSafe AI's Jev, which I covered last week: typed decisions with a bounded answer space instead of free text. The difference is that this one ships inside iOS and costs nothing.
Why now
Three things line up in September 2026. iOS 27 shipped on 14 September with the routing layer, image input, and free cloud fallback, which turned a curiosity into an architecture. The supported device base has had two full iPhone cycles to grow. And almost nobody has published a working pattern for shipping it, so the search results for every question a developer will ask are still thin.
That is the window this series is aimed at.
The six articles
- This one: what the framework is, what runs where, who can use it.
- Structured output: typed results from an on-device model, and why it beats JSON parsing.
- Tool calling: letting the model call your Swift functions, safely.
- Streaming into SwiftUI: partial results, cancellation, and honest UI.
- The fallback architecture: on-device first, Private Cloud Compute or Claude only when needed, and what it does to your cost line.
- Shipping: availability handling, privacy labels, App Review, and real device performance.
Ship this without an API bill
The OnDevice AI Starter Kit is the SwiftUI template behind this series: availability handling, a session wrapper, typed output schemas, tool calling, streaming, and a fallback route to Claude, with tests and an ACT-iOS skill file so your coding agent understands it. Early-bird $29 until 31 October, then $49. Pre-orders open now and the kit ships on 27 October.
Sources
- Foundation Models framework documentation (Apple Developer)
- What's new in the Foundation Models framework, WWDC26 session 241 (Apple Developer)
- WWDC26 Apple Intelligence guide (Apple Developer)
- Apple aids app development with new intelligence frameworks and advanced tools (Apple Newsroom, June 2026)
- Introducing Apple's On-Device and Server Foundation Models (Apple Machine Learning Research)
- Apple Intelligence: supported devices, languages, and regions (Apple Support)
- Apple confirms iOS 27 release date: September 14 (9to5Mac)
- Getting Started with Foundation Models in iOS 26 (AppCoda)
📘 Go Deeper: Building AI Agents: A Practical Developer's Guide
185 pages covering autonomous systems, RAG, multi-agent workflows, and production deployment, with complete code examples. The routing and tool-selection patterns in the book are the same ones the on-device fallback architecture uses.
Enjoyed this article?
I write about AI tools, AI agents, and iOS development with AI, practical tips you can use right away.
- Follow me on Medium for the full series
- Follow me on Dev.to for daily articles
- Connect on Twitter/X for quick tips
If this helped you, drop a like and share it with a fellow developer!
Top comments (0)