foundation-models-on-device

Integrate Apple's FoundationModels framework for on-device text generation and structured output.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/vrcms/everything-qwen-code --skill foundation-models-on-device-vrcms
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/vrcms/everything-qwen-code/tree/main/.qwen/skills/foundation-models-on-device
Command: npx skills add https://github.com/vrcms/everything-qwen-code --skill foundation-models-on-device-vrcms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of implementing AI features that require high privacy, offline availability, and low latency by leveraging Apple's native on-device FoundationModels framework.

Core Features & Use Cases

  • Structured Generation: Use the @Generable macro to enforce type-safe outputs directly from the model.
  • Tool Calling: Define custom Swift tools to allow the model to perform domain-specific actions like database lookups or calculations.
  • Snapshot Streaming: Stream structured data in real-time to update SwiftUI interfaces as the model generates content.
  • Use Case: Build a privacy-first journaling app that categorizes user entries into structured tags and summaries without ever sending data to a cloud server.

Quick Start

Use the foundation-models-on-device skill to implement a new session that generates structured user profile data using the Generable macro.

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 for iOS offline text generation?▼

Run an LLM on-device for iOS offline text generation by integrating Apple's FoundationModels framework, which enables privacy-preserving, low-latency AI features directly on the hardware without cloud reliance.

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

Get structured output from an on-device LLM in Swift by applying the @Generable macro, enforcing type-safe data extraction directly from the model session into defined Swift types.

Can I stream LLM generations to a SwiftUI interface in real-time?▼

Stream LLM generations to a SwiftUI interface in real-time using snapshot streaming, which provides continuous structured data updates to the UI as the model generates content.

Do I need iOS 26 to use Apple Intelligence FoundationModels?▼

Yes, you need iOS 26 or later to use Apple Intelligence FoundationModels, as the framework requires this platform version to support native on-device model sessions and tool execution.

How can I let an on-device LLM perform database lookups in my app?▼

Let an on-device LLM perform database lookups by defining custom Swift tools, allowing the model session to execute domain-specific calculations and actions securely during generation.

What is the best way to build a privacy-first AI app without sending data to a server?▼

Build a privacy-first AI app without servers by leveraging Apple's FoundationModels framework, which processes data and executes tools entirely on-device to preserve user privacy.