Apple On-Device Foundation Models
Integrates Apple's FoundationModels framework for private, on-device AI text generation and structured data extraction in iOS apps.
This skill provides comprehensive patterns and best practices for leveraging Apple's FoundationModels framework in iOS 26 and later. It enables developers to build privacy-preserving, offline-capable AI features such as multi-turn conversational sessions, guided generation using the @Generable Swift macro, custom tool calling for domain-specific tasks, and real-time UI streaming through snapshot partials, all while managing on-device constraints like the 4,096 token limit.
Key Features
01Real-time snapshot streaming for responsive UI updates
02Built-in patterns for model availability and error handling
03Custom tool calling for domain-specific AI actions
04Structured output using the @Generable Swift macro
051 GitHub stars
06On-device text generation with LanguageModelSession
Use Cases
01Extracting structured data from natural language without cloud APIs
02Building offline-capable AI assistants for iOS applications
03Implementing privacy-focused features where sensitive data never leaves the device