Interactive terminal chat for Apple's built-in Foundation Model on macOS.
This repo currently includes:
fm.py: a Python CLI entry point built onapple_fm_sdkSources/fm/fm.swift: the original SwiftPM implementation
- macOS 26 or later
- Xcode 26 / Swift 6.3 toolchain
- Python 3
- A Mac that supports Apple Intelligence
- Apple Intelligence enabled and the on-device model downloaded
Install the Python dependency:
python3 -m pip install apple_fm_sdkRun locally:
python3 fm.pyYou can also inspect the CLI without starting the REPL:
python3 fm.py --help
python3 fm.py --versionYou will enter an interactive REPL backed by FoundationModels.
cd /path/to/fm
swift buildIf the project was moved to a new path and SwiftPM reports module cache errors, clear local build artifacts and rebuild:
rm -rf .build
swift buildswift runInstall the stable release from the Homebrew tap:
brew tap kosminus/fm
brew install fmThen run:
fmYou can also verify the install non-interactively:
fm --help
fm --versionTo install the latest development version from main instead:
brew install --HEAD fmNotes:
- The tap repository is
https://github.com/kosminus/homebrew-fm. - The source repository is
https://github.com/kosminus/fm. - Users still need macOS 26+, Xcode 26, and Apple Intelligence support on their Mac.
:helpshows available commands:resetstarts a fresh chat session:quitexits the app:exitexits the app
fm.py: Python CLI implementationPackage.swift: SwiftPM manifestSources/fm/fm.swift: REPL implementationTests/fmTests/fmTests.swift: default test target