foundation-models-on-device

Generate text and structured output with Apple FoundationModels on iOS devices.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill foundation-models-on-device-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/foundation-models-on-device
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill foundation-models-on-device-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

On-device LLM capabilities enable privacy-preserving AI features in iOS apps by executing language models entirely on the device, eliminating cloud dependencies for sensitive data.

Core Features & Use Cases

  • Text generation and structured output using FoundationModels on-device
  • Custom tool calling for domain-specific actions
  • Snapshot streaming for real-time UI updates
  • SwiftUI integration and session management with availability checks
  • Privacy-first offline operation for assistants, content generation, and data processing

Quick Start

Instantiate an on-device LanguageModelSession and begin streaming a Generable-backed response for a sample 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 an LLM on-device in iOS for private offline text generation?

On-device LLM execution in iOS uses Apple's FoundationModels to generate text entirely locally, ensuring data privacy by eliminating cloud dependencies. You instantiate a LanguageModelSession to process prompts securely offline.

Can I get structured output from an offline LLM using Generable in iOS?

Structured output is achieved using the Generable framework with FoundationModels, allowing your on-device LLM to return typed, structured data safely. This enables reliable data parsing for iOS assistants without network calls.

How do I implement tool calling with FoundationModels on iOS?

Tool calling with FoundationModels lets your on-device LLM trigger domain-specific actions within your iOS app. You must safely handle tool calls during the LanguageModelSession to prevent data leaks and execute functions locally.

What is the best way to stream LLM responses in SwiftUI for real-time UI updates?

Streaming LLM responses in SwiftUI uses snapshot streaming to provide real-time UI updates as the model generates text. This requires proper session management and availability checks to ensure the on-device model is ready.

Do I need availability checks for on-device LLMs before starting a session?

Availability checks are required before instantiating a LanguageModelSession to verify the iOS device supports FoundationModels. This prevents runtime errors and ensures your privacy-first assistant operates safely offline.

Why use offline LLMs instead of cloud APIs for iOS app data processing?

Offline LLMs process sensitive data directly on the device using FoundationModels, guaranteeing zero data leaks compared to cloud APIs. This privacy-first approach is essential for secure iOS content generation and data handling.