foundation-models-on-device

Integrate Apple's FoundationModels framework for on-device LLM text generation in iOS 26+.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to integrate powerful on-device Large Language Models (LLMs) into their iOS applications, ensuring privacy and offline functionality.

Core Features & Use Cases

  • On-Device Text Generation: Generate and summarize text directly on the user's device.
  • Structured Data Output: Use @Generable to get LLM output in defined Swift types.
  • Tool Calling: Allow the model to execute custom code for domain-specific actions.
  • Real-time Streaming: Stream partially generated responses for dynamic UI updates.
  • Privacy-Preserving AI: All processing happens locally, keeping user data secure.

Quick Start

Use the foundation-models-on-device skill to generate a response to the prompt "What's a good month to visit Paris?".

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 LLM text generation in iOS?

On-device LLM text generation in iOS uses Apple's FoundationModels framework to process prompts and stream text locally, preserving user privacy and enabling offline functionality.

Can I get structured Swift data output from an on-device LLM?

Structured Swift data output from an on-device LLM is achieved by using the `@Generable` attribute, which maps generated text directly into defined Swift types.

Does the on-device LLM support tool calling for custom iOS functions?

Yes, the on-device LLM supports tool calling for custom iOS functions, allowing the model to execute domain-specific code and actions based on user prompts.

What iOS version is required for Apple Intelligence FoundationModels?

Apple Intelligence FoundationModels requires iOS 26 or later to access on-device LLM capabilities including text generation, tool calling, and snapshot streaming.

How do I stream partial LLM responses for dynamic iOS UI updates?

You can stream partial LLM responses for dynamic iOS UI updates by utilizing the snapshot streaming feature within the FoundationModels framework to display text as it generates.

Why use an on-device LLM instead of a cloud-based generative AI model?

Using an on-device LLM ensures privacy-preserving AI by keeping all processing local, which secures user data and enables offline functionality without relying on cloud servers.