foundation-models-on-device

Generate text and structured output on-device with Apple FoundationModels.

86|21|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/Jamkris/everything-gemini-code --skill foundation-models-on-device-jamkris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/Jamkris/everything-gemini-code/tree/main/skills/foundation-models-on-device
Command: npx skills add https://github.com/Jamkris/everything-gemini-code --skill foundation-models-on-device-jamkris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels enables on-device language models, allowing private, offline AI capabilities in iOS apps without sending data to the cloud.

Core Features & Use Cases

  • On-device text generation with privacy-preserving inferencing for offline scenarios.
  • Structured output via @Generable, enabling typed data and reliable downstream processing.
  • Custom tool calling for domain-specific actions and real-time user interactions.
  • Snapshot streaming to provide progressive UI updates as content is generated.
  • Session management and model availability checks to ensure robust UX.

Quick Start

Install the on-device FoundationModels integration and initialize a sample session.

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 text generation offline in my iOS app?

On-device text generation in iOS uses Apple FoundationModels to run private language models locally. This enables offline inferencing without sending user data to the cloud, ensuring privacy while generating text responses.

How do I get structured output from an LLM for reliable downstream processing?

Structured output from an LLM is achieved using the @Generable feature in FoundationModels. This provides typed data directly from the on-device model, enabling reliable downstream processing and safe integration with your app's logic.

Can I use custom tool calling with on-device models for domain-specific actions?

Custom tool calling is supported by FoundationModels on-device. You can define domain-specific actions that the local LLM can trigger during real-time user interactions, extending the model's capabilities beyond standard text generation.

What is the best way to stream LLM responses progressively to the UI in iOS?

Streaming LLM responses progressively to the UI is handled using snapshot streaming. This FoundationModels feature provides real-time UI updates by delivering generated content snapshots as the on-device model produces them.

Does FoundationModels require model availability checks before starting a session?

FoundationModels requires model availability checks before use. Enforcing these checks alongside per-session management ensures a robust UX by verifying the on-device model is ready before initializing generation tasks.