Ai Engineering 3 min read

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

FeatureClaude 4.5 HaikuClaude 4.5
Execution LayerHybrid (On-device M4/M5 + Cloud)Cloud Only
Max Context200,000 tokens200,000 tokens
Data PrivacySecure Handover ProtocolSecure 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

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