# Anthropic Ships ClaudeForFoundationModels — Apache-2.0 Swift Package Implements Apple's LanguageModel Protocol So iOS 27, macOS 27, iPadOS 27, watchOS 27, and visionOS 27 Apps Can Swap Apple's On-Device AFM Core for Claude With One SPM Dependency, Streaming, @Generable Output, Web Search, and Code Execution All Wired In

> Same Swift API as Apple's on-device model — point the SPM dependency at Anthropic's package and it is Claude under the hood.

- Org: Anthropic
- Date: 2026-06-08
- Category: tool, ecosystem
- Source: https://claude.com/blog/claude-for-foundation-models
- Canonical page: https://ai-tldr.dev/releases/anthropic-claude-for-foundation-models/

## In short

Anthropic's official Swift package implements the same LanguageModel protocol Apple shipped at WWDC 2026 — so an app prototyped against AFM Core can swap in Claude Sonnet 4.6, with streaming, @Generable typed output, server-side web search, and code execution, by editing one Swift Package Manager dependency.

## What it is

ClaudeForFoundationModels is Anthropic's official Swift Package Manager dependency that implements the same LanguageModel protocol Apple shipped at WWDC 2026 for its on-device Apple Foundation Models (AFM Core, AFM Core Advanced, AFM Cloud). It lets a developer prototype a journaling, study, or document app against Apple's on-device 3B AFM Core, then upgrade to Claude Sonnet 4.6 by changing one SPM dependency, with no edits to the LanguageModelSession code.

## How it works

Developers add the package to Package.swift, construct a ClaudeLanguageModel with a model identifier (e.g. .sonnet4_6) and either an Anthropic API key or a proxied production auth mode, then plug it into a standard LanguageModelSession. session.respond(to:), session.streamResponse(to:), @Generable typed Swift outputs, configurable effort levels, and Anthropic-hosted server-side tools — web search, web fetch, and code execution — are all exposed through Apple's native session API. Errors flow through a ClaudeError pattern. Source is Apache-2.0 at github.com/anthropics/ClaudeForFoundationModels with the v0.1.0 release published. The package targets iOS 27, iPadOS 27, macOS 27, visionOS 27, and watchOS 27 betas, shipping alongside Xcode 27 beta on June 9.

## Why it matters

This is the first instance of Apple's pluggable LanguageModel protocol implemented by a frontier lab outside Apple, and it lands the day after WWDC 2026 unveiled the framework. Indie iOS, macOS, and visionOS developers can stay on the on-device model for cheap, offline cases and graduate to Claude for multi-step reasoning, code generation, or queries that need web search — without rewriting the session loop. The shared protocol also opens the door for users to pick a cloud provider per app instead of being routed automatically.

## Who it's for

iOS / macOS / visionOS developers, indie Swift app builders

## Try it

.package(url: "https://github.com/anthropics/ClaudeForFoundationModels.git", from: "0.1.0")

## Links

- [Anthropic Blog](https://claude.com/blog/claude-for-foundation-models)
- [GitHub Repo](https://github.com/anthropics/ClaudeForFoundationModels)
- [Releases](https://github.com/anthropics/ClaudeForFoundationModels/releases)
- [Apple FM Docs](https://developer.apple.com/documentation/FoundationModels)
