foundation-models-on-device

Generate on-device text and structured outputs with Apple's FoundationModels.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/devs6186/claude-private-skills-agents-commands --skill foundation-models-on-device-devs6186
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/devs6186/claude-private-skills-agents-commands/tree/main/skills/foundation-models-on-device
Command: npx skills add https://github.com/devs6186/claude-private-skills-agents-commands --skill foundation-models-on-device-devs6186

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables private, on-device language modeling using Apple's FoundationModels so apps can generate text and reason without sending data to the cloud, preserving user privacy and offline capability.

Core Features & Use Cases

  • On-device text generation and summarization using FoundationModels for offline apps.
  • Structured output generation with @Generable for safer data handling and UI binding.
  • Tool calling and snapshot streaming to enable real-time UI updates and domain-specific actions.

Quick Start

Integrate FoundationModels into your iOS project and run a simple on-device text generation example to verify functionality.

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 an on-device LLM in iOS for privacy-preserving text generation?

To run an on-device LLM in iOS, use Apple's FoundationModels framework to generate text locally. This avoids cloud dependencies, preserving user privacy and enabling offline execution.

Can I generate structured JSON output from an on-device iOS language model?

Yes, you can generate structured output from an on-device iOS language model using the @Generable attribute. This enables safer data handling and direct UI binding for structured responses.

What is the best way to stream real-time LLM responses in an offline iOS app?

The best way to stream real-time LLM responses in an offline iOS app is using snapshot streaming via a unified session API. This provides real-time UI updates while keeping data on-device.

Does Apple's FoundationModels framework support tool calling on-device?

Yes, Apple's FoundationModels framework supports tool calling on-device. This enables domain-specific actions and interactions while maintaining offline capability and user privacy.

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

A key limitation of on-device LLMs is handling a 4096 token context window. Developers must manage context limits and ensure devices have sufficient hardware resources for local execution.