← back

Apple Intelligence on the command line

Apple Intelligence isn’t just a suite of system-wide writing tools or a smarter Siri. For developers, it’s an on-device Foundation Models framework that we can hook into using Python.

The python-apple-fm-sdk 1 provides a bridge to the ~3B parameter language model running on your Mac’s Neural Engine. It is entirely offline and requires no API keys.

What it can be used for

Because the model is local, it excels at high-volume, low-latency tasks where sending data to the cloud is either too slow, too expensive, or a privacy risk.

How to use it

The SDK is currently in beta and requires an Apple Silicon Mac running macOS 15.0+ with Xcode 16 installed 3.

Implementation is centered around the LanguageModelSession. It is strictly asynchronous:

import apple_fm_sdk as fm
import asyncio

async def classify_text(text):
    model = fm.SystemLanguageModel()
    if not model.is_available(): return "Unavailable"

    session = fm.LanguageModelSession()
    prompt = f"Is this SPAM or HAM? {text}"
    
    response = await session.respond(prompt)
    return str(response).strip()

Common gotchas

Working with on-device models is different from calling the OpenAI or Claude APIs. Here is what I’ve encountered:

Value

On-device AI changes the economics of software. When inference is free and private, you can apply “intelligent” logic to mundane tasks—like cleaning a mailbox or deduplicating photos—that were previously too small to justify a cloud API bill.

  1. python-apple-fm-sdk - The official Python interface for Apple’s Foundation Models. 

  2. On-Device Scene Analysis - Apple’s research into using local models for utility content detection. 

  3. Apple Intelligence for Developers - Documentation on hardware requirements and framework adoption.