foundation-models-on-device

Integrate Apple FoundationModels for on-device text generation and tool calling in SwiftUI.

Updated May 4, 2026
One-click install
npx skills add https://github.com/gganbukim1/myskills --skill foundation-models-on-device-gganbukim1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/gganbukim1/myskills/tree/main/foundation-models-on-device
Command: npx skills add https://github.com/gganbukim1/myskills --skill foundation-models-on-device-gganbukim1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps developers integrate Apple’s on-device FoundationModels so apps can generate text, structured data, and tool-driven responses without relying on the cloud.

Core Features & Use Cases

  • Model availability handling: Check device eligibility and Apple Intelligence readiness before starting a session.
  • On-device text generation: Produce responses locally for privacy-preserving UX.
  • Structured output with @Generable: Generate strongly-typed Swift models using @Guide constraints (e.g., ranges and element counts).
  • Tool calling: Let the model invoke custom domain logic through Tool definitions and Arguments.
  • Snapshot streaming: Stream partially generated structured results for responsive SwiftUI interfaces.

Quick Start

Implement model availability checks with LanguageModelSession on iOS 26+, then request a structured @Generable response (and optionally stream partial snapshots) for your 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 generate structured output with Apple's on-device LLM in Swift?

Tool calling lets on-device FoundationModels invoke custom domain logic through Tool definitions and Arguments schemas. You define the tool's expected input parameters, and the model extracts the necessary arguments from the user prompt to execute it.

Can I stream partially generated structured responses to SwiftUI?

Yes, you can stream partially generated structured states to SwiftUI interfaces using snapshot streaming via streamResponse. This provides responsive UI updates as the on-device model progressively generates the requested structured output.

How do I check Apple Intelligence readiness before starting an on-device LLM session?

You check Apple Intelligence readiness and device eligibility using model availability handling before starting a session. This ensures the iOS device supports on-device FoundationModels required for your text generation or tool calling tasks.

What is the best way to build a private LLM assistant without cloud reliance on iOS?

Building a private assistant without cloud reliance uses on-device FoundationModels for local text generation and tool-driven responses. This approach ensures user data privacy by handling all language model processing directly on the device.

Does FoundationModels on-device support custom domain tool invocation?

Yes, FoundationModels supports custom domain tool invocation through defined Tool components and Arguments schemas. This allows your on-device language model to trigger specific app functionalities based on conversational user prompts.