Can you summarise FoundationalsModel framework

Asked on 06/11/2025

1 search

The Foundation Models framework, introduced by Apple, provides access to an on-device large language model through a Swift API. This framework is available on macOS, iOS, iPadOS, and VisionOS, and is designed to enhance app features by leveraging Apple's optimized language model for tasks such as text extraction, summarization, and more. Here are some key aspects of the framework:

  1. On-Device Processing: The model runs entirely on the device, ensuring that all data remains private and can function offline without increasing app size.

  2. Ease of Use: Developers can start using the framework with just three lines of code: import the framework, create a session, and send a prompt to the model.

  3. Capabilities: The framework supports various tasks, including generating content, summarizing text, analyzing user input, and more. It can be used for personalized search suggestions, generating itineraries, or creating dialogue for game characters.

  4. Advanced Features:

    • Guided Generation: Allows for structured output in Swift, making it easier to map model outputs onto app views.
    • Tool Calling: Enables the model to autonomously execute code defined in the app, allowing integration with live or personal data like weather and calendar events.
    • Stateful Sessions: Built around the concept of stateful sessions, allowing for multi-turn interactions and custom instructions to guide the model's responses.
  5. Safety and Privacy: The framework includes guardrails to prevent harmful content generation and ensure user safety. Developers can also add custom safety rules for specific use cases.

  6. Developer Experience: The framework is tightly integrated with Xcode, providing a seamless development experience.

For a more detailed introduction, you can watch the session Meet the Foundation Models framework.