foundation-models-on-device

Integrate Apple FoundationModels on-device AI into iOS 26+ apps.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill foundation-models-on-device-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/foundation-models-on-device
Command: npx skills add https://github.com/luongldptit/move-ticket --skill foundation-models-on-device-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the need to send user data to cloud servers for AI processing, solving privacy risks and offline functionality gaps for iOS app AI features.

Core Features & Use Cases

  • On-device text generation: Build AI-powered features like content summarization, conversational assistants, and text creation that run entirely on the user's device with no cloud dependency.
  • Structured data extraction: Use the @Generable macro to pull organized, typed data (like form inputs, event details) from natural language instead of parsing error-prone raw text strings.
  • Custom tool calling: Create domain-specific AI actions (like recipe search, calendar lookups) that the model can invoke automatically based on user prompts.
  • Real-time response streaming: Use snapshot streaming to progressively display generated structured content in SwiftUI for smooth, responsive user interfaces. A common use case is building a privacy-focused cooking app that suggests recipes based on user-provided ingredients, works fully offline, and returns structured recipe data without sending any user input to external servers.

Quick Start

Use the foundation-models-on-device skill to add an on-device AI feature to your iOS app that extracts structured cat profile information (name, age, personality description) from natural language user input using the @Generable macro, with no data leaving the user's device.

Frequently Asked Questions about foundation-models-on-device

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

FAQPage Schema
How do I implement on-device AI text generation in iOS without sending data to the cloud?

On-device AI text generation in iOS uses the FoundationModels framework to run features like content summarization entirely on the user's device, eliminating cloud dependency and preventing user data exfiltration risks.

How does the @Generable macro extract structured data from natural language input in Swift?

The @Generable macro extracts structured data from natural language input by pulling organized, typed information like form inputs or event details directly in Swift, bypassing the need to parse error-prone raw text strings.

Can I build custom tool calling for domain-specific iOS app features using Apple FoundationModels?

Apple FoundationModels supports custom tool calling to create domain-specific AI actions like recipe searches or calendar lookups that the model invokes automatically based on user prompts within your iOS application.

Does on-device AI with FoundationModels support real-time streaming for SwiftUI interfaces?

On-device AI with FoundationModels supports real-time streaming for SwiftUI interfaces using snapshot streaming to progressively display generated structured content, ensuring smooth and responsive user experiences.

What are the device and context window limitations when building on-device AI for iOS 26+?

Building on-device AI for iOS 26+ requires checking model availability and adhering to on-device model context window constraints, meaning you must handle tool call errors gracefully and ensure features work offline.

When should I use privacy-preserving on-device AI instead of cloud-based processing for my iOS app?

Privacy-preserving on-device AI should be used instead of cloud-based processing when your iOS app handles sensitive user data or requires full offline functionality, eliminating data exfiltration risks completely.