foundation-models-on-device

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

1|1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/zardusai-cyber/zardus_setup --skill foundation-models-on-device-zardusai-cyber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/zardusai-cyber/zardus_setup/tree/main/ecc/skills/foundation-models-on-device
Command: npx skills add https://github.com/zardusai-cyber/zardus_setup --skill foundation-models-on-device-zardusai-cyber

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels on-device enables private, offline LLM execution, guiding generation and tool calls without leaving the device.

Core Features & Use Cases

  • On-device text generation for privacy-preserving apps using FoundationModels.
  • Structured output and guided generation with @Generable.
  • Custom tool calling for domain-specific actions and data retrieval.
  • Snapshot streaming for real-time, reactive UIs.
  • Offline and privacy-preserving AI capabilities for iOS 26+.

Quick Start

Install Apple FoundationModels on-device support and instantiate a LanguageModelSession to begin generating content.

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 for offline chat in iOS apps?

On-device text generation for iOS apps is enabled by instantiating a LanguageModelSession with Apple FoundationModels. This provides private, offline execution and real-time snapshot streaming for chat interfaces.

How does guided generation work with FoundationModels on iOS?

Guided generation with FoundationModels on iOS uses the @Generable attribute to produce structured output. This allows you to extract structured data directly from the on-device language model during offline processing.

Can I implement tool calling with on-device language models on iOS?

Yes, you can implement custom tool calling with on-device language models on iOS. FoundationModels supports domain-specific actions and data retrieval, allowing LLMs to trigger tools directly during on-device generation.

Does FoundationModels on-device require iOS 26+ to function?

Yes, FoundationModels on-device requires iOS 26+ to function. It enforces on-device availability checks to ensure the system supports private, offline LLM execution before starting a LanguageModelSession.

What is the best way to stream LLM responses for reactive UIs in iOS?

The best way to stream LLM responses for reactive UIs in iOS is using snapshot streaming provided by FoundationModels. This delivers real-time generation updates directly from the on-device LanguageModelSession.

Why use on-device LLMs instead of cloud-based generation for iOS apps?

Use on-device LLMs instead of cloud-based generation to ensure privacy-preserving data processing. FoundationModels keeps text generation, structured extraction, and tool calling completely offline within the iOS app.