Recently, I upgraded my Mac from macOS Tahoe to the new macOS 27. While exploring what’s new, I went through some of Apple’s developer videos at https://developer.apple.com/macos/whats-new/ and came across the new fm command-line tool.
With fm, we can interact with Apple Foundation Models directly from the command line, making it possible to experiment with prompts, have conversations with the model, and even use it as part of scripts and automation.
Getting Started:
I started by simply typing fm in my Terminal, expecting to see what the new command could do.
Instead, I was greeted with a message asking me to accept the Apple Foundation Models CLI Legal Notice & Terms.
MacBook-Air ~ % fm
YOU HAVE NOT AGREED TO THE APPLE FOUNDATION MODELS CLI LEGAL NOTICE & TERMS.
Agreeing to the Apple Foundation Models CLI Legal Notice & Terms applies to every user on the machine, so it must be run as a privileged user (e.g. 'sudo fm license').
I ran the sudo fm license command as suggested.
The system first asked for my Mac password and then displayed the Apple Foundation Models CLI Legal Notice & Terms. I entered y, and the Terminal confirmed my acceptance.
MacBook-Air ~ % sudo fm license
Password:
YOU HAVE NOT AGREED TO THE APPLE FOUNDATION MODELS CLI LEGAL NOTICE & TERMS.
YOU MUST AGREE TO THE TERMS BELOW IN ORDER TO USE APPLE FOUNDATION MODELS CLI.
LEGAL NOTICE & TERMS
PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE APPLE FOUNDATION MODELS CLI. BY
USING THE APPLE FOUNDATION MODELS CLI, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF
THE APPLICABLE SOFTWARE LICENSE AGREEMENT FOR macOS AT
https://www.apple.com/legal/sla/. YOU ARE ALSO AGREEING TO NOT PROGRAMMATICALLY
ACCESS OR USE APPLE MODELS THROUGH APPLE SOFTWARE OR SERVICES EXCEPT AS EXPRESSLY
PERMITTED. IF YOU DO NOT AGREE TO THESE TERMS, DO NOT USE THE APPLE FOUNDATION
MODELS CLI.
DO YOU AGREE TO THESE TERMS? ANY RESPONSE OTHER THAN 'yes' OR 'y' WILL DISAGREE AND EXIT. [yes, no]
y
You have agreed to these terms.
I typed fm in the Terminal again. Terminal gave the available commands, the model available on my Mac, and a few examples.

Exploring Commands
- Checking Model Availability
I started with the available command: fm available
The CLI returned: System model available. This confirmed that the on-device Apple Foundation Model was available on my Mac and ready to be used.
- Checking the License Status
Next, I tried the license command: fm license. CLI displayed the legal notice again and confirmed: You have already agreed to these terms.

- Checking token count and using respond command to ask a single question. I used following prompt for both fm count-tokens and fm respond command
Review this Python function and identify potential problems: def divide(a, b): return a / b Suggest improvements.
Following was the output observed. The model identified several potential issues, including division by zero and lack of input validation, and suggested ways to improve the function. It also generated sample Python code for the suggested changes. Same prompt contained 28 tokens, according to fm count-tokens. This shows that he on-device model can understand code and provide useful suggestions

- Trying the Interactive Chat
I started it with a simple instruction telling the model to behave as a coding assistant:
fm chat --instructions "You are a coding assistant"
This opened an interactive Apple Foundation Models Chat session directly in the Terminal.
I started with a simple request: “I want to write a program to calculate average of a list of numbers.”
The model responded with a Python example and explained how to use it.What I found interesting was that this wasn’t just a simple prompt-and-response interface. The chat session also provides several built-in commands for managing the conversation, such as /clear for starting a new session, /save and /resume for saving and continuing sessions, /model for switching models, and /instructions for changing the instructions.It also displayed token usage for the current conversation:

- Starting a local Chat completion API server
fm serve starts a local HTTP server that exposes Apple's Foundation Model through an API. The server listens on 127.0.0.1:1976, which means it is accessible only from my Mac.

I opened another terminal and checked health , models and chat completion api. Following was the output

Also in parent terminal i was able to see tokens consumed and status for each api call

- Using fm schema to generate a structured output with fm respond command
First i generated the schema using following command. This creates a schema where both name and age are required.
fm schema object --name Person --string name --int age > person.json
Then i tested whether i get infomation in required schema with fm respond command
fm respond --schema person.json \
"My name is Rahul and I am 35 years old. Return my details."
fm respond --schema person.json \
"Extract the person's name and age from this information: Amit is 42 years old."
fm respond --schema person.json \
"John is a software engineer. He lives in Pune."

The first two tests produced the expected structured responses. I then intentionally provided incomplete information and omitted the person’s age. Interestingly, the model still returned an age value of 30.
This was a useful reminder that structured output and factual grounding are two different things. The schema defines the required shape of the response, but it doesn’t by itself mean that every value was present in, or derived reliably from, the input.
Further Reading
Discover more articles on similar topics across our network
Cornell and Yale: Nine of Ten Models Bypass Wallet Spending Caps via Email OTP
Cornell Tech and Yale tests on Circle agent wallets found nine of ten frontier models raised their own spending limits using emailed OTPs; five paid an impersonator while summarizing inbox mail.
Comments
Loading comments…