axiom-foundation-models-ref

Document the on-device Foundation Models API for iOS, macOS, and iPadOS.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/foxtrottwist/ClaudeAgentConfig --skill axiom-foundation-models-ref
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axiom-foundation-models-ref
Source: https://github.com/foxtrottwist/ClaudeAgentConfig/tree/main/xcode-agent/skills/axiom-foundation-models-ref
Command: npx skills add https://github.com/foxtrottwist/ClaudeAgentConfig --skill axiom-foundation-models-ref

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This reference provides a complete on-device Foundation Models API guide and WWDC 2025 code examples for LanguageModelSession, @Generable, Tool protocol, streaming, and dynamic schemas to accelerate building offline AI features.

Core Features & Use Cases

  • Comprehensive API reference for LanguageModelSession, SystemLanguageModel, @Generable, and Tool protocol
  • Guidance on streaming, dynamic schemas, constrained decoding, and performance profiling
  • Real WWDC 2025 code examples to accelerate production-ready implementations across iOS, macOS, and iPadOS

Quick Start

Initialize a LanguageModelSession and experiment with respond(to:generating:) to generate a typed result using @Generable.

Frequently Asked Questions about axiom-foundation-models-ref

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

FAQPage Schema
How do I generate structured outputs from on-device foundation models in iOS?

To generate structured outputs from on-device foundation models, initialize a LanguageModelSession and use the respond(to:generating:) method with the @Generable macro to produce typed results directly within your iOS app.

What is the Tool protocol used for in Apple's Foundation Models API?

The Tool protocol in the Foundation Models API defines structured interfaces that allow a LanguageModelSession to interact with external functions, enabling on-device models to execute specific actions and fetch dynamic data during generation.

Does the Foundation Models API support constrained decoding and dynamic schemas for on-device AI?

Yes, the Foundation Models API supports constrained decoding and dynamic schemas, allowing developers to enforce specific output structures and adapt generation logic dynamically during a LanguageModelSession on iOS and macOS.

How do I stream responses from an on-device language model session?

You can stream responses from a LanguageModelSession by utilizing the built-in streaming capabilities provided by the Foundation Models API, which delivers generated tokens incrementally for real-time UI updates in iOS applications.

What are the performance considerations when using Generable types with on-device AI?

Performance considerations for Generable types include profiling schema complexity and managing constrained decoding overhead, ensuring the on-device LanguageModelSession maintains responsive generation times across iOS, macOS, and iPadOS deployments.

Can I use SystemLanguageModel to check on-device foundation model availability before starting a session?

Yes, SystemLanguageModel provides the interface to verify on-device foundation model availability and capabilities, ensuring your iOS app safely initializes a LanguageModelSession only when the underlying generable hardware and software support are present.