foundation-models-on-device

Generate text on-device with Apple FoundationModels for iOS apps.

7|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Davie521/claude-skills --skill foundation-models-on-device-davie521
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/Davie521/claude-skills/tree/main/plugins/swift/skills/foundation-models-on-device
Command: npx skills add https://github.com/Davie521/claude-skills --skill foundation-models-on-device-davie521

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Privacy-preserving on-device LLM capabilities that run without cloud or network dependencies, enabling offline AI features in iOS apps.

Core Features & Use Cases

  • On-device text generation using Apple's FoundationModels
  • Guided generation and structured outputs with @Generable
  • Tool calling for domain-specific actions and workflows
  • Snapshot streaming for real-time UI updates and progressive results
  • Offline operation supports privacy-sensitive workflows across apps (e.g., chat, drafting, summarization)

Quick Start

Instantiate a LanguageModelSession on-device and generate a simple text response to a user prompt.

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 iOS apps without network access?

On-device LLMs run without network access by using FoundationModels to enable offline text generation in iOS apps. This requires Swift-based session management to handle privacy-preserving data and generate responses locally.

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

Structured outputs are generated from on-device language models using the @Generable feature in Swift. This enables guided generation for structured data extraction and domain-specific workflows directly within iOS apps.

Can I use tool calling with FoundationModels for offline workflows?

Tool calling is supported by FoundationModels for offline workflows in iOS apps. This enables domain-specific actions and structured tool execution without requiring cloud access or network dependencies.

What is snapshot streaming for on-device text generation?

Snapshot streaming for on-device text generation provides real-time UI updates and progressive results during model generation. This feature supports chat interfaces and content creation workflows with streaming outputs.

Do I need iOS 26 to use FoundationModels for on-device generation?

FoundationModels for on-device generation requires iOS 26 or later. This platform support is necessary to instantiate LanguageModelSession objects and enable privacy-preserving offline generation in Swift apps.

What are the limitations of using on-device LLMs for iOS apps?

Limitations of on-device LLMs include requiring iOS 26+ and Swift-based session management for FoundationModels. On-device generation is best suited for privacy-sensitive apps needing offline operation rather than cloud-dependent workloads.