# Apple Foundation Models Goes Open Source: One Swift API

> Source: <https://byteiota.com/apple-foundation-models-open-source/>
> Published: 2026-07-09 06:13:07+00:00

Apple confirmed at WWDC 2026 that it will open-source the Foundation Models framework — the AI layer running Apple Intelligence on two billion devices — with Linux server support arriving this summer. That announcement comes alongside a shipping change that matters more right now: a new `LanguageModel`

protocol in Xcode 27 lets iOS developers call Claude, Gemini, or any OpenAI-compatible model through the exact same Swift API used for on-device inference. Switching providers is one parameter change.

## One API, Any Model

Before WWDC 2026, using Claude in an iOS app meant importing Anthropic’s SDK, wiring up its session type, its streaming API, its tool-calling format — then doing all of that again if you wanted an on-device fallback or a Gemini option. The `LanguageModel`

protocol ends that. Every provider — Apple’s on-device model, Private Cloud Compute, Claude, Gemini, or a self-hosted endpoint — now conforms to the same Swift interface.

``` js
// On-device: free, private, no API key
let session = LanguageModelSession(model: SystemLanguageModel.default)

// Claude: frontier reasoning, billed at Anthropic rates
import ClaudeForFoundationModels
let session = LanguageModelSession(model: ClaudeLanguageModel.default)

// Any OpenAI-compatible server (local or cloud)
let session = LanguageModelSession(
    model: ChatCompletionsLanguageModel(endpoint: yourURL, apiKey: yourKey)
)
```

Anthropic already ships [ClaudeForFoundationModels](https://github.com/anthropics/ClaudeForFoundationModels) as an official Swift package. Google ships Gemini through the Firebase Apple SDK. Both implement the protocol Apple defined at [WWDC26 session 339](https://developer.apple.com/videos/play/wwdc2026/339/). Your session logic, tool definitions, structured output schemas, and context management are unchanged when you swap.

## Open Source: What’s Live Now vs. What’s Coming

Here’s where clarity matters. The open-source announcement is real but staged. What Apple has already shipped on GitHub is [foundation-models-utilities](https://github.com/apple/foundation-models-utilities) (Apache-2.0): a utilities package with a Skills API, history management modifiers, and a `ChatCompletionsLanguageModel`

adapter that works on both Apple platforms and Ubuntu. The full framework open-source — the part that lets server-side Swift apps use Foundation Models APIs on Linux — is coming “later this summer.”

That distinction matters for teams planning server-side Swift adoption. The utilities package is useful today. The broader framework open-source, when it arrives, will let you share Foundation Models code between your iOS app and your Linux backend without any bridging layer.

## The Free Tier and Its Cliff

Apple’s Private Cloud Compute free tier is a genuine offer for most independent developers. If your App Store account is enrolled in the Small Business Program and your apps have fewer than two million first-time downloads combined, you get Apple Foundation Models running on PCC at zero cloud cost. Re-downloads and updates don’t count toward the threshold. The beta is available now in Xcode 27; production support ships with iOS 27 and macOS 27 this fall.

The cliff is real, though. Apple offers no paid PCC tier. When you cross two million downloads, access terminates. That means teams shipping anything with growth ambitions need to architect for provider fallback from day one — route through the `LanguageModel`

protocol, and when PCC access ends, swap to Claude or Gemini with a single parameter change. The protocol makes this straightforward; the cliff makes it necessary.

## Dynamic Profiles: Multi-Agent Without the Plumbing

Dynamic Profiles are a new API for multi-agent workflows on-device. A Profile defines a model target, a set of tools, and a set of instructions. You can swap profiles mid-session without tearing down context — the session keeps its accumulated history while the active agent changes. A note-taking agent can hand off to a summarization agent to a translation agent in a single continuous session.

This is the pattern most agentic iOS apps were hand-rolling with custom state machines. Apple has codified it as a first-class framework primitive. It works across all providers, so you can run the cheap agent on-device and route the expensive one to Claude without the app logic knowing the difference.

## Know What the On-Device Model Can’t Do

Apple’s on-device model is optimized for focused text tasks: shaping output, structured generation, in-app tool calling. Apple’s own research places it competitive with Qwen-3-4B on English benchmarks — a capable 4B-scale model, not a frontier reasoner. It will not reliably handle open-ended reasoning, long-document analysis, or complex code generation.

Route accordingly. On-device is fast, private, and free. Use it for text formatting, classification, and short structured output. Route reasoning tasks to Claude or Gemini. The `LanguageModel`

protocol makes that routing a one-liner — which is exactly why it matters.

## What to Do Now

- Install Xcode 27 beta and check your Foundation Models API access at
[developer.apple.com/documentation/FoundationModels](https://developer.apple.com/documentation/foundationmodels) - Add
`ClaudeForFoundationModels`

or the Firebase AI package to your Package.swift if you need frontier reasoning - Add
[foundation-models-utilities](https://github.com/apple/foundation-models-utilities)for history management and the OpenAI-compatible adapter - Confirm your account qualifies for the PCC free tier at
[developer.apple.com/private-cloud-compute](https://developer.apple.com/private-cloud-compute/) - Design your session layer around the
`LanguageModel`

protocol now — don’t hard-code a provider - Watch the GitHub repo for the full framework open-source drop, expected before fall

The WWDC26 sessions to watch are [session 241](https://developer.apple.com/videos/play/wwdc2026/241/) (what’s new in Foundation Models) and [session 339](https://developer.apple.com/videos/play/wwdc2026/339/) (how to implement the `LanguageModel`

protocol for your own provider or self-hosted endpoint).
