foundation-models

Integrate Apple's FoundationModels framework for on-device LLM capabilities in Swift applications.

1|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/makgunay/claude-swift-skills --skill foundation-models-makgunay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models
Source: https://github.com/makgunay/claude-swift-skills/tree/main/foundation-models
Command: npx skills add https://github.com/makgunay/claude-swift-skills --skill foundation-models-makgunay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to integrate Apple's on-device Large Language Models (LLMs) directly into their applications, offering powerful AI features with enhanced privacy and offline capabilities.

Core Features & Use Cases

  • On-Device AI: Leverage Apple Intelligence for text generation without relying on cloud services.
  • Structured Output: Use the @Generable macro to receive AI-generated content in predefined Swift data structures.
  • Tool Calling: Extend LLM capabilities by defining custom tools that the model can invoke.
  • Use Case: Build an app that can summarize user-provided text, generate creative writing prompts, or answer questions based on local data, all while keeping user data private on the device.

Quick Start

Use the foundation-models skill to check if Apple Intelligence is available on the device.

Frequently Asked Questions about foundation-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate on-device LLM capabilities into a Swift application?

On-device LLM integration is achieved by leveraging Apple's FoundationModels framework to manage sessions, handle prompt engineering, and stream text generation directly within Swift applications.

Does the FoundationModels framework support structured data generation?

Structured data generation is supported using the @Generable and @Guide macros, which map AI-generated text directly into predefined Swift data structures for reliable parsing.

Can I implement custom tool calling with Apple Intelligence on-device AI?

Custom tool calling is supported by implementing the Tool protocol, allowing the on-device language model to invoke specific application functions and extend its capabilities dynamically.

How do I check if Apple Intelligence is available on a user's device?

Checking Apple Intelligence availability involves using system language model availability checks before initializing a session, ensuring the device supports the required on-device AI features.

What is the best way to stream LLM responses in SwiftUI with FoundationModels?

Streaming LLM responses is handled using snapshot streaming with PartiallyGenerated types, providing incremental text updates that integrate smoothly with SwiftUI state management.