foundation-models-on-device

Integrate Apple FoundationModels for on-device text generation and streaming in iOS apps.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill foundation-models-on-device-richardnpaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/richardnpaul/everything-vscode-copilot/tree/main/.github/skills/foundation-models-on-device
Command: npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill foundation-models-on-device-richardnpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels enables on-device language model capabilities, delivering privacy-preserving generation, structured outputs, and offline operation for iOS apps.

Core Features & Use Cases

  • On-device text generation and summarization using the FoundationModels framework.
  • Structured output with @Generable and snapshot streaming to drive real-time UI.
  • Custom tool calling for domain-specific actions and offline workflows.

Quick Start

Initialize a FoundationModels session on-device and generate a response to a user prompt with streaming updates.

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 integrate on-device language models into my iOS app for offline text generation?

On-device language models integrate into iOS apps using the FoundationModels framework to provide local text generation and offline capability. This approach runs entirely on-device, ensuring user data privacy while supporting text generation and summarization tasks.

How do I get structured output from an on-device LLM in Swift?

Structured output from an on-device LLM is achieved using the @Generable attribute. This feature structures generated text into defined models, allowing your iOS app to directly consume typed data instead of parsing raw text strings.

Can I stream LLM responses in real-time for my iOS UI?

Real-time LLM responses stream in iOS using snapshot streaming. This mechanism provides incremental updates during text generation, enabling your UI to render tokens progressively as the on-device model constructs the final output.

Does the FoundationModels framework support custom tool calling?

The FoundationModels framework supports custom tool calling for domain-specific actions. This allows your on-device iOS app to execute predefined functions, interact with local data, and handle complex offline workflows triggered by the language model.

What are the limitations of using on-device language models for iOS?

On-device language models operate under specific token limits and require compatible iOS hardware. They are designed for local execution and offline scenarios, meaning generation capacity is bounded by the device's available memory and framework constraints.