foundational framework
Asked on 06/16/2025
1 search
The Foundation Models framework was introduced at WWDC 2025 as a powerful tool for developers to access on-device large language models 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, all while keeping data private and running offline.
Key features of the Foundation Models framework include:
-
Stateful Sessions: The framework is built around stateful sessions, allowing developers to provide custom instructions to the model, which helps in guiding the model's responses and protecting against prompt injection attacks.
-
Guided Generation: This feature allows developers to get structured output in Swift, making it easier to generate content that fits specific data structures.
-
Tool Calling: This enables the model to autonomously execute code defined in the app, expanding the model's capabilities.
-
Streaming APIs: These APIs help in managing latency by providing streaming output, which can be displayed incrementally.
-
Safety and Guardrails: The framework includes built-in guardrails to ensure safe app experiences by blocking harmful inputs and outputs.
For a detailed introduction to the Foundation Models framework, you can refer to the session Meet the Foundation Models framework (00:00:00). Additionally, for a deeper understanding of how to use sessions and other advanced features, you might find the session Deep dive into the Foundation Models framework (00:00:00) helpful.

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.

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

Deep dive into the Foundation Models framework
Level up with the Foundation Models framework. Learn how guided generation works under the hood, and use guides, regexes, and generation schemas to get custom structured responses. We’ll show you how to use tool calling to let the model autonomously access external information and perform actions, for a personalized experience. To get the most out of this video, we recommend first watching “Meet the Foundation Models framework”.