how can i run the new foundation models on my phone

Asked on 2025-06-11

1 search

To run the new foundation models on your phone, you can use the Foundation Models Framework introduced by Apple. This framework provides access to an on-device large language model through a convenient Swift API, available on macOS, iOS, iPadOS, and VisionOS. Here are the key points to get started:

  1. On-Device Execution: The models run entirely on your device, ensuring that all data remains private and can be processed offline. This means you don't need to send data to a server, and it eliminates the need for account setup or API keys.

  2. Integration: You can integrate the Foundation Models Framework into your app with just a few lines of code. Start by importing the framework, creating a session, and sending your prompt to the model.

  3. Capabilities: The framework is optimized for tasks such as content generation, text summarization, and user input analysis. It can be used to enhance existing app features or create new ones, like generating itineraries in a travel app or creating dialogue for game characters.

  4. Performance: The framework leverages Apple's hardware, including the CPU, GPU, and neural engine, to optimize performance and energy efficiency.

For a practical example of how to implement this, you can refer to the session Code-along: Bring on-device AI to your app using the Foundation Models framework, which provides a step-by-step guide on using the framework in an app.

how can i run the new foundation models on my phone | Ask WWDC