Comprehensive guide for implementing on-device AI models on iOS using Foundation Models and MLX Swift frameworks. Use WHEN building iOS apps with (1) Local LLM inference, (2) Vision Language Models (VLMs), (3) Text embeddings, (4) Image generation, (5) Tool/function calling, (6) Multi-turn conversations, (7) Custom model integration, or (8) Structured generation.
View on GitHubplugins/app/skills/local-ai-models/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/mintuz/claude-plugins/blob/main/plugins/app/skills/local-ai-models/SKILL.md -a claude-code --skill local-ai-modelsInstallation paths:
.claude/skills/local-ai-models/# iOS On-Device AI Models Production-ready guide for implementing on-device AI models in iOS apps using Apple's Foundation Models framework and MLX Swift. ## When to Use This Skill - Implementing local LLM inference in iOS apps - Building chat interfaces with Foundation Models - Integrating Vision Language Models (VLMs) - Adding text embeddings or image generation - Implementing tool/function calling with LLMs - Managing multi-turn conversations - Optimizing memory usage for on-device models - Supporting internationalization in AI features ## Core Principles 1. **Availability First** - Always check model availability before initialization 2. **Stream Responses** - Provide progressive UI updates for better UX 3. **Session Persistence** - Reuse LanguageModelSession for multi-turn conversations (Foundation Models) 4. **Memory Awareness** - Use quantized models and monitor memory usage 5. **Async Everything** - Load models asynchronously, never block the main thread 6. **Locale Support** - Use supportsLocale(_:) and locale instructions for Foundation Models ## Quick Reference ### Framework Comparison | Topic | Guide | | ---------------------------------- | ----------------------------------------------------------- | | Framework comparison and selection | [framework-selection.md](references/framework-selection.md) | ### Foundation Models (Apple's Framework) | Topic | Guide | | ------------------------------- | ----------------------------------------------------------------------------------- | | Setup and configuration | [foundation-models/setup.md](references/foundation-models/setup.md) | | Chat patterns and conversations | [foundation-models/chat-patterns.md](references/foundation-models/chat-patterns.md) | ### MLX Swift (Advanced Features) | Topic