HeadlinesBriefing favicon HeadlinesBriefing.com

Anthropic Brings Claude to Apple's Foundation Models Framework

Hacker News •
×

Anthropic released Claude for Foundation Models, a Swift package that integrates the Claude API into Apple's on-device AI framework. The package conforms to the `LanguageModel` protocol, letting developers swap between Apple's native model and Claude using the same `LanguageModelSession` API. Both streaming responses and tool calling work identically across either backend.

Requests route directly from apps to Anthropic's servers without Apple intermediation, with billing handled through existing Claude API accounts. The package targets iOS 27, macOS 27, and related beta OS releases that support server-side language models. Developers install via Swift Package Manager and authenticate using API keys for development or proxy endpoints for production deployments.

Apple's on-device model excels at fast, private tasks offline, but developers can escalate to Claude for larger context windows, advanced reasoning, or server-side tools like web search and code execution. Since both models share the same session interface, switching requires only changing the model parameter passed to each session.

The package exposes structured output through `@Generable` annotations and supports five effort levels for reasoning intensity. Server tools run within Anthropic's infrastructure during single round trips, eliminating device-side invocation overhead for web search and code execution features.