Apple has done something it rarely does: it opened the front door. The Foundation Models framework — the on-device AI layer that powers Apple Intelligence — is being open-sourced, and it no longer talks only to Apple's own models. With a new LanguageModel protocol, the same Swift API that runs a private model on the Neural Engine can now route requests to Anthropic's Claude or Google's Gemini. For developers building on iOS, iPadOS, and macOS, this quietly reshapes how AI features get built.
What actually changed
When Apple shipped the Foundation Models framework in 2025, it was a clean, Swift-native way to call the on-device model behind Apple Intelligence. It had guided generation, tool calling, and streaming — but it only spoke to one model. If you needed a frontier model for a hard task, you dropped out of the framework entirely and hand-rolled an HTTP client.
The 2026 update removes that wall. Three things landed together:
- Open source. The framework itself, plus two companion backends —
CoreAILanguageModelandMLXLanguageModel— are being released as open source, so developers can inspect, extend, and run a wide range of local models on the Apple Neural Engine and Mac GPU. - Third-party providers. A new
LanguageModelprotocol lets nearly any model back aLanguageModelSession. Anthropic and Google are shipping official Swift packages so Claude and Gemini plug into the exact same interface. - A free cloud tier. Apple made its newest Private Cloud Compute models free to small developers, with image input so models can reason over pictures alongside text.
The headline is interoperability: one API surface, many models, chosen per request based on cost, latency, and privacy.
The one API that runs everything
The core object has not changed. You create a LanguageModelSession, give it instructions, and call respond(to:). On-device inference looks like this:
import FoundationModels
let session = LanguageModelSession(
model: SystemLanguageModel.default,
instructions: "You are a concise assistant for a travel app."
)
let reply = try await session.respond(to: "Suggest three activities in Tunis.")
print(reply.content)Now swap the model instance for a frontier provider — Gemini through Firebase, for example — and everything else stays identical:
import FoundationModels
import FirebaseAILogic
let ai = FirebaseAI.firebaseAI()
let gemini = ai.geminiLanguageModel(name: "gemini-3.5-flash")
let session = LanguageModelSession(
model: gemini,
instructions: "You are a concise assistant for a travel app."
)
let reply = try await session.respond(to: "Suggest three activities in Tunis.")The call site does not know or care which model answered. That is the whole point of the LanguageModel protocol: the app declares what it needs — text generation, structured output, tool calling — and the protocol resolves which model delivers it. Claude ships through Anthropic's own Swift package with the same shape.
Structured output survives the switch
The feature developers loved most in the original framework — guided generation with @Generable — works across providers. You annotate a Swift type, and the model is constrained to return exactly that shape, no fragile JSON parsing:
@Generable
struct Activity {
@Guide(description: "Short activity name")
let name: String
@Guide(description: "Estimated cost in Tunisian dinar")
let priceTND: Int
let category: String
}
let result = try await session.respond(
to: "Recommend one activity in Sidi Bou Said.",
generating: Activity.self
)
print(result.content.name, result.content.priceTND)Because the constraint lives in the framework, the same @Generable type produces valid structured output whether it is answered on-device or by Claude in the cloud. Streaming (streamResponse(to:)) and tool calling carry over the same way.
Dynamic Profiles: mid-session model swapping
The most forward-looking addition is Dynamic Profiles, which let an app swap models, tools, and instructions in the middle of a session. Apple is positioning this as the foundation for multi-agent workflows: run cheap on-device inference for routine turns, then escalate a single hard request to a frontier model without tearing down the conversation.
The practical pattern is a router. Keep most traffic private and free on-device, and reserve paid frontier calls for the requests that genuinely need them:
func model(for difficulty: Difficulty) -> any LanguageModel {
switch difficulty {
case .simple: return SystemLanguageModel.default // private, on-device
case .complex: return anthropic.claudeModel(name: "claude-opus-4-8")
}
}This is the architecture that used to require a custom gateway, retry logic, and three different SDKs. Now it is a switch statement behind one protocol.
Why this matters for MENA developers
For teams in Tunisia, Saudi Arabia, and the wider region, the shift is more than convenience. On-device inference means user data — customer records, chat history, documents — never leaves the device for routine tasks, which lands squarely on the right side of data-residency expectations. When you do need a frontier model, you make a deliberate, per-request choice instead of sending everything to a single vendor by default.
There is also a real cost story. Routing the bulk of inference to the free on-device model and Apple's Private Cloud Compute tier, then paying only for the hard escalations, is dramatically cheaper than funneling every token to a frontier API. For an app with heavy but mostly-simple AI usage, that ratio decides whether the feature is affordable at all.
And because the provider is an implementation detail, you are not locked in. If Claude fits today and a cheaper open model fits next quarter, you change one line — the model instance — and the rest of the app is untouched. That kind of portability is exactly the multi-model resilience strategy that protects against vendor outages and price changes.
Getting started
The framework ships as part of the OS, so there is no dependency to add for on-device use. To bring in a provider:
- Add the provider's Swift package (Anthropic's or Google's Firebase AI Logic) via Swift Package Manager.
- Instantiate the provider model and pass it to
LanguageModelSession. - Keep your
@Generabletypes and prompts exactly as they are — they are provider-agnostic. - Add a routing function so difficulty, cost, and privacy decide which model answers.
If you are architecting AI features from scratch, it is worth pairing this with a broader look at AI-first software architecture so the routing layer is a first-class part of the design rather than an afterthought.
The bottom line
Apple spent years keeping its AI stack closed and on-device only. Opening the Foundation Models framework — and letting Claude and Gemini answer through the same Swift session as the Neural Engine — turns it into a genuine model router. Developers get one API, guided generation that survives the switch, and a clean way to balance privacy, latency, and cost per request. It is one of the most consequential platform moves of 2026 for anyone shipping AI on Apple devices, and the migration cost is close to zero: your existing sessions already speak the new language.