How to Call Claude 4.5 via Apple Foundation Models Framework
Learn how to integrate Claude 4.5 into your Swift applications using Apple's new Foundation Models framework for hybrid on-device and cloud processing.
Anthropic’s new integration for Claude in the Foundation Models framework allows developers to invoke Claude 4.5 directly from Swift applications. Introduced alongside Apple’s WWDC 2026 announcements for iOS 20, macOS 17, and visionOS 3, the integration enables hybrid processing that balances local execution on Apple silicon with secure cloud routing. You can handle summarization, semantic search, and UI generation natively without importing third-party networking libraries.
Setup requires no external SDK installations. You initialize the provider by adding import FoundationModels to your Swift project. This native integration treats Claude as an OS-level model provider, sharing the exact same system efficiency as Apple’s first-party intelligence models.
Hybrid Execution and Hardware Targets
The framework implements a hybrid on-device and cloud execution model. Claude 4.5 Haiku can run partially on-device for low-latency tasks on M4 and M5 hardware. Anthropic reports an on-device latency of 12ms per token when running on M5 Max hardware. This enables highly responsive AI inference for simple text interactions directly on the user’s machine.
For complex reasoning tasks, the framework routes requests to Anthropic’s Private Cloud Compute clusters. This routing relies on a new Secure Handover protocol. The protocol keeps user data encrypted and inaccessible to Anthropic, verifying through independent auditors that payloads are wiped after execution. It requires explicit user permission before processing any payload off-device. Ensure your application handles denial states gracefully when users decline cloud processing.
Managing Memory and Context
Mobile applications face strict memory constraints when handling large context windows. The framework supports the full 200,000-token context window of the Claude 4.5 family through a new Streaming Context API. This API mitigates memory spikes by streaming context into the model rather than loading massive text blocks into mobile memory all at once.
Developers passing source code or structured data to the model benefit from the Swift Context feature. When Claude analyzes Xcode projects or SwiftData structures, Swift Context automatically reduces token usage by 30 percent, keeping requests well within memory limits and reducing latency.
System Requirements and Limitations
| Feature | Claude 4.5 Haiku | Claude 4.5 |
|---|---|---|
| Execution Layer | Hybrid (On-device M4/M5 + Cloud) | Cloud Only |
| Max Context | 200,000 tokens | 200,000 tokens |
| Data Privacy | Secure Handover Protocol | Secure Handover (PCC) |
The integration is currently in developer beta starting June 8, 2026. General availability is scheduled for the public release of iOS 20 in September 2026. Older hardware without the M4 or A19 Pro chips will route requests entirely to the cloud, bypassing the on-device execution layer.
Begin testing your application’s offline behavior using the beta SDK. Structure your fallback logic to handle the user permission prompts triggered by the Secure Handover protocol before attempting complex reasoning tasks.
Get Insanely Good at AI
The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.
Keep Reading
AFM 3 Core Powers Apple's Native Bill-Splitting Camera Tool
Apple is adding a 20-billion parameter multimodal model to iOS 27, allowing the native Camera app to scan receipts and process Apple Cash split payments.
How to build an iOS app with Claude Code subagents
Learn how to orchestrate parallel subagents in Claude Code to build and ship a production Swift application using natural language and specialized roles.
Liquid AI's LFM2.5-24B-A2B Runs Full Agent Harnesses On-Device, 3 Times the Next-Best on AutomationBench
Liquid AI released LFM2.5-24B-A2B on October 13: a 24B-parameter MoE with 2B active, scoring 27.69 on AutomationBench versus the next-best model's 8.72, running agent harnesses entirely on-device on an M5 Max with no cloud calls.
Whistle: Speech-to-Text in 16.9 MB, Faster Than Whisper at 8.6 Times Smaller
Cactus Compute released Whistle on October 2, a 16.9MB open speech recognition model covering seven languages with word timestamps, that beats Whisper base on most benchmarks while decoding at 1,319 tokens per second on an Apple M4 Pro CPU.
Mozilla Partners With Mistral to Bring Private, Open AI to Firefox
Mozilla and Mistral AI announced a partnership bringing open, private, multilingual AI to Firefox's Smart Window, positioning the browser as a local-first alternative to cloud-controlled assistants.