Give me summary of Foundation Models APIs

Asked on 06/25/2025

1 search

The Foundation Models APIs, introduced at WWDC 2025, provide developers with access to Apple's on-device large language model through a convenient Swift API. This framework is available across macOS, iOS, iPadOS, and VisionOS, allowing developers to enhance their apps with intelligent features while ensuring user data privacy since all operations are performed on-device.

Key features of the Foundation Models framework include:

  1. Prompting and Sessions: Developers can easily prompt the model with just a few lines of code. The framework supports stateful sessions, which maintain a transcript of interactions, useful for debugging or UI display.

  2. Guided Generation: This feature allows developers to obtain structured output from the model. By using macros like Generable and Guide, developers can define the types of data they want the model to generate, ensuring more reliable and structured responses.

  3. Tool Calling: The model can autonomously call functions defined in your app, allowing it to perform actions or fetch additional information as needed. This is particularly useful for integrating live or personal data, such as weather or calendar events, into the model's responses.

  4. Streaming Output: The API supports streaming responses, which can enhance user experience by providing incremental output, turning latency into a moment of delight.

  5. Developer Tools: The framework includes tools for profiling model requests and optimizing performance. Developers can also provide feedback to Apple to help improve the models and APIs.

For a more detailed introduction, you can refer to the session Meet the Foundation Models framework (00:00:00) and explore the chapters on guided generation, tool calling, and more.