将最新的 Gemini 模型带给苹果开发者

内容总结:
苹果全球开发者大会(WWDC)本周开幕,谷歌宣布向苹果开发者开放最新Gemini模型接入权限。开发者现在可通过Foundation Models框架安全调用云端Gemini模型,并在Xcode中直接使用。这意味着苹果开发者能够无缝集成Gemini模型,为用户打造动态体验,同时提升自身开发效率。
Foundation Models框架直连Gemini模型
在WWDC上,苹果宣布向第三方云端模型提供商开放其Foundation Models框架。自iOS 27、macOS 27、iPadOS 27、visionOS 27及watchOS 27起,模型提供商可实施新的公共LanguageModel协议,提供统一的模型推理接口。谷歌已通过Firebase苹果SDK,将Gemini模型接入该框架。
这带来了完全原生化的开发体验:云端Gemini模型可通过同一应用程序接口(API)直接嵌入Foundation Models框架。这意味着苹果本地模型与云端Gemini模型共享同一API界面,开发者可根据使用场景轻松切换本地推理与云端推理。这种灵活性在优化智能代理应用体验的同时,能最大程度降低成本和延迟。
该集成基于Firebase(谷歌云客户端应用开发平台)与Firebase AI Logic。后者是一款生产级服务,能让开发者将最新Gemini模型直接集成到iOS、macOS、iPadOS及visionOS应用中,无需搭建和维护独立后端服务器。此外,通过使用Firebase App Check,访问Gemini模型等服务API将免受滥用侵害。
若开发者已在使用苹果Foundation Models框架,切换到Gemini模型仅需一行代码修改:替换模型实例。该集成将于明日作为预览版发布。在此期间,开发者可进一步了解Firebase AI Logic。
Xcode原生支持智能代理工作流
谷歌与苹果合作,将Gemini集成到Xcode中,使开发者无需切换工具或窗口,即可在开发过程中执行复杂的多步骤任务。
开发者可通过Xcode中的“智能设置”面板开始使用。配置完成后,Gemini将提供智能代理体验,协助开发者审查代码、修复Bug并更快构建新功能。
工作区身份认证
为支持个人与企业开发者工作流程,谷歌提供了两种认证配置方案:
- 个人开发者:从Google AI Studio获取自助式Gemini API密钥。该平台提供免费入门层及针对高级模型和高流量的付费层。
- 企业开发者:使用Gemini企业代理平台获取API密钥,使开发团队能够利用组织专用的企业配额及数据隐私参数。
在苹果平台开始使用Gemini模型
通过Foundation Models框架与Xcode的无缝集成,开发者可利用Gemini模型轻松构建、保护并扩展下一代智能代理AI应用。谷歌表示,期待看到开发者的创意成果。
中文翻译:
将最新的Gemini模型带给苹果开发者
苹果全球开发者大会(WWDC)本周拉开帷幕,我们很高兴地宣布:苹果开发者现在可以使用Foundation Models框架安全地调用云端托管的Gemini模型,并在Xcode中访问Gemini。这一消息让苹果开发者能够无缝接入Gemini模型,从而为最终用户提供动态体验,同时提升自身的开发效率。
直接从Foundation Models框架调用Gemini模型
在WWDC上,苹果宣布向第三方云模型提供商开放其Foundation Models框架。从iOS 27、macOS 27、iPadOS 27、visionOS 27以及watchOS 27开始,模型提供商可以实现新的公共LanguageModel协议,为模型推理提供统一接口。我们已通过Firebase Apple SDK将Gemini模型引入Foundation Models框架。
这带来了完全原生的开发体验——云端托管的Gemini模型可以直接通过相同的API接入Foundation Models框架。这意味着苹果本地模型和云端托管的Gemini模型共享同一套API接口,因此您可以轻松在本地推理与云端推理之间切换,以适应不同使用场景。这种灵活性对于实现最佳代理型应用体验至关重要,同时还能降低成本和减少延迟。
该集成利用了Firebase——谷歌云的客户端应用开发平台。它基于Firebase AI Logic,这是一款生产级服务,让您无需构建和维护单独的后端服务器,即可将最新的Gemini模型直接集成到iOS、macOS、iPadOS和visionOS应用中。此外,通过使用Firebase App Check,您的服务API(例如用于访问Gemini模型的API)将免遭滥用。
如果您已经在使用苹果的Foundation Models框架,那么切换到Gemini模型只需更改少量代码:替换模型实例即可。
此集成将从明天起以预览版形式推出。同时,欢迎进一步了解Firebase AI Logic。
在Xcode中原生使用代理型工作流
我们与苹果合作,将Gemini集成到Xcode中,让您在开发过程中无需切换工具或窗口即可执行复杂的多步骤任务。
要开始使用,请通过Xcode中的智能设置面板进行配置。配置完成后,Gemini将提供代理型体验,帮助您更快地审查代码、修复漏洞以及构建新功能。
验证工作区
为了同时支持个人和企业开发者的工作流程,您可以根据使用场景配置身份验证:
- 个人开发者:直接从Google AI Studio获取自助式Gemini API密钥。该平台既提供免费层级供入门使用,也提供付费层级以获得更高级的模型和更高的调用量。
- 企业开发者:使用Gemini Enterprise Agent Platform获取API密钥,这使开发团队能够利用其组织专享的企业配额和数据隐私参数。
在苹果平台上开始使用Gemini模型
凭借与苹果Foundation Models框架及Xcode的无缝集成,您可以使用Gemini模型轻松构建、保护并扩展下一代代理型AI体验。我们期待看到您的成果。
英文来源:
Bringing the latest Gemini models to Apple developers
Apple’s Worldwide Developers Conference (WWDC) kicked off this week, and we’re excited to share that Apple developers can now securely call cloud-hosted Gemini models using the Foundation Models framework, and access Gemini in Xcode. This announcement gives Apple developers seamless access to Gemini models to deliver dynamic experiences for their end users and increase their own development velocity.
Call Gemini models directly from the Foundation Models framework
At WWDC, Apple announced that it's opening its Foundation Models framework to third-party cloud model providers. Starting with iOS 27, macOS 27, iPadOS 27, visionOS 27 and watchOS 27, model providers can implement the new public LanguageModel protocol to provide a common interface for model inference. We've made Gemini models available to the Foundation Models framework through the Firebase Apple SDK.
This provides a fully native development experience — cloud-hosted Gemini models can plug directly into the Foundation Models framework using the same API. That means the on-device Apple model and cloud-hosted Gemini models sit behind a shared API surface, so you can easily swap between local and cloud inference to fit your use case. This flexibility is crucial for enabling optimal agentic app experiences while minimizing costs and reducing latency.
This integration leverages Firebase, Google Cloud's client apps development platform. It's based on Firebase AI Logic, a production-grade service that lets you integrate the latest Gemini models directly into your iOS, macOS, iPadOS and visionOS apps without needing to build and maintain a separate backend server. Plus, by using Firebase App Check, your service APIs, like those used to access Gemini models, are protected from abuse.
If you're already using Apple's Foundation Models framework, switching to Gemini models is a small code change: swap the model instance.
This integration will be available as a preview release starting tomorrow. In the meantime, learn more about Firebase AI Logic.
Use agentic workflows natively in Xcode
We worked with Apple to integrate Gemini into Xcode so you can perform complex, multi-step tasks during development without switching tools or windows.
To get started, onboard through the Intelligence settings panel in Xcode. Once configured, Gemini provides an agentic experience, helping you review code, fix bugs and build new features faster.
Authenticate your workspace
To support both individual and enterprise developer workflows, you can configure authentication based on your use case:
- Individual developers: Obtain a self-serve Gemini API key directly from Google AI Studio, which features both a free tier for getting started and a paid tier for more advanced models and higher volumes.
- Enterprise developers: Use Gemini Enterprise Agent Platform to obtain an API key, which enables development teams to leverage their organization’s guaranteed dedicated corporate quotas and data privacy parameters.
Get started with Gemini models on Apple platforms
With seamless integration across Apple's Foundation Models framework and Xcode, you can effortlessly build, secure and scale next-generation, agentic AI experiences using Gemini models. We can’t wait to see what you build.