AI & DevelopmentDeveloper Tools

Apple LanguageModel Protocol: Add Claude or Gemini to iOS 27 Apps

Apple iOS 27 LanguageModel protocol diagram showing Swift code connected to multiple AI providers including Claude and Gemini
Apple's new LanguageModel protocol in iOS 27 enables seamless provider switching between on-device models, Claude, and Gemini

Apple shipped the LanguageModel protocol at WWDC 2026 and ended one of the most persistent frustrations in iOS AI development: maintaining separate, incompatible SDKs for every model you want to support. As of iOS 27, Apple’s on-device model, Private Cloud Compute, Claude, and Gemini all plug into the same LanguageModelSession API. Swap one Swift Package Manager dependency and your app routes to a different model. Session logic untouched. Streaming code untouched. Tool calls untouched.

What the LanguageModel Protocol Actually Is

The LanguageModel protocol is a public Swift interface built into Foundation Models, available from iOS 27, macOS 27, iPadOS 27, watchOS 27, and visionOS 27. It standardizes how any language model — local or remote — presents itself to LanguageModelSession. There are two types you care about as a consumer:

  • LanguageModel — Declares the model’s capabilities and provides a Configuration the framework uses to set up inference.
  • LanguageModelExecutor — Handles the work: prewarming resources, translating Transcript entries to the provider’s native format, applying context and generation options, and streaming responses.

As a developer using a provider package, you never implement these yourself. You pass the model to a session and the framework handles the rest. Think of it like URLSession abstracting HTTP — you don’t implement TCP, you configure a session and make requests. Apple’s WWDC26 session 241 covers what changed in the on-device model alongside this protocol.

Adding Claude to Your iOS 27 App

Anthropic published a Swift package the same day Apple announced the protocol. The setup takes two steps.

In Xcode, add the Swift package dependency:

https://github.com/anthropics/ClaudeForFoundationModels.git

Version 0.1.0 or later. Then update your session initialization:

import FoundationModels
import ClaudeForFoundationModels

// Before: on-device
let session = LanguageModelSession(
    model: SystemLanguageModel.default,
    instructions: "You are a helpful assistant."
)

// After: Claude — nothing below this line changes
let session = LanguageModelSession(
    model: ClaudeLanguageModel.default,
    instructions: "You are a helpful assistant."
)

let response = try await session.respond(to: "Summarize this document.")

One important detail: requests go directly from your app to the Anthropic API. Apple is not in the request path and does not see your prompts or responses. You need an Anthropic API key and you are billed at standard Claude API rates. Full setup details are in Anthropic’s announcement.

Adding Gemini via Firebase

Google coordinated its launch with Apple’s announcement. Gemini is available through the Firebase Apple SDK (v12.5.0 or later) via the Firebase AI Logic library. If you already use Firebase, update your dependency version. If not, add firebase-ios-sdk through SPM and include the AI Logic module. The GeminiLanguageModel conforms to the same LanguageModel protocol — same session API, same respond calls. Google’s Firebase AI Logic get started guide covers the full configuration, including API key setup and model selection.

Which Model to Use and When

Now that all models are one dependency away, you need a routing heuristic:

ModelPrivacyCostBest For
SystemLanguageModelOn-deviceFreePersonal data, quick tasks
Private Cloud ComputeApple’s cloudFree (<2M downloads)Heavier tasks, no billing setup
ClaudeLanguageModelAnthropic APIPay-per-tokenComplex reasoning, long context
GeminiLanguageModelGoogle APIPay-per-tokenMultimodal, complex reasoning

The default rule: anything touching personal data stays on-device. Complex document analysis or reasoning-heavy tasks go to cloud. Private Cloud Compute is a useful middle ground — Apple’s infrastructure, more capable than on-device, free for developers with fewer than two million first-time App Store downloads.

What This Changes Architecturally

Before this protocol, model choice was a compile-time SDK decision that restructured your entire session management layer. Now it’s a runtime configuration. That unlocks patterns that were previously painful:

  • A/B testing models — Pass different providers based on a feature flag.
  • Fallback routing — Fall back to on-device if the cloud provider is unavailable or returns an error.
  • Task-type routing — Use on-device for autocomplete, cloud for document summarization, within the same app.

Apple also open-sourced CoreAILanguageModel and MLXLanguageModel reference implementations, meaning third parties can now ship local model runners — not just cloud providers — through the same protocol. Combined with MLX’s new Metal 4 support, this positions Apple devices as a serious local AI compute platform beyond just the built-in system model.

Where to Go From Here

Apple’s WWDC26 session Bring an LLM provider to the Foundation Models framework (session 339) covers the full protocol implementation — essential if you’re building a provider package rather than just consuming one. Session 241 covers on-device model improvements and the new Dynamic Profiles system for multi-agent routing.

Google’s coordinated launch post is on the Google Developers Blog. The protocol ships with iOS 27, currently in developer beta. If you’re building AI features into an iOS app, the time to prototype with multiple providers is now — before you lock into a single SDK integration that becomes expensive to change later.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *