Create a study guide for Foundation Model Framework
Asked on 06/14/2025
2 searches
Here's a study guide for the Foundation Model Framework based on the content presented at WWDC 2025:
Overview of the Foundation Models Framework
-
Introduction to the Framework
- The Foundation Models Framework provides access to an on-device large language model with a Swift API.
- It is available on macOS, iOS, iPadOS, and VisionOS.
- The framework is designed to enhance app features like personalized search suggestions and content generation while maintaining user privacy by running entirely on-device.
-
Key Features
- Guided Generation: Allows for structured output in Swift using macros like
Generable
andGuide
. This helps in generating instances of specific types and controlling the values of properties. - Tool Calling: Enables the model to autonomously execute code defined in your app, allowing for dynamic interaction and data fetching.
- Stateful Sessions: Supports multi-turn interactions by maintaining session state, allowing for more complex and context-aware conversations.
- Guided Generation: Allows for structured output in Swift using macros like
-
Performance and Safety
- The model is optimized with state-of-the-art quantization techniques and speculative decoding for performance efficiency.
- The framework includes built-in guardrails to ensure safety and prevent inappropriate content generation. Developers can add custom safety rules for specific use cases.
Practical Implementation
-
Prompt Engineering
- Start by importing the Foundation Models framework, creating a session, and sending prompts to the model.
- Use Xcode's Playground to iterate on prompt design and receive live feedback.
-
Building Applications
- The framework can be used to build applications that generate itineraries, dialogue for game characters, and more.
- Example: An app that plans trips by generating itineraries and autonomously selecting points of interest using tool calling.
-
Code-Along Session
- A practical session is available to guide developers through building an app using the Foundation Models framework, focusing on prompt engineering, tool calling, and streaming output.
Sessions to Explore
- Meet the Foundation Models framework (00:00:00): Provides a high-level overview of the framework, including guided generation and tool calling.
- Code-along: Bring on-device AI to your app using the Foundation Models framework (00:00:00): A step-by-step guide to implementing the framework in an app.
- Deep dive into the Foundation Models framework (00:00:00): Offers an in-depth look at sessions, generable types, dynamic schemas, and tool calling.
- Explore prompt design & safety for on-device foundation models (00:00:00): Focuses on best practices for prompt design and AI safety considerations.
This study guide should provide a comprehensive understanding of the Foundation Models Framework and how to effectively utilize it in your applications.

Code-along: Bring on-device AI to your app using the Foundation Models framework
Develop generative AI features for your SwiftUI apps using the Foundation Models framework. Get started by applying the basics of the framework to create an awesome feature. Watch step-by-step examples of how to complement the models with tools you build, stream results, and apply further optimizations for great performance.

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

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.