macOS 27 fm CLI: What Apple’s Built-In Model Can Do

macOS 27 fm CLI running Apple's on-device model in a terminal

The macOS 27 fm CLI gives every Mac a free language model in the terminal. It needs no account, no API key and no download, and you can point any OpenAI-style client at it. It also has a hard 4,096-token limit and a few rough edges, and several articles describing it get the details wrong.

I ran it on macOS 27.0.1 and measured what it does.

What is the macOS 27 fm CLI?

The fm command is a binary at /usr/bin/fm that talks to Apple’s on-device foundation model, the same model behind Apple Intelligence. Apple announced it at WWDC26, so it isn’t hidden. In Apple’s WWDC26 session on the Foundation Models framework, Apple says the tool “comes pre-installed with macOS 27” and is meant for testing prompts and for automation.

Run fm available first. On my Mac it printed System model available, and that was the whole setup.

Command What it does
fm respond One prompt in, one answer out. Reads stdin too
fm chat Interactive session, saved under ~/.fm/sessions/
fm count-tokens Counts tokens in a prompt
fm schema Generates a JSON schema for structured output
fm serve Starts a local Chat Completions API server
fm available Checks whether the model is ready

Is the Private Cloud Compute model available in the fm CLI?

Not on this build. Apple’s session shows fm respond --model pcc for the larger Private Cloud Compute model, and says fm chat can switch to it with /model. On macOS 27.0.1 the command fails:

fm respond --model pcc 'hi'
# Error: The value 'pcc' is invalid for '--model <model>'. Please provide one of 'system'.

The man page and --help list one model, system. Other hands-on write-ups report the same thing. Scripts that depend on --model pcc will break today, so don’t write them yet. I can’t tell whether a later 27.x update turns it on.

What is the context window of the fm CLI?

The usable limit is 4,096 tokens, shared between your prompt and the reply. Some articles claim 8,192, and my test doesn’t support that. Apple’s session doesn’t state a number either.

I fed fm respond growing inputs, measured with fm count-tokens:

Input size (counted tokens) Result
3,941 OK
4,001 OK
4,031 Error: The session's transcript exceeded the model's context size.
5,041 and up Same error

The boundary sits between 4,001 and 4,031 tokens of input. That matches a 4,096 ceiling once you add the instruction line and a short reply. In practice you can send roughly 3,000 words of English, and a reply eats into that.

⚠️ Note: the error is a hard failure, not a truncation. The model never sees an oversized prompt, so chunk long files before you send them. Run fm count-tokens in the same script to decide where to split.

How do you run the macOS 27 fm CLI as a local API?

fm serve starts an HTTP server that speaks the OpenAI Chat Completions format, so existing clients work with a changed base URL. It exposes GET /health, GET /v1/models and POST /v1/chat/completions.

fm serve --port 1976

In another terminal:

curl -s localhost:1976/v1/models
# {"object":"list","data":[{"owned_by":"Apple","created":...,"object":"model","id":"system"}]}

curl -s localhost:1976/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"system","stream":false,"messages":[{"role":"user","content":"Say hi in 3 words."}]}'

The model id is always system. With "stream":false you get a normal response including a usage block with prompt and completion token counts.

Here’s the gotcha. When I left stream out, the server streamed server-sent events anyway. OpenAI’s own API defaults to non-streaming, so a client that expects one JSON body will choke. Set "stream": false explicitly if you parse the response yourself.

⚠️ Note: --host 0.0.0.0 binds to every interface. I didn’t find an authentication option in fm serve --help, so anyone on your network could use the endpoint. Keep it on localhost or a Unix socket with --socket /tmp/fm.sock. If you run Ollama the same way, our Ollama API guide covers the equivalent setup.

Can the fm CLI return structured JSON?

Yes, and this is the most useful part. fm schema builds a JSON schema from flags, and fm respond --schema forces the answer to match it:

fm schema object --name Person --string name --int age > person.json
fm respond --schema person.json 'Extract: Maria is 34 years old and lives in Lisbon.' --no-stream
# {"name": "Maria", "age": 34}

