foundation-models-on-device

Run FoundationModels language models locally in iOS apps with Swift.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/Oruga420/claude-code-skills --skill foundation-models-on-device-oruga420
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/Oruga420/claude-code-skills/tree/main/foundation-models-on-device
Command: npx skills add https://github.com/Oruga420/claude-code-skills --skill foundation-models-on-device-oruga420

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels enables on-device language model execution for privacy-preserving apps, allowing offline AI capabilities without data leaving the device.

Core Features & Use Cases

  • On-device text generation with FoundationModels for privacy and offline support.
  • Structured output via @Generable, with Swift types and snapshot streaming for real-time UI updates.
  • Custom tool calling to perform domain-specific actions without cloud round-trips.
  • Availability checks to ensure device eligibility and proper session handling.

Quick Start

Integrate FoundationModels on-device LLM into your iOS app to enable private, offline generation with structured outputs and tool calls.

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 run on-device LLMs in my iOS app for offline text generation?

To run on-device LLMs in your iOS app, you use FoundationModels to enable privacy-preserving text generation. This allows offline AI capabilities without data leaving the device.

How do I get structured outputs from an on-device language model in Swift?

You get structured outputs from an on-device language model in Swift by using the @Generable feature. This provides Swift types and snapshot streaming for real-time UI updates.

Can I execute custom tool calling locally without cloud round-trips on iOS?

Yes, you can execute custom tool calling locally without cloud round-trips on iOS. FoundationModels supports domain-specific actions directly on-device to maintain privacy and offline functionality.

How do I check device availability before starting an on-device LLM session?

You check device availability before starting an on-device LLM session by implementing device eligibility checks. This ensures proper session handling for robust on-device AI experiences.

Does FoundationModels support streaming responses for real-time UI updates?

Yes, FoundationModels supports streaming responses for real-time UI updates. It implements snapshot streaming to deliver robust on-device AI experiences with immediate feedback.