Running Foundation Model on Your Mac From Command Line

Posted on Sep 29, 2026
Running Foundation Model on Your Mac From Command Line

Apple’s big macOS 27 “Golden Gate” pitch is Siri AI, a new LLM-powered Siri that now sits at the centre of Spotlight. But tucked underneath it is something more interesting for those of us who live in the terminal: the same family of Apple Foundation Models that power Siri can be reached with a single command, fm, with no API key, no account and no download.

In this post we’ll look at what these foundation models actually are, what your Mac needs to run them, and how to use them from the command line.

Foundation Models

The Foundation Models framework isn’t new. Apple introduced it at WWDC25 so developers could call the on-device model from Swift in macOS 26. What changed with macOS 27, which shipped on 14 September 2026, is that the models themselves got a big upgrade, and Apple finally gave us a terminal front door to them.

Apple calls this the third generation of Apple Foundation Models (AFM). It is a family of five models built in collaboration with Google, split into two groups:

  • On-device (two models):
    • AFM 3 Core is a 3-billion-parameter dense model.
    • AFM 3 Core Advanced is a 20-billion-parameter sparse model. It keeps its weights in flash storage and only activates 1 to 4 billion parameters per request, which is how Apple squeezes it into a laptop’s memory budget.
  • Cloud on Private Cloud Compute (three models): AFM 3 Cloud, AFM 3 Cloud Pro and ADM 3 Cloud for images.

What does your Mac need?

Which on-device model you get depends on your hardware. Community and press reports say AFM 3 Core Advanced is reserved for Macs with an M3 chip or newer and at least 12GB of memory, while other Apple silicon Macs get the smaller model. macOS 27 itself is Apple silicon only, so Intel Macs are out.

Storage is the other cost. Apple says the new Apple Intelligence features need up to 14GB on the higher-end Macs and up to 8GB on the rest. MacRumors measured more than 20GB on an M4 Pro Mac mini, and noted that macOS 27 no longer lets you switch Apple Intelligence off, so the model download isn’t optional.

On-device first, cloud when you ask

The on-device model is always the default. For heavier jobs there is the cloud tier, which Apple says runs on Private Cloud Compute (PCC) with usage limits. In the fm tool, Apple’s WWDC session describes the PCC model as much bigger than the on-device one, so it performs better on complex problems. You opt in explicitly rather than being switched over silently.

What the model can’t see

A foundation model on its own is just text in, text out. It can’t look at your drive, so it can’t tell you how much free space you have or what’s in your Downloads folder. The built-in tools in fm are limited to things like ocr and barcode, and anything else has to be handed to it, for example by piping in the output of df -h. Developers can add their own tools through the Swift framework or the Python SDK.

That limitation is a feature, and it matters more than it sounds. Desktop AI agents are the ones that get broad access, and that has been in the news. In September, Inc. columnist Jason Aten reported that Meta’s Muse agent read his Mac Messages even though he had declined access, which Meta disputes. Separately, a YouTuber said Muse handed his home address to a Marketplace buyer. In response, Apple said it will add new controls around macOS’s Full Disk Access permission so that granting it takes very explicit user action. Apple hasn’t said exactly how that will work, and the change is about informed consent rather than a hard new limit.

Running it in Terminal

fm comes pre-installed with macOS 27, living at /usr/bin/fm. You’ll need Apple Intelligence turned on and its model downloaded first.

  1. Open Terminal and type fm to see the list of commands.
  2. Accept Apple’s terms. Until you do, the tool refuses to run. Community tooling documents the step as sudo fm license, and you can check it with fm license --status.
  3. Ask something: fm respond "Explain what a symlink is in two sentences".
  4. Or start a conversation with fm chat, and press Ctrl + D to leave.

Inside fm chat you get a couple of slash commands. /model switches the conversation to the PCC model and /save stores the session so you can resume it later.

A few fm respond options are worth knowing from day one:

  • --model pcc sends the prompt to the bigger cloud model.
  • --image <file> adds an image to the prompt.
  • -i sets system instructions, and --text passes in extra input such as a file’s contents.
  • fm count-tokens checks how big a prompt is before you send it.

Keep the context window in mind. One write-up puts the on-device window at 8,192 tokens, and community testers report 4,096 on Macs that fall back to the smaller model. Either way, long documents need chunking.

One more caveat on PCC. Apple’s session demos --model pcc, but at least one hands-on tester running the 27.0 release build found only the on-device model listed. Whether you see it may depend on your OS point release and region, so run fm available to check what your machine offers.

Extending the Use

Structured output

Chatting is fine, but the more useful trick is getting the model to answer in a fixed shape. You define a schema with fm schema object, then feed it to fm respond --schema:

fm schema object --name Triage \
  --string summary --description 'One-sentence summary' \
  --boolean action_required --description 'Needs a human' > triage.json

fm respond --no-stream --schema triage.json \
  -i 'Summarize the document.' \
  --text "$(cat notes.txt)"

The output is JSON, so it slots straight into jq and shell scripts. Apple’s own demo uses exactly this pattern to sort a messy project folder into “final” and “draft” files and move them automatically. It is also what you’d use for summaries or for agent orchestration, where one step needs to hand clean data to the next.

One warning from security testing of the tool: a schema controls the shape of an answer, not its truth. A document containing hidden instructions can still steer the content of the summary. Treat anything you pipe in as untrusted, and keep a human in the loop for decisions that matter.

Running it as an API server

fm serve turns the model into a local HTTP service. It exposes /health, /v1/models and an OpenAI-style /v1/chat/completions, so existing OpenAI-compatible clients can talk to it. By default it listens on 127.0.0.1:1976:

fm serve &
curl http://127.0.0.1:1976/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"system","messages":[{"role":"user","content":"ping"}],"stream":false}'

A few things to know before you build on it:

  • There is no authentication. Any local process can call it. The --socket option, which uses a Unix socket inside a private directory, is safer on shared machines. Avoid binding to 0.0.0.0 unless you really mean to expose it to your network.
  • Streaming is on by default, so pass "stream": false if your client expects a single JSON response.
  • Tool calling is limited. Community proxies report patchy tool-call schema support and broken token-usage reporting on the 27.0 beta.
  • Read the licence. The terms you accept with fm license restrict programmatic use of Apple’s models except where Apple expressly permits it. Check them before wiring fm serve into anything you plan to ship.

Python

If you prefer scripting in Python, Apple also released a Foundation Models SDK. It needs Python 3.10 or newer, Xcode and an Apple silicon Mac, and installs with pip install apple_fm_sdk. It mirrors the Swift API, including tool calling and guided generation.

Conclusion

The foundation model isn’t the most powerful model you can run. It has a small context window, closed weights and, on the bigger setups, a hefty storage bill. But it is lightweight, convenient, private and runs on-device, and having it one keystroke away from your shell is basically what Apple intended.

What I’d still like is the freedom to point fm at my own model. Apple is heading in that direction on the developer side: the Foundation Models framework is being opened up to other providers, including Claude and Gemini, and is planned to go open source. I haven’t seen the fm command expose that yet, so for now it’s Apple’s models only. It’s a good start, and I’ll be watching what the next point releases bring.

Sources

Love this? Consider buying me a coffee!