How do I prompt Apple Foundation Model? What are the limitations?
Asked on 2025-06-25
1 search
To prompt the Apple Foundation Model, you can use the Foundation Models Framework, which allows you to interact with the model using just a few lines of code. Here's a basic outline of how to prompt the model:
- Import the Framework: Start by importing the Foundation Models framework into your project.
- Create a Session: Initialize a session with the model. This session is stateful, meaning it can maintain context across multiple interactions.
- Send a Prompt: Use the session to send your prompt to the model. You can write prompts in any language supported by Apple Intelligence.
For example, you can use Xcode's Playground feature to experiment with different prompts and see the model's responses in real-time. This is a great way to refine your prompts and find what works best for your app.
Limitations
-
Safety and Guardrails: The Foundation Models framework includes built-in guardrails to block harmful inputs and outputs. However, developers are still responsible for ensuring their app does not generate inappropriate content. You should carefully design prompts and handle user inputs to maintain safety.
-
Model Knowledge: The model's knowledge is based on the data it was trained on, which is fixed in time. It may not be as knowledgeable as larger server-scale models and might not contain recent events.
-
Structured Output: While the model can generate structured responses, it can be challenging to maintain and parse these outputs reliably. The framework offers features like guided generation to help with this.
-
Privacy and Offline Use: The model runs on-device, ensuring user data privacy and allowing it to work offline. However, this also means it might not have access to live data unless you use tool calling to fetch external information.
For more detailed guidance on prompt design and safety, you can refer to the session Explore prompt design & safety for on-device foundation models (11:03).

Explore prompt design & safety for on-device foundation models
Design generative AI experiences that leverage the strengths of the Foundation Models framework. We’ll start by showing how to design prompts for the on-device large language model at the core of Apple Intelligence. Then, we’ll introduce key ideas around AI safety, and offer concrete strategies to make your generative AI features safe, reliable, and delightful.

Discover machine learning & AI frameworks on Apple platforms
Tour the latest updates to machine learning and AI frameworks available on Apple platforms. Whether you are an app developer ready to tap into Apple Intelligence, an ML engineer optimizing models for on-device deployment, or an AI enthusiast exploring the frontier of what is possible, we’ll offer guidance to help select the right tools for your needs.

Meet the Foundation Models framework
Learn how to tap into the on-device large language model behind Apple Intelligence! This high-level overview covers everything from guided generation for generating Swift data structures and streaming for responsive experiences, to tool calling for integrating data sources and sessions for context management. This session has no prerequisites.