今天,我们通过一个新的 Swift 包发布了 Claude 对 Foundation Models 框架的支持,让 Apple 开发者可以使用 Apple 的 Foundation Models 框架调用 Claude,以处理更复杂的工作流。

Apple 的 Foundation Models 框架让开发者能够以原生方式从 Swift 中调用模型。它非常易于使用,并且通过引导式生成,只需三行代码即可返回带类型的 Swift 值。开发者可以利用它调用 Apple 的设备端模型,快速完成本地任务,例如摘要或信息提取。
开发者现在可以使用 Apple 的 Foundation Models 框架,在请求需要多步推理、代码生成等能力时,将任务交给 Claude 处理。Claude 还可以搜索网络以获取最新信息,并执行代码进行数据分析。将 Claude 的响应流式传回同一个视图即可。
由于 Apple 的框架会从 @Generable 注解返回类型化的 Swift 值,开发者调用 Claude API 时拿到的是干净的输入,而非原始的用户文本。
这解锁了什么
Foundation Models 框架已经为一系列智能的端侧功能提供支持——呈现个性化提示词的日记应用、总结合同的文件应用、按学生水平讲解概念的学习应用。加入 Claude 后,上述每一种模式都得到了扩展。

一个日记应用可以在设备端生成每日提示,然后让 Claude 在数月的条目中找出线索。一个学习应用可以在设备端定义一个术语,当学生追问“为什么这对我们学过的其他所有内容都很重要?”时,再交给 Claude 处理。
对用户来说这是一次完整体验,而每一步都由合适的模型提供支持。
快速上手
通过 Foundation Models 框架提供的 Claude 支持将于明天上线,它通过 Apple 的 Foundation Models 框架在 iOS 27、iPadOS 27、macOS 27、visionOS 27 和 watch OS 27 上运行。
将其添加到你的项目中,使用 Anthropic API key 登录,并将 Apple 设备端处理输出的类型化结果传入 Claude 请求——该软件包会处理流式传输、工具调用,并将结构化响应返回给你的 SwiftUI 视图。
Today we're releasing Foundation Models framework support for Claude through a new Swift package that lets Apple developers use Apple's Foundation Models framework to call Claude for more complex workflows.

Apple’s Foundation Models framework gives developers access to tap into models natively from Swift. It is very easy to use and can return typed Swift values through guided generation in as few as three lines of code. Developers can use this to tap into Apple’s on-device models for fast, local tasks like summarization or extraction.
Developers can now use Apple’s Foundation Models framework to hand off to Claude when a request calls for multi-step reasoning, code generation, and more. Claude can also search the web for current information and execute code for data analysis. Stream Claude's response back into the same view.
Because Apple's framework returns typed Swift values from @Generable annotations, developers arrive at the Claude API call with clean inputs instead of raw user text.
What this unlocks
The Foundation Models framework already powers a range of intelligent on-device features — journaling apps that surface personalized prompts, document apps that summarize contracts, learning apps that explain a concept at a student's level. Adding Claude extends each of those patterns.

A journaling app can generate daily prompts on-device, then ask Claude to find threads across months of entries. A study app can define a term on-device, then hand off to Claude when the student follows up with "why does this matter for everything else we've covered?"
It's one experience for the user, backed by the right model for each step.
Getting started
Claude support with the Foundation Models framework will be available tomorrow and works through Apple's Foundation Models framework on iOS 27, iPadOS 27, macOS 27, and visionOS 27, and watch OS 27. Add it to your project, sign in with an Anthropic API key, and pass typed outputs from Apple's on-device pass into a Claude request — the package handles streaming, tool calls, and structured responses back into your SwiftUI view.