| FM(1) | General Commands Manual | FM(1) |
fm — command-line
interface for Apple Foundation Models
fm |
[-h] command
[options] |
fm is a command-line interface for Apple Foundation Models. It generates responses from Apple's on-device and Private Cloud Compute language models, counts tokens, generates JSON generation schemas, checks model availability and quota usage, and hosts a Chat Completions API server.
By default every command uses the on-device system model. Pass --model pcc to run against the Apple Foundation Model on Private Cloud Compute instead.
Run 'fm <command> --help' for detailed help on an individual command.
fm schema object generates a JSON generation schema for an object type. Each --string, --integer, --double, or --boolean starts a new property; follow it with --description, --optional, and/or --array to annotate it. Use dot notation (a.b) in property names to nest objects.
fm schema object --help documents the full property-declaration syntax.
The first time you run fm you must agree to the Apple Foundation Models CLI Legal Notice & Terms. fm displays them and asks whether you agree; answer 'yes' or 'y' to agree. Any other response disagrees and fm exits with status 69 without running the command.
fm license is the one command that is never gated, since it is how you review the terms and agree to them.
Agreeing applies to every user on the machine, so it must be run as a privileged user: run 'sudo fm license'.
Run 'sudo fm license' to review and agree, 'fm license --show' to print the terms without being prompted, and 'fm license --status' to report whether the machine has agreed.
Generate a response with the on-device model:
fm respond 'What is Swift?'
Stream a response from Private Cloud Compute:
fm respond --model pcc --stream 'Summarize this article'
Start an interactive chat with custom instructions:
fm chat --instructions 'You are a coding assistant'
Count the tokens in a prompt:
fm count-tokens 'Hello world'
Generate a JSON schema for an object type:
fm schema object --name Person --string name --int age
Foundation Models framework documentation: https://developer.apple.com/documentation/foundationmodels
| June 8, 2026 | Darwin |