foundation-models-ref

Community

Master Apple's on-device AI, from @Generable to Tools.

AuthorCharlesWiltgen
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides a complete reference to Apple's Foundation Models framework, clarifying its unique APIs, capabilities, and best practices. It helps developers implement on-device AI features, understand structured output, integrate tools, and manage streaming effectively.

Core Features & Use Cases

  • Complete API Reference: Detailed guide covering LanguageModelSession, @Generable, @Guide, Tool protocol, streaming, and dynamic schemas with all WWDC 2025 code examples.
  • Performance & Error Handling: Strategies for prewarming sessions, managing context window limits, and handling generation errors like exceededContextWindowSize and guardrailViolation.
  • Tool Protocol Integration: Explains how to enable the model to autonomously execute custom code for external data (e.g., WeatherKit, MapKit, Contacts).
  • Use Case: When you need to implement structured output from the on-device model, use this skill to understand how the @Generable macro works with constrained decoding to guarantee type-safe Swift objects.

Quick Start

To create a basic LanguageModelSession, import FoundationModels and initialize with let session = LanguageModelSession().

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: foundation-models-ref
Download link: https://github.com/CharlesWiltgen/Axiom/archive/main.zip#foundation-models-ref

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository