apple-on-device-ai

Select on-device AI frameworks and implement inference flows across Apple devices.

Updated May 6, 2026
One-click install
npx skills add https://github.com/Roy-wonji/claude-config --skill apple-on-device-ai-roy-wonji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-on-device-ai
Source: https://github.com/Roy-wonji/claude-config/tree/main/skills/swift-ios-skills/skills/apple-on-device-ai
Command: npx skills add https://github.com/Roy-wonji/claude-config --skill apple-on-device-ai-roy-wonji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you choose and implement the right on-device AI stack so your app can generate structured outputs, call tools, and run ML inference privately without crashes or missing fallback paths.

Core Features & Use Cases

  • On-device framework selection: Pick Foundation Models for iOS 26+/macOS 26+ Apple Intelligence workflows, Core ML for custom vision/NLP/audio models, MLX Swift for high-throughput Apple Silicon LLM research, and llama.cpp for GGUF cross-platform inference.
  • Production-ready Foundation Models patterns: Availability checking, session management, prewarming, structured generation with @Generable/@Guide, tool calling with Tool schemas, error handling, sampling options, and prompt design rules.
  • Core ML deployment & optimization guidance: Conversion pipeline (coremltools), mlprogram format expectations, quantization/palettization/pruning tradeoffs, compute-unit configuration, and performance tuning considerations.
  • Memory-safe MLX Swift and fallback architecture: Model size guidance by device RAM, GPU cache controls, background unloading guidance, coordinator-based serialization, and multi-backend fallback strategy.

Quick Start

Use this skill to integrate on-device tool-calling and structured generation for an iOS 26+ app, while ensuring robust availability checks and a fallback backend for devices where Apple Intelligence is unavailable.

Frequently Asked Questions about apple-on-device-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement on-device AI inference with structured output on iOS?

On-device AI inference with structured output on iOS uses Foundation Models with @Generable and @Guide macros for type-safe generation. It requires iOS 26+ or macOS 26+ for Apple Intelligence, with availability checking and session prewarming to ensure reliable execution.

What's the best way to run LLM inference privately on Apple Silicon?

Running LLM inference privately on Apple Silicon is best handled by MLX Swift for high-throughput workflows, utilizing GPU cache controls and coordinator-based serialization to prevent memory contention. Model size must be guided by device RAM with background unloading support.

How does tool calling work with Apple Foundation Models?

Tool calling with Apple Foundation Models works by defining Tool schemas that the model can invoke during generation sessions. It requires proper session management, availability checks, and error handling to ensure the inference flow responds correctly to tool invocations.

Can I use Core ML for custom on-device NLP and vision models?

Core ML supports custom on-device NLP and vision models through a conversion pipeline using coremltools to the mlprogram format. Optimization involves quantization, palettization, and pruning tradeoffs alongside compute-unit configuration for performance tuning.

Do I need a fallback strategy when Apple Intelligence is unavailable for on-device AI?

A fallback strategy is required when Apple Intelligence is unavailable for on-device AI, using availability-aware routing to coordinate multi-backend fallback across Foundation Models, Core ML, MLX Swift, and llama.cpp GGUF inference to maintain functionality.

Why does on-device AI inference crash or contend for memory on iOS?

On-device AI inference crashes or contends for memory on iOS due to unserialized concurrent access and unmanaged GPU caches. It requires coordinator actors for serialization, context budgeting, and physical-device testing to prevent resource contention and ensure stability.