Apple Foundation Models SDK for Python
Python bindings for Apple's Foundation Models framework, providing on-device inference access to the Apple Intelligence system model on macOS.
At a Glance
Free and open-source under Apache License 2.0. Install via pip.
Engagement
Available On
Listed Jun 2026
About Apple Foundation Models SDK for Python
The Foundation Models SDK for Python is an open-source library published by Apple that exposes Python bindings for Apple's Foundation Models framework — the on-device language model powering Apple Intelligence on macOS. It is licensed under Apache 2.0 and hosted at the official Apple GitHub organization. The SDK targets developers who want to evaluate, test, or build Python-based tooling around the same on-device model used in Swift apps.
What It Is
This SDK is a developer library that bridges Python and Apple's native Foundation Models framework. Rather than calling a remote API, all inference runs locally on the device using the system foundation model built into macOS 26.0+. The library is designed for two primary audiences: developers building Apple Intelligence features in Swift who want to run batch evaluation and quality analysis from Python, and Python developers who want to experiment with on-device LLM inference without sending data to a cloud service.
Core Capabilities
The SDK exposes several key primitives directly from the Foundation Models framework:
- On-device inference via
SystemLanguageModel— no network call required - Streaming text generation for real-time response output
- Guided generation using Python decorators (
@fm.generable) to constrain model output to typed Python classes - Type-safe structured output with field-level constraints (e.g.,
fm.guide("Age in years", range=(0, 20))) - Transcript processing — import and analyze transcripts exported from Swift apps for quality evaluation
- Custom model settings for configuring different model options per session
System Requirements and Setup
The SDK has strict platform requirements reflecting its dependency on Apple's on-device model stack:
- macOS 26.0 or later
- Xcode 26.0+ installed with the Xcode and Apple SDKs agreement accepted
- Python 3.10 or later
- Apple Intelligence enabled on a compatible Mac
Installation is via pip (pip install apple-fm-sdk). A development install path using uv is also documented in the README for contributors who need to modify the SDK or build from source.
Update: v0.2.0 — Image Attachment Support
The latest release, v0.2.0 (published June 8, 2026), adds support for images in prompts via an Attachment type. The repository was created in February 2026 and has seen active development since, with the most recent push on June 8, 2026. The project README notes that external contributions are not yet being accepted, signaling it is still in an early, Apple-controlled release phase.
Why It Matters
On-device inference via a system-provided model removes the need for API keys, network connectivity, or data leaving the device — a meaningful differentiator for privacy-sensitive workflows. By wrapping the same model used in Swift-based Apple Intelligence features, the SDK also enables Python-based evaluation pipelines that can directly measure the quality of production app behavior. Apple's README links to its own guidance on safe generative AI design, indicating the SDK is positioned as a responsible-AI-aware developer tool.
Community Discussions
Be the first to start a conversation about Apple Foundation Models SDK for Python
Share your experience with Apple Foundation Models SDK for Python, ask questions, or help others learn from your insights.
Pricing
Open Source
Free and open-source under Apache License 2.0. Install via pip.
- On-device inference
- Streaming text generation
- Guided generation
- Structured output with Python decorators
- Transcript processing
Capabilities
Key Features
- On-device inference with Apple Intelligence system model
- Streaming real-time text generation
- Guided generation with structured output schemas
- Type-safe responses using Python decorators
- Custom model settings and configuration
- Transcript processing from Swift app exports
- Batch inference for evaluating Swift Foundation Models app features
- Async API with asyncio support
