This is a Homebrew tap for AFM (Apple Foundation Models API), a macOS server that exposes Apple's Foundation Models through OpenAI-compatible API endpoints.
- π Localhost-Only Binding: Server now binds exclusively to localhost (127.0.0.1) for enhanced security
- π‘οΈ Network Isolation: Prevents external network access to the AFM server
- β¨ Zero Configuration: No additional setup required - security enabled by default
# Add the tap
brew tap scouzi1966/afm
# Install AFM
brew install afm
# Verify installation
afm --version- macOS 26+ with Apple Intelligence enabled
- Apple Silicon Mac (M1/M2/M3/M4 series)
- Apple Intelligence enabled in System Settings β Apple Intelligence & Siri
# Start server (default port 9999)
afm
# Start with custom port and verbose logging
afm --port 8080 --verbose
# Single prompt mode
afm -i "you are a pirate, speak in pirate jargon" -s "Explain quantum computing"
afm -i "you are a stubborn french speaking assistant. You only reply in french. Translate to french when necessary" -s "Write a story about Einstein"
# Pipe input support
echo "What is the meaning of life?" | afm
git log --oneline | head -5 | afm -i "summarize"
# Custom instructions
echo "Review this code" | afm -i "You are a senior software engineer"- π OpenAI API Compatible - Works with existing OpenAI client libraries
- π± Apple Foundation Models - Uses Apple's on-device language models
- π Privacy-First - All processing happens locally on your device
- β‘ Fast & Lightweight - No network calls, no API keys required
- π οΈ Easy Integration - Drop-in replacement for OpenAI API endpoints
- π Token Usage Tracking - Provides accurate token consumption metrics
- π° CLI Composability - Accepts piped input from other commands
For complete documentation, visit: https://github.com/scouzi1966/maclocal-api
MIT License - see the main repository for details.