DEV Community

Amaresh Pelleti
Amaresh Pelleti

Posted on Originally published at devtoolhub.com

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

Originally published on DevToolHub.

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. 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

Is the Private Cloud Compute model available?

Not on this build. Apple's session shows fm respond --model pcc, but on macOS 27.0.1 it fails:

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

What is the context window of the fm CLI?

About 4,096 tokens, shared by prompt and reply. Inputs up to 4,001 counted tokens worked; 4,031 failed with The session's transcript exceeded the model's context size. The 8,192 figure in some articles doesn't match this test.

How do you run fm serve as a local API?

fm serve --port 1976
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."}]}'
Enter fullscreen mode Exit fullscreen mode

The model id is always system. The server streams by default, so set "stream": false explicitly. I found no auth option, so keep it on localhost.

Can the fm CLI return structured JSON?

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}
Enter fullscreen mode Exit fullscreen mode

How does it compare to Ollama?

About 21 tokens per second through fm serve, versus 20.9 for llama3.2 (3B) on Ollama, one run each. Use fm for zero-install scripting and Ollama when you need a bigger model or long context.

It also answered "today's date" with October 27, 2024, and wrote a find -exec wc -l command that prints per-file counts instead of a total. Check anything it produces.

Read the full version with the comparison table and FAQ on DevToolHub.

Top comments (0)