Back to Skills

axiom-foundation-models-ref

verified

Reference — Complete Foundation Models framework guide covering LanguageModelSession, @Generable, @Guide, Tool protocol, streaming, dynamic schemas, built-in use cases, and all WWDC 2025 code examples

View on GitHub

Marketplace

axiom-marketplace

CharlesWiltgen/Axiom

Plugin

axiom

Repository

CharlesWiltgen/Axiom
289stars

.claude-plugin/plugins/axiom/skills/axiom-foundation-models-ref/SKILL.md

Last Verified

January 16, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/CharlesWiltgen/Axiom/blob/main/.claude-plugin/plugins/axiom/skills/axiom-foundation-models-ref/SKILL.md -a claude-code --skill axiom-foundation-models-ref

Installation paths:

Claude
.claude/skills/axiom-foundation-models-ref/
Powered by add-skill CLI

Instructions

# Foundation Models Framework — Complete API Reference

## Overview

The Foundation Models framework provides access to Apple's on-device Large Language Model (3 billion parameters, 2-bit quantized) with a Swift API. This reference covers every API, all WWDC 2025 code examples, and comprehensive implementation patterns.

### Model Specifications

**Technical Details**:
- **Parameters**: 3 billion (3B)
- **Quantization**: 2-bit
- **Context Window**: 4096 tokens (combined input + output)
- **Supported Languages**: English + additional languages via `SystemLanguageModel.default.supportedLanguages`
- **Platforms**: iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+

**Optimized For**:
- Text summarization
- Information extraction
- Content classification
- Content generation
- Tag generation
- Entity detection

**NOT Optimized For**:
- World knowledge queries
- Complex multi-step reasoning
- Mathematical computation
- Translation (use dedicated translation models)

**Privacy & Performance**:
- Runs entirely on-device
- No network required (works offline)
- Data never leaves device
- No per-request costs
- Integrated into OS (doesn't increase app size)

---

## When to Use This Reference

Use this reference when:
- Implementing Foundation Models features
- Understanding API capabilities
- Looking up specific code examples
- Planning architecture with Foundation Models
- Migrating from prototype to production
- Debugging implementation issues

**Related Skills**:
- `axiom-foundation-models` — Discipline skill with anti-patterns, pressure scenarios, decision trees
- `axiom-foundation-models-diag` — Diagnostic skill for troubleshooting issues

---

## LanguageModelSession

### Overview

`LanguageModelSession` is the core class for interacting with the model. It maintains conversation history (transcript), handles multi-turn interactions, and manages model state.

### Creating a Session

**Basic Creation**:
```swift
import FoundationModels

let session = LanguageModelSession

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
31921 chars