It dropped the city, because the schema had no field for it. That is what you want from extraction. The call finished in under a second on my machine. If you pipe LLM output into jq or a script, this beats parsing prose. The same reasoning is behind our piece on YAML vs JSON for LLMs.

What else can the fm CLI do?

A few options are worth knowing, all of which I ran:

  • --image photo.png sends an image with the prompt. I gave it a generated invoice and it read back INVOICE 4821 and TOTAL: $129.50.
  • --tool ocr (or --tool barcode) enables a built-in tool. With OCR on, “Extract the invoice number and total” returned a clean sentence with both values.
  • --save-transcript t.json and --resume t.json carry a conversation across separate commands. I told it my name in one call and it remembered it in the next.
  • --use-case content-tagging and --guardrails permissive-content-transformations change how the system model behaves.

How does the macOS 27 fm CLI compare to Ollama?

On one 150-word prompt, speed was a tie. Through fm serve I got 157 completion tokens in about 7.5 seconds, roughly 21 tokens per second. Ollama with llama3.2 (3B) reported 20.9 tokens per second for the same prompt. Both numbers are one run on one Mac, so treat them as “same ballpark,” not a benchmark.

Factor fm (macOS 27) Ollama
Setup None, ships with the OS Install, then ollama pull a model
Model choice One (system) Hundreds
Context window 4,096 tokens Depends on model and settings
Platform macOS 27 on Apple Silicon macOS, Linux, Windows
API OpenAI-style, no auth option OpenAI-style, plus native API
Cost Free Free (cloud plans optional)

Use fm when you want a zero-install helper in a shell script: tagging, extraction, short summaries. Use Ollama when you need a bigger model, long documents, or the same setup on a Linux server. See Ollama vs LM Studio for the other desktop options, and Ollama hardware requirements if you’re sizing a machine.

Where does the on-device model go wrong?

It is a small model, and it shows. Two failures from my tests:

fm respond "What is today's date?"
# Today's date is October 27, 2024.

The real date was October 21, 2026. The model has no clock, so it guesses. Pass the date in your instructions if it matters.

fm respond 'Write a one-line shell command to count lines in all .py files recursively.'
# find . -name "*.py" -exec wc -l {} \;

That command prints one count per file and never a total, so it answers a different question. Anything that touches files or money needs a human check. A plain-English explainer on what an LLM actually is covers why small models state wrong answers so calmly.

Frequently Asked Questions

Q: Does the macOS 27 fm CLI need an internet connection or an account?
A: No. The system model runs on your Mac, and fm available reports it ready with no sign-in or API key. Apple’s macOS 27 release overview lists the new AI tooling, and the Private Cloud Compute option is documented but was rejected on macOS 27.0.1.

Q: What is the token limit of the fm CLI?
A: About 4,096 tokens, shared by the prompt and the reply. Inputs up to 4,001 counted tokens worked in my tests, and 4,031 failed with a context-size error.

Q: Can I use fm with OpenAI-compatible tools?
A: Yes. Run fm serve, then point the client at http://localhost:1976/v1 and use the model id system. Set "stream": false explicitly, because the server streams by default.

Q: Does fm work on Intel Macs?
A: I only tested Apple Silicon. Apple’s session says the Python SDK requires an Apple Silicon Mac, and I didn’t verify the CLI elsewhere.

Quick Summary:
– /usr/bin/fm ships with macOS 27 and runs Apple’s on-device model with no setup.
– The context limit is about 4,096 tokens in total, not 8,192.
– --model pcc is documented by Apple but rejected on 27.0.1; only system works.
– fm serve exposes an OpenAI-style API with no auth, and it streams unless you set "stream": false.
– fm schema plus --schema gives reliable structured JSON, the best use of the tool.
– Speed matched a 3B Ollama model, but it got the date and a shell command wrong.

Run fm available on your Mac, then put the macOS 27 fm CLI to work: try the fm schema example on a real text file from your own work.

Related guides

Leave a Reply