foundation-models

Installation
SKILL.md

Foundation Models

Apple's on-device LLM that powers Apple Intelligence, accessed through the FoundationModels framework (iOS 26+). The deep API reference — availability, text generation, guided generation, the @Generable/@Guide macros, tool calling, streaming, sessions, error handling, guardrails, SwiftUI integration — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. OUTPUT — freeform (default; respond(to:) returns a String for chat/prose) · guided-@Generable (pass generating: T.self; model emits a type-safe Swift struct/enum — use this for anything your code parses).
  2. STREAMING — off (default; one await for the full result) · on (streamResponse(...) yields partials as they generate — use for any response long enough that a user would wait).
  3. TOOLS — none (default; model answers from its own knowledge) · tool-calling (pass tools: so the model can call your code for live/private data it can't know).

When to use

Building or reviewing any feature that runs Apple's on-device model: chat, summarization, classification, structured extraction, or tool-augmented generation. Use this when the work is local/private/offline inference with no server. For server-class models (large context, complex multi-step reasoning, latest world knowledge) Foundation Models is the wrong tool — route to a hosted API instead.

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
foundation-models — moritztucher/swift-agent-skills