Apple Foundation Models Framework: One Swift API for On-Device and Server LLMs
Apple's Foundation Models framework is a native Swift API for putting large language models inside apps, and its defining move is unification: the same API reaches Apple's on-device foundation model, Apple Foundation Models running on Private Cloud Compute, and third-party server models such as Claude and Gemini. For iOS and macOS developers, that means guided generation, tool calling, image understanding, and dynamic session configuration are framework features rather than per-provider integrations.
What the Foundation Models framework is
The Foundation Models framework is a native Swift API for integrating any large language model into an app, including direct access to the Apple Foundation Models on-device and in Private Cloud Compute. Apple describes it as "the best way to use any large language model in your app," positioning it for tasks ranging from quick summaries to dynamic agents.
Capabilities built into the framework include:
- Guided generation
- Tool calling
- Image understanding
- Dynamic Profiles
Model support: on-device, Private Cloud Compute, and third-party servers
The framework gives developers direct access to the on-device foundation model at the core of Apple Intelligence, which Apple frames as smart, private, and functional without internet connectivity. On-device models cover many tasks, but Apple acknowledges that larger models are sometimes needed for more complex workflows.
That gap is addressed by extending the framework to server models — Claude, Gemini, and others — through the same Swift API, with full support for tool calling and guided generation. The extension mechanism is a protocol: any model provider can publish a Swift package conforming to the Language Model protocol, which Apple describes as a fundamental component of the framework that lets developers pick the right language model for their app.
Private Cloud Compute and free access for small developers
Apple Foundation Models can also run on Private Cloud Compute (PCC). Developers enrolled in the App Store Small Business Program with fewer than two million first-time App Store downloads can access the Apple Foundation Models running on Private Cloud Compute with no cloud API cost. Apple states this delivers frontier-level intelligence with privacy protections under which user data is not stored or accessible to Apple or anyone else.
Image understanding
Multimodal prompts let an app pass images alongside text so the model can reason about visual content. Apple describes the integration as simple as attaching an image to a prompt. The Vision framework is also integrated directly, giving the model purpose-built tools such as OCR for precise text extraction and barcode readers for quick code scanning, all on-device.
Dynamic Profiles: swapping models mid-session
Dynamic Profiles are declarative APIs for continuously updating a session's model, tools, and instructions on the fly. Instead of creating a session with a fixed configuration, a developer defines profiles — each with its own model, temperature, reasoning level, and toolset — and swaps between them within a single continuous session. The session transcript is shared across every profile switch, so the app accumulates contextual intelligence with less prompting. Apple describes Dynamic Profiles as adaptable building blocks for AI agents, skills, or other high-level abstractions.
Evaluations framework
The Evaluations framework tests prompts and validates that intelligence-powered features work correctly across dynamic conditions, going beyond what unit tests alone can catch. Apple positions it for iterating on instructions, switching models, or tuning a Dynamic Profile, so developers can confirm behavior holds up before shipping.
The fm command line tool
The new fm command line tool in macOS 27 lets developers script, automate model workflows, and prototype without writing app code. Apple frames it as a fast path from idea to implementation.
Open source packages
Apple ships two open-source efforts alongside the framework:
- The Foundation Models framework utilities package adds experimental abstractions on top of the framework, including custom skills, context management helpers, and a Chat Completions client that connects to a hosted model of your choice.
- The Foundation Models SDK for Python extends the framework into the Python ecosystem, for integration with popular Python tooling and evaluation packages.
Requirements and regulatory notes
Apple publishes Acceptable Use Requirements for the Foundation Models framework that outline prohibited uses of Apple Foundation Models. Separately, pursuant to Article 53(1)(b) of the AI Act, Apple makes information and documentation available to providers of AI systems who intend to integrate AFM 3 Cloud into their AI systems.
What developers discussed
The Hacker News thread on the framework was small (22 comments) and mixed between practical experience and open questions. Several commenters pointed at adjacent Apple work that they felt was under-covered.
One commenter highlighted Apple's CoreAI repository, where the company is adapting open-weight models to run natively with Swift:
I actually think their CoreAI stuff is kind of flying under the radar. But they've got a repo at https://github.com/apple/coreai-models where they're adapting a ton of open weight models to their format to run natively with Swift.
The most substantive question in the thread was whether the Private Cloud Compute offer amounts to free inference. Quoting Apple's eligibility terms, one commenter asked:
Is this free tokens? This sounds like free tokens?
Apple's linked PCC page states that where Apple Intelligence is available, eligible developers can use PCC in apps distributed on the App Store and test PCC features via TestFlight or ad hoc distribution, and that installs during testing are not counted as first-time app downloads.
On the practical side, one developer reported running local models in a terminal for correcting errors and suggesting commands, and said the models were "surprisingly capable on an m1 8gb" — which they called the smallest machine local AI needs to run on. Another developer said they had been using Foundation Models in an app called Noodle and liked working with it, but had not yet explored Private Cloud Compute, speculating that special entitlements may currently be limited to the Siri desktop app.
A commenter noted that Anthropic has supported App Attest for Foundation Models for months via a ClaudeForFoundationModels repository, and expressed surprise that Anthropic does not promote it more, adding that Firebase had been the most practical way to call LLMs directly from iOS apps without elaborate setups.
Open questions left by the thread
Three questions from the discussion remain unanswered in the source material:
- Whether the Private Cloud Compute allowance is effectively free token usage for eligible small developers.
- Whether non-API consumer plans for Claude or ChatGPT can be used through this framework.
- Whether the on-device model is capable enough to serve as a coding predictor, for example in an editor like Zed.
One commenter also asked why the page was surfacing on Hacker News at that moment, asking whether it had received an update — a reminder that the framework's capabilities have been rolling out incrementally rather than in a single launch.