This page may contain stale information. Last updated: 2026-06-12
Definition
The LanguageModel protocol is a public Swift interface in Apple’s Foundation Models framework (iOS 27 / macOS 27) that decouples application session logic from specific AI providers. Any conforming model — Apple on-device, Private Cloud Compute, core-ai, MLX community models, Claude, or Gemini — can back a LanguageModelSession without code changes beyond swapping a Swift Package Manager dependency.
Protocol Components
| Type | Role |
|---|---|
LanguageModel | Declares capabilities, provides executor configuration |
LanguageModelExecutor | Prewarms resources, streams generation via respond() |
Supported Providers (WWDC 2026)
- Apple: System on-device model, Private Cloud Compute
- Anthropic: Swift package implementing protocol for Claude
- Google: Gemini via Firebase Apple SDK
- Community: MLX models from Hugging Face, custom Core AI models
Developer Impact
Developers prototype with Apple’s free on-device model, then route complex queries to cloud providers by changing one dependency line. Session logic, tool calls, and context management remain unchanged — eliminating vendor lock-in at the application layer.
Third-party cloud models (Claude, Gemini) carry per-token API costs unlike free on-device inference. Small Business Program developers get free Private Cloud Compute under 2M first-time downloads.