Getting Started#
Note
Swift Equivalent: This guide covers installation and setup for the Python SDK. For Swift development, see the Foundation Models framework documentation.
Get started with the Foundation Models SDK for Python.
Prerequisites#
Before you begin, ensure you have:
Compatible Hardware: macOS 26.0+ on compatible Mac that supports Apple Intelligence
Xcode Installed: Xcode 26.0+ or later with command line tools installed. Tip: Make sure your Xcode version matches your macOS version to avoid model compatibility issues.
Python Environment: Python 3.10 or later installed
Apple Intelligence: Turned on for your device (see Apple’s support page)
Installation#
Step 1: Install#
Foundation Models SDK for Python is currently in Beta. Install using the development installation instruction below.
Step 2: Verify Installation#
Verify the installation:
import apple_fm_sdk as fm
# Check if the model is available
model = fm.SystemLanguageModel()
is_available, reason = model.is_available()
if is_available:
print("Foundation Models SDK is ready!")
else:
print(f"Foundation Models not available: {reason}")
Development Installation#
If you need to modify the SDK, install from source:
Step 1: Clone the Repository#
git clone https://github.com/apple/python-apple-fm-sdk
cd python-apple-fm-sdk
Step 2: Create a Virtual Environment (Recommended)#
Using uv (recommended):
uv venv
source .venv/bin/activate
Step 3: Install in Editable Mode#
uv sync
uv pip install -e .
This will install the package in editable mode along with all dependencies.
Step 4: Verify Changes#
After making any change, be sure to build the project again and test:
uv pip install -e .
pytest
All tests can be found in the tests/ directory.
Common Installation Issues#
Model Not Available#
If you see “Foundation Models not available”, check:
Your device supports Apple Intelligence
Apple Intelligence is turned on in System Settings
You’re running a compatible OS version (macOS 26.0+)
Verify that your Xcode version matches your macOS version exactly.
Next Steps#
See examples on the git repository under examples/ for more usage patterns.