AI/TLDR

Anthropic · 2026-06-08 · major

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

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.

GitHub repository card for anthropics/ClaudeForFoundationModels
GitHub / Anthropic

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

Key specs

Version0.1.0
LicenseApache-2.0
PlatformsiOS 27, iPadOS 27, macOS 27, visionOS 27, watchOS 27
Github repoanthropics/ClaudeForFoundationModels

What is it?

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 does it work?

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 does it matter?

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 is it for?

iOS / macOS / visionOS developers, indie Swift app builders

Try it

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

Sources · 3 outlets

Tags

  • anthropic
  • claude
  • swift
  • swift-package-manager
  • apple
  • foundation-models-framework
  • language-model-protocol
  • wwdc-2026
  • ios-27
  • macos-27
  • ipados-27
  • watchos-27
  • visionos-27
  • structured-output
  • tool-use

← All releases · Learn AI