affaan-m avatar

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-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/everything-claude-code

More from affaan-m/everything-claude-code

All 256

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs