Foundation Models Guide
A practical guide to building Apple Intelligence features with sessions, structured generation, streaming, tools, safety, and adapters.
Fast answers for the moments when you are actually building.
Foundation Models is moving fast. This guide keeps the practical parts close: availability, prompts, guided generation, snapshots, tools, language support, and the edge cases that matter when you ship real apps.
Start with the task in front of you, then go deeper.
Introduction to Foundation Models
Understand what Apple's Foundation Models framework can do, where it fits, and when to choose it for app features.
Getting Started with Sessions
Create your first LanguageModelSession, check model availability, and build the basic interaction loop.
Streaming and Snapshots
Build responsive interfaces around Foundation Models snapshots instead of token-by-token deltas.
Generation Options and Sampling Control
Tune sampling behavior with generation options while keeping on-device output practical and predictable.
Structured Generation with Schemas
Use @Generable, @Guide, and schemas to turn model output into type-safe Swift data.
Basic Tool Use
Give the model carefully scoped tools so it can fetch data, call services, and act inside your app.
Advanced Chat Patterns
Design multi-turn Foundation Models conversations with state, transcripts, and app-specific context.
Safety and Best Practices
Handle guardrails, refusals, privacy, and production boundaries for on-device AI features.
Integrating External JSON APIs
Combine external JSON APIs with Foundation Models for grounded app workflows and structured results.
Content Tagging and Classification
Classify, tag, and organize user content with small, focused prompts and structured output.
Supported Languages and Internationalization
Inspect supported locales and build multilingual Foundation Models experiences responsibly.
Training Custom Adapters
Explore Apple's adapter training flow and where custom adapters fit into app-specific AI.
Keep going