
Foundation Models On Device
This wraps Apple's FoundationModels framework for building on-device LLM features in iOS 26+. You get text generation, structured output with the @Generable macro, custom tool calling, and snapshot streaming for real-time UI updates. Everything runs locally, so no cloud dependency and no data leaves the device. The patterns cover availability checks (critical since not all devices support Apple Intelligence), session management with instruction-based steering, and streaming partial results to SwiftUI views. The 4,096 token context limit is tight, so you'll need to chunk larger inputs. Good fit if you're building privacy-first AI features or need offline text generation without reaching for third-party SDKs.
- skills.sh installs
- 5K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill foundation-models-on-device --agent claude-codeInstalls into .claude/skills of the current project.
Files
FoundationModels: On-Device LLM (iOS 26)
Patterns for integrating Apple's on-device language model into apps using the FoundationModels framework. Covers text generation, structured output with @Generable, custom tool calling, and snapshot streaming — all running on-device for privacy and offline support.
When to Activate
- Building AI-powered features using Apple Intelligence on-device
- Generating or summarizing text without cloud dependency
- Extracting structured data from natural language input
- Implementing custom tool calling for domain-specific AI actions
- Streaming structured responses for real-time UI updates
- Need privacy-preserving AI (no data leaves the device)
Core Pattern — Availability Check
Always check model availability before creating a session:
struct GenerativeView: View {
private var model = SystemLanguageModel.default
Sponsors
Details
More from affaan-m/everything-claude-code
All 256- Investor Outreach5K
- Kotlin Patterns5K
- Rust Patterns5K
- Swift Actor Persistence5K
- Swift Protocol Di Testing5K
- Bun Runtime4.9K
- Nextjs Turbopack4.9K
- Plankton Code Quality4.9K
- Swift Concurrency 6 24.9K
- Visa Doc Translate4.9K
- Ai Regression Testing4.8K
- Architecture Decision Records4.8K
- Blueprint4.8K
- Everything Claude Code Conventions4.8K
- Exa Search4.8K
- Kotlin Testing4.8K
- Customs Trade Compliance4.7K
- Data Scraper Agent4.7K
- Documentation Lookup4.7K
- Enterprise Agent Ops4.7K
- Flutter Dart Code Review4.7K
- Inventory Demand Planning4.7K
- Kotlin Ktor Patterns4.7K
- Nanoclaw Repl4.7K