affaan-m avatar

Foundation Models On Device

Apple's FoundationModels framework lets you run LLMs directly on iOS 26+ devices without hitting the cloud. You get text generation, structured output via the @Generable macro (way better than parsing strings), custom tool calling, and snapshot streaming for real-time UI updates. The 4,096 token limit is tight and you can only run one request per session at a time, but the privacy and offline story is solid. Check model.availability before doing anything since not all devices support Apple Intelligence. Best for apps that need AI features without sending user data off device or requiring internet connectivity.

skills.sh installs
5.4K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill foundation-models-on-device --agent claude-code

Installs 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

Repository
github.com/affaan-m/ecc
Categories
Testing & QA, AI & Agent Building, Mobile Development
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1aws avatardeveloping-applications-on-managed-service-for-apache-flinkaws/agent-toolkit-for-awsMANDATORY for Flink or Amazon Managed Service for Apache Flink (MSF) questions. You MUST activate this skill BEFORE answering — do not answer from training know5.4Kskills.sh installs
2affaan-m avatarquarkus-verificationaffaan-m/eccVerification loop for Quarkus projects: build, static analysis, tests with coverage, security scans, native compilation, and diff review before release or PR.5.4Kskills.sh installs
3cursor avatarinterrogatecursor/pluginsUse for \"interrogate\", \"adversarial review\", \"multi-model review\", \"challenge this\", \"stress test this code\", \"find blind spots\", or \"tear this apa5.3Kskills.sh installs
4claude-office-skills avatarnews-monitorclaude-office-skills/skillsSet up news monitoring strategies, analyze news coverage, and synthesize current events. Create news digests and media analysis reports.5.3Kskills.sh installs
5dotnet avatarfilter-syntaxdotnet/skillsReference data for test filter syntax across all platform and framework combinations: VSTest --filter expressions, MTP filters for MSTest/NUnit/xUnit v3/TUnit, 5.2Kskills.sh installs
6dpearson2699 avatarios-accessibilitydpearson2699/swift-ios-skillsBuild and audit SwiftUI, UIKit, and AppKit accessibility for VoiceOver, Voice Control, Switch Control, Full Keyboard Access, Dynamic Type, focus restoration, la5.2Kskills.sh installs