how can i run foundation models on a mac

Asked on 06/11/2025

1 search

To run foundation models on a Mac, 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. It is available on macOS, iOS, iPadOS, and VisionOS. Here are some key points about using the Foundation Models Framework on a Mac:

  1. On-Device Execution: The models run entirely on the device, ensuring that all data remains private and can be processed offline. This is beneficial for privacy and does not increase the app size since the model is built into the operating system.

  2. Swift API: You can easily integrate the framework into your projects by importing it and using its API to create sessions and send prompts to the model. This allows for tasks such as text generation, summarization, and more.

  3. Optimized Performance: The framework is optimized for performance using Apple's hardware, including the CPU, GPU, and neural engine, which are part of Apple Silicon. This ensures efficient execution of machine learning tasks.

  4. Core ML Integration: If you have custom models, you can use Core ML to run them on your Mac. Core ML optimizes performance by leveraging the hardware capabilities of Apple Silicon.

For a detailed introduction to the Foundation Models Framework, you can watch the session Meet the Foundation Models framework. If you want to dive deeper into its capabilities, consider watching Deep dive into the Foundation Models framework.

Additionally, if you are interested in running large language models specifically on Apple Silicon, you can explore the session Explore large language models on Apple silicon with MLX, which introduces MLX, a library designed for this purpose.