· via Hacker News – Front Page (native)
Apple details Foundation Models framework for running LLMs and agents in macOS apps
Apple's Foundation Models documentation shows Swift developers how to run on-device and server LLMs, build agents with Dynamic Profiles, and use Private Cloud Compute for free.

A single Swift API for any model
Apple has detailed the Foundation Models framework for macOS, a native Swift API for building large language model features — from quick summaries to full agents — inside apps. According to Apple's developer documentation, which surfaced on Hacker News, the framework is positioned as the standard way to use any LLM in an app, not only Apple's own.
The framework provides direct access to the on-device foundation model at the core of Apple Intelligence, which Apple says works without an internet connection. When a task needs a larger model, the same API extends to server-hosted options such as Claude and Gemini, with tool calling and guided generation supported across them. Third-party providers can participate by publishing a Swift package that conforms to the framework's Language Model protocol, which Apple describes as the fundamental mechanism for picking the right model for an app.
Free Private Cloud Compute for smaller developers
For heavier workloads, Apple offers its Foundation Models running on Private Cloud Compute. Developers enrolled in the App Store Small Business Program with fewer than two million first-time App Store downloads can use this capacity at no cloud API cost. Apple claims that user data processed there is not stored and not accessible to Apple or anyone else — the privacy positioning that separates its cloud offering from conventional API providers.
Dynamic Profiles target agent development
The most agent-oriented feature is Dynamic Profiles, a set of declarative APIs for changing a session's model, tools and instructions while it runs. Instead of locking a session to one configuration, a developer defines several profiles — each with its own model, temperature, reasoning level and toolset — and swaps between them mid-session. The transcript is shared across every switch, so the app retains context without extra prompting. Apple frames these profiles as adaptable building blocks for agents, skills and other higher-level abstractions.
Images, testing and a command line tool
The framework accepts multimodal prompts, so apps can attach images alongside text and have the model reason about visual content. The Vision framework is integrated directly, giving the model on-device capabilities such as OCR for precise text extraction and barcode readers for quick scanning.
Two supporting pieces round out the developer story. The Evaluations framework tests prompts and validates AI-powered behaviour across changing conditions — coverage Apple argues goes beyond what unit tests provide, and which matters when iterating on instructions, switching models or tuning a profile. Separately, a new fm command line tool in macOS 27 supports scripting and automating model workflows without writing any app code, offering a quick route from idea to prototype.
Open-source utilities and a Python SDK
Apple has also released open-source components. A utilities package layers experimental abstractions on top of the framework, including custom skills, context management helpers, and a Chat Completions client that can connect to a hosted model of the developer's choosing. A Foundation Models SDK for Python extends the framework into the Python ecosystem, allowing integration with popular Python tooling and evaluation packages.
The documentation also sets boundaries. Acceptable Use Requirements list prohibited uses of Apple Foundation Models, and Apple states it makes information available to providers of AI systems who intend to integrate AFM 3 Cloud, citing Article 53(1)(b) of the EU AI Act.
Why it matters
Apple is treating LLM integration as a core platform capability rather than something every app wires up independently. A single Swift API spanning on-device inference, Apple's privacy-focused cloud and third-party servers such as Claude and Gemini gives developers portability across model providers, while the Language Model protocol invites an ecosystem of provider-built packages. The free Private Cloud Compute tier removes the API-cost barrier for smaller apps, and Dynamic Profiles combined with the Evaluations framework and the CLI suggest Apple expects agentic features to become ordinary parts of macOS software. The explicit AI Act reference is also a reminder that compliance documentation is now part of shipping an AI platform.
- #apple
- #swift
- #llm
- #on-device-ai
- #macos
- #ai-agents