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:

  1. 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.

  2. Guided Generation: This feature allows developers to get structured output in Swift, making it easier to generate content that fits specific data structures.

  3. Tool Calling: This enables the model to autonomously execute code defined in the app, expanding the model's capabilities.

  4. Streaming APIs: These APIs help in managing latency by providing streaming output, which can be displayed incrementally.

  5. 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.