The short version
- fm comes pre-installed with macOS 27. Type
fmin Terminal to list its commands, such asrespond,chatandschema(Apple). - By default it uses the on-device model that comes with macOS.
--model pccsends a prompt to Apple's much bigger Private Cloud Compute model instead, which has usage limits. - The on-device model needs a Mac that supports Apple Intelligence (M1 or later). Apple Intelligence takes up to 14 GB of storage on Macs with M3 or later and 12 GB of memory or more, and up to 8 GB on the others (Apple).
- Its context window is small: 4,096 tokens in Apple's documentation, 8,192 in a WWDC26 code sample. For long documents or harder tasks, an open model on your Mac's GPU goes further: see what your Mac can run.
1What fm is
fm is Apple's command line tool for Apple Foundation Models, the models behind Apple Intelligence. "Starting from macOS 27, this command line tool comes pre-installed on your Mac," Apple says in its WWDC26 session on it; you open Terminal and type fm (Apple). Apple pitches it for scripting and automation "without writing a line of app code" (Apple).
It can talk to two models. By default it uses "the on-device model that comes with macOS, and that's always available". It can also use the Apple Foundation Model on Private Cloud Compute, which Apple calls "a much bigger model than the on-device model" that "will perform better on complex problems" and "has usage limits" (Apple). The on-device model runs on your Mac and works without an internet connection (Apple); a prompt sent to Private Cloud Compute goes to Apple's servers.
fm is Apple's software and has nothing to do with MLX Network. MLX Network is independent and not affiliated with Apple.
2The commands
These are the commands and options Apple shows in its WWDC26 sessions (Apple, Apple):
| Command or option | What it does |
|---|---|
fm | Lists the commands that are available. |
fm respond "…" | Prompts the model and prints its response, for scripts and one-off questions. |
fm chat | An interactive conversation in Terminal. Inside it, /model switches to the Private Cloud Compute model and /save saves the conversation to resume later. |
fm schema object | Creates a schema, so fm respond returns structured JSON. |
--model pcc | Sends the prompt to the Private Cloud Compute model instead of the on-device one. |
--image | Adds an image to the prompt. |
--schema | Makes the answer follow a schema made with fm schema object. |
--instructions | Gives the model instructions separate from the prompt. |
--help | Shows every option. |
fm alone lists them on your Mac.Apple's own examples, from the session:
fm respond "Provide a basic regex in Swift to parse an email address"
fm respond "Provide a comprehensive regex in Swift to parse an email address" --model pcc
fm schema object --name AppsIdentified --string app_names --array > schema.json
fm respond "What apps are the user actively using in this screenshot?" \
--image Screenshot.png --model pcc --schema schema.json
# {"app_names": ["Messages", "Mail", "Calendar"]}
fm respond --helpfm serve, fm available and fm license. Apple's WWDC26 sessions and the Foundation Models documentation we read don't describe them, so this guide doesn't either. Run fm on your Mac to see what your version has.3What you need, and how much it downloads
- macOS 27. fm comes with it (Apple).
- A Mac that supports Apple Intelligence. Apple Foundation Models need one (Apple); on macOS 27 that's any Mac with M1 or later (Apple).
- A supported language. Apple Intelligence needs the device language and Siri language set to the same supported language, and it doesn't currently work on devices bought in mainland China (Apple).
- Free disk space for Apple Intelligence, below.
| Mac | Apple Intelligence storage on macOS 27 |
|---|---|
| M3 or later with at least 12 GB of unified memory | Up to 14 GB |
| Other Macs with Apple Intelligence (M1, M2, or less than 12 GB of memory) | Up to 8 GB |
The model can be unavailable for a while after you turn Apple Intelligence on: Apple's framework reports it as not ready "because it's downloading or because of other system reasons" (Apple).
For the Python SDK, which uses the same on-device model, Apple lists macOS 26.0 or later, Xcode 26.0 or later with its agreement accepted, and Python 3.10 or later (Apple), on an Apple silicon Mac (Apple).
4What the on-device model is good at, and where it stops
Apple is plain about it: "On-device models excel at a diverse range of text generation tasks, like summarization, entity extraction, text and image understanding, refinement, dialog for games, generating creative content, and more. When you need more reasoning capabilities and context size, use Private Cloud Compute or any server model provider" (Apple).
- A small context window. Apple's documentation gives the on-device model "a context window of 4096 tokens per session" (Apple) and lists 4K against 32K for Private Cloud Compute (Apple). In its WWDC26 session on macOS 27, Apple's code sample prints a
contextSizeof 8,192 (Apple). The prompt, the instructions and the answer all share that window. - What that holds. In English a token is typically three to four characters (Apple), so 8,192 tokens is roughly 25,000 to 33,000 characters in and out together: a few pages, not a book or a codebase.
- Short, simple prompts. "An on-device model has fewer parameters and a small context window," so Apple asks for prompts that are "short and succinct", and says on-device models "have limited reasoning abilities": break a hard task into steps (Apple).
- It changes with macOS. Apple updates the model in OS updates; macOS 27 has a new version (Apple). A script's results can shift after an update.
Apple doesn't give the on-device model's size on these pages, so we don't either.
5Using fm from scripts and code
fm respond prints the answer, so it drops into any shell script. With --schema the answer is JSON you can pass to jq. Apple's session sorts a project folder this way: it asks the model which files are final and which are drafts, then copies and moves them. Shortened from Apple's sample (Apple):
fm schema object --name "TriagedFileList" \
--string 'final_files' --array \
--string 'draft_files' --array > /tmp/schema.json
output=$(fm respond \
--instructions "Return the latest files, then separately all draft files." \
"This is the list of all files:\n\n${files_list}" \
--schema /tmp/schema.json
)
echo "${output}" | jq -r '.draft_files[]'For Python there's Apple's Foundation Models SDK, pip install apple_fm_sdk, with the same on-device model, guided generation and tool calling (Apple). Apple's example:
import apple_fm_sdk as fm
model = fm.SystemLanguageModel()
is_available, reason = model.is_available()
if is_available:
session = fm.LanguageModelSession(model=model)
response = await session.respond(prompt="Hello!")
print(response)Many apps and coding agents expect an OpenAI- or Anthropic-style API on a local port instead. If that's what you need, mlx_lm.server serves an open model of your choice on an OpenAI-style API at localhost:8080 (mlx-lm), and LM Studio's local server speaks the OpenAI and Anthropic formats (LM Studio). More options: the best apps to run LLMs on a Mac.
6When to switch to an open model
Stay with fm for short jobs: summarising a note, naming a file, pulling fields out of text, a quick question. It's already on the Mac and needs no setup. Reach for an open model when the input won't fit in a few thousand tokens, when the task needs more reasoning or code, when you want to pick the model, or when a tool needs an API.
An open model runs on your Mac's GPU, and what fits is set by unified memory. Our Compare arithmetic gives the GPU about 75% of it by default and leaves room for the context:
| Mac memory | For the GPU | Runs well, for example | Memory it needs |
|---|---|---|---|
| 8 GB | about 6 GB | Llama 3.1 8B at 4-bit | 4.5 GB, 6.0 GB with context |
| 16 GB | about 12 GB | Llama 3.1 8B at 8-bit, Qwen3.5 9B at 6-bit | 8.5 GB and 7.3 GB, 10.0 and 8.8 GB with context |
| 24 GB | about 18 GB | gpt-oss-20b, native 4.25-bit | 13.8 GB, 15.3 GB with context |
| 32 GB | about 24 GB | Qwen3.6 35B A3B at 4-bit | 19.7 GB, 21.3 GB with context |
These models list much longer context windows on their model cards, 128K tokens for Llama 3.1 8B and 262,144 for Qwen3.6 35B A3B, though a long context needs memory beyond the room counted above. Not sure what your Mac has? Apple menu, About This Mac, then see Macs by chip.
mlx-lm is one way to run them: Apple's own MLX tools download MLX models from Hugging Face, chat with them in Terminal and serve the local API above. LM Studio and Ollama do the same in an app (the best apps to run LLMs on a Mac). When you're not using the Mac, MLX Node can run AI jobs for MLX Network within the limits you set and earns MLX Tokens for verified work. MLX Tokens can lose value; read the risks.
7Questions
- Is the macOS fm command free?
- It comes pre-installed with macOS 27 and by default uses the on-device model that comes with macOS. The bigger Private Cloud Compute model has usage limits (Apple).
- Does fm work offline?
- With the on-device model, yes: Apple says it works without an internet connection (Apple). Apple Intelligence has to be downloaded first, and
--model pccor/modelinfm chatuse Apple's servers. - How long a prompt can fm take?
- Prompt, instructions and answer share one context window: 4,096 tokens in Apple's documentation and 8,192 in Apple's WWDC26 sample for macOS 27 (Apple). In English that's roughly three to four characters a token.
- Does fm serve an OpenAI-compatible API?
- Apple's WWDC26 sessions and the Foundation Models documentation we read don't describe a server mode, so we can't confirm how one works. For a documented local API,
mlx_lm.serverserves open models at localhost:8080 in the OpenAI style, and LM Studio in the OpenAI and Anthropic formats. - Which Macs can use fm?
- Macs on macOS 27 that support Apple Intelligence: any Mac with M1 or later, set to a supported language, with up to 14 GB (M3 or later with 12 GB or more) or up to 8 GB of free storage (Apple).
Sources
- Appledeveloper.apple.com
- Applesupport.apple.com
- Appledeveloper.apple.com
- Appledeveloper.apple.com
- Appledeveloper.apple.com
- Appledeveloper.apple.com
- Applegithub.com
- Appledeveloper.apple.com
- Appledeveloper.apple.com
- Appledeveloper.apple.com
- mlx-lmgithub.com
- LM Studiolmstudio.ai
- Llama 3.1 8Bhuggingface.co
- Qwen3.6 35B A3Bhuggingface.co
- mlx-lmgithub.com