accessorysetupkit
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Build private, on-device AI features on iPhone, iPad, and Mac with Foundation Models, Core ML, MLX Swift, or llama.cpp. Use when choosing an Apple-local model runtime, building an Apple Intelligence chatbot or tool-calling feature, running an LLM on Apple Silicon, converting or
$ npx -y skills add dpearson2699/swift-ios-skills --skill apple-on-device-ai --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/apple-on-device-aiContext preview
The summary Claude sees to decide when to auto-load this skill.
Build private, on-device AI features on iPhone, iPad, and Mac with Foundation Models, Core ML, MLX Swift, or llama.cpp. Use when choosing an Apple-local model runtime, building an Apple Intelligence chatbot or tool-calling feature, running an LLM on Apple Silicon, converting or
name: apple-on-device-ai description: "Build private, on-device AI features on iPhone, iPad, and Mac with Foundation Models, Core ML, MLX Swift, or llama.cpp. Use when choosing an Apple-local model runtime, building an Apple Intelligence chatbot or tool-calling feature, running an LLM on Apple Silicon, converting or compressing a Python model for Core ML, or comparing on-device inference backends. For Swift Core ML loading and prediction code, use the coreml skill."
Guide for selecting, deploying, and optimizing on-device ML models. Covers Apple Foundation Models, Core ML, MLX Swift, and llama.cpp.
Use this decision tree to pick the right framework for your use case.
**When to use:** Text generation, summarization, entity extraction, structured output, and short dialog on iOS 26+ / macOS 26+ devices with Apple Intelligence enabled. No app-managed API key, network round trip, or model hosting; still handle system model asset readiness.
**Best for:**
**Not suited for:** Complex math, code generation, factual accuracy tasks, or apps targeting pre-iOS 26 devices.
**When to use:** Deploying custom trained models (vision, NLP, audio) across all Apple platforms. Converting models from PyTorch, TensorFlow, or scikit-learn with coremltools.
**Best for:**
**When to use:** Running specific open-source LLMs (Llama, Mistral, Qwen, Gemma) on Apple Silicon with maximum throughput. Research and prototyping.
**Best for:**
**When to use:** Cross-platform LLM inference using GGUF model format. Production deployments needing broad device support.
**Best for:**
| Scenario | Framework | |---|---| | Text generation on Apple Intelligence devices (iOS 26+) | Foundation Models | | Structured output from on-device LLM | Foundation Models (`@Generable`) | | Image classification, object detection | Core ML | | Custom model from PyTorch/TensorFlow | Core ML + coremltools | | Running specific open-source LLMs | MLX Swift or llama.cpp | | Maximum throughput on Apple Silicon | MLX Swift | | Cross-platform LLM inference | llama.cpp | | OCR and text recognition | Vision framework | | Sentiment analysis, NER, tokenization | Natural Language framework | | Training custom classifiers on device | Create ML |
Use the system language model for short generation, summarization, tagging, structured output, and tool-augmented tasks on Apple Intelligence devices. Gate every entry point before creating a session:
import FoundationModels
switch SystemLanguageModel.default.availability {
case .available:
guard SystemLanguageModel.default.supportsLocale(Locale.current) else {
// Use locale fallback before generating
break
}
// Proceed with model usage
case .unavailable(.appleIntelligenceNotEnabled):
// Guide user to enable Apple Intelligence in Settings
case .unavailable(.modelNotReady):
// System model assets are not ready; show loading state
case .unavailable(.deviceNotEligible):
// Device cannot run Apple Intelligence; use fallback
case .unavailable(let reason):
// Unknown or future unavailable reason; use fallback and log reason
}Then create a session and keep its shared context budget small:
let session = LanguageModelSession {
"You are a helpful cooking assistant."
}
session.prewarm()
let response = try await session.respond(to: "Suggest a quick pasta recipe")Required guardrails:
check `isResponding` before issuing another response.
context window. Register only necessary tools and keep schemas compact.
remain active, so handle refusal and other generation errors with fallback UI.
Load [the Foundation Models reference](references/foundation-models.md) when the task needs `@Generable`, `@Guide`, streaming, tool definitions, transcripts, generation options, custom adapters, prompt design, or detailed error handling.
Apple's framework for deploying trained models. Automatically dispatches to the optimal compute unit (CPU, GPU, or Neural Engine).
| Format | Extension | When to Use | |---|---|---| | `.mlpackage` | Directory (mlprogram) | All new models (iOS 15+) | | `.mlmodel` | Single file (neuralnetwork) | Legacy only (iOS 11-14) | | `.mlm
86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.
Repo: dpearson2699/swift-ios-skills
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for…
Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks,…
Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers…
Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store Connect experiences,…
Implement App Intents for Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence on iOS. Covers AppIntent actions, AppEntity and…