tell me about foundation models
Asked on 06/18/2025
1 search
The Foundation Models framework, introduced at WWDC 2025, provides access to an on-device large language model through a convenient Swift API. This framework is available on macOS, iOS, iPadOS, and VisionOS, and it allows developers to enhance existing app features or create new ones, such as personalized search suggestions or generating dialogue for game characters. The model runs entirely on-device, ensuring privacy and offline functionality without increasing app size.
Key features of the Foundation Models framework include:
-
Stateful Sessions: The framework is built around stateful sessions, allowing developers to provide custom instructions to guide the model's responses. This helps protect against prompt injection attacks by prioritizing developer-provided instructions over user prompts.
-
Guided Generation: This feature allows the model to produce structured output, such as JSON or CSV, which is easier to integrate into app views. It uses macros like Generable and Guide to describe types and control generated values.
-
Tool Calling: The model can autonomously execute code defined in your app, allowing it to perform tasks like fetching up-to-date content or taking actions based on user input.
-
Privacy and Safety: The framework includes guardrails to block harmful inputs and outputs, ensuring a safe app experience. Developers are encouraged to consider potential misuse and design their apps to handle user input carefully.
For more detailed information, you can explore sessions like Meet the Foundation Models framework and Deep dive into the Foundation Models framework.

Meet the Foundation Models framework
Learn how to tap into the on-device large language model behind Apple Intelligence! This high-level overview covers everything from guided generation for generating Swift data structures and streaming for responsive experiences, to tool calling for integrating data sources and sessions for context management. This session has no prerequisites.

Discover machine learning & AI frameworks on Apple platforms
Tour the latest updates to machine learning and AI frameworks available on Apple platforms. Whether you are an app developer ready to tap into Apple Intelligence, an ML engineer optimizing models for on-device deployment, or an AI enthusiast exploring the frontier of what is possible, we’ll offer guidance to help select the right tools for your needs.

Platforms State of the Union
Discover the newest advancements on Apple platforms.