Apple On-Device Foundation Models
Integrates Apple's on-device FoundationModels framework to build private, offline AI features with structured output and tool calling in iOS.
Provides implementation patterns and best practices for Apple's FoundationModels framework to run on-device language models in iOS. It guides developers through availability checks, multi-turn conversational sessions, type-safe structured generation using the @Generable macro, custom tool calling, and real-time snapshot streaming for responsive SwiftUI interfaces, all while maintaining total user privacy without cloud dependencies.
주요 기능
01Stream snapshot responses into SwiftUI views with PartiallyGenerated models
020 GitHub stars
03Implement custom tool calling to execute domain-specific application logic
04Check system language model availability and handle eligibility states
05Extract type-safe structured outputs using Swift's @Generable macro and @Guide constraints
06Optimize prompts and chunk inputs within the 4,096 token context window
사용 사례
01Creating interactive streaming chat interfaces and custom AI tools in SwiftUI apps
02Building offline-capable AI features that preserve privacy without server-side compute
03Extracting structured Swift objects from natural language forms and user inputs