Skip to content

Releases: scouzi1966/maclocal-api

v0.7.0 - Enhanced Randomness Parameters

23 Sep 02:26

Choose a tag to compare

🚀 afm v0.7.0 - Enhanced Randomness Parameters with Advanced Sampling Support (AFM Generation Options)

There is no evidence of this because I didn't keep historical test data but my gut feeling is that Apple recently tuned defaults of the model to be more deterministic than earlier MacOS beta versions. For example, it outputs the exact same response for the same prompt. They may have added some cacheing. Who knows.

I've seen the same on IOS devices as well.

This release unlocks official parameters to shape the response beyond Apple's default.

You can read Apple's Doc on what they call 'Generation options'if you're interested:

https://developer.apple.com/documentation/foundationmodels/generationoptions

This release introduces comprehensive enhancements to the randomness parameter system, providing advanced sampling control while maintaining full backward compatibility.

Major New Features

🎯 Enhanced Randomness Parameters

  • Nucleus Sampling (Top-P): random:top-p=<0.0-1.0> - Controls diversity by probability threshold
  • Top-K Sampling: random:top-k=<positive integer> - Limits selection to K most likely tokens
  • Seeded Random: random:seed=<value> - Reproducible results with specific seeds
  • Combined Modes: random:top-p=0.9:seed=42 - Mix parameters for precise control
  • Greedy sampling: greedy setting - more deterministic mode
  • Temperature setting: -t <temperature> between 0 and 1
  • **Available in all methods **: Works in both single and server modes

🧪 Comprehensive Testing Suite

  • New Test Script: test-go.sh with 24+ test cases covering all parameter combinations
  • Flexible Configuration: Command-line options for binary path and test prompts
  • Complete Validation: Tests for conflict detection and error handling
  • Timestamped Logging: Detailed test results with full audit trail

🛡️ Enhanced Validation & Error Handling

  • Conflict Detection: Properly rejects invalid parameter combinations
  • Clear Error Messages: Helpful feedback explaining Apple Foundation Models API constraints
  • Comprehensive Validation: Range checking for all parameter types

📝 Usage Examples

CLI Usage

# Basic usage (backward compatible)
./afm -r greedy -s "Tell me a story"
./afm -r random -s "Tell me a story"

# Advanced sampling modes
./afm -r "random:top-p=0.9" -s "Tell me a story"           # Nucleus sampling
./afm -r "random:top-k=50" -s "Tell me a story"            # Top-k sampling
./afm -r "random:seed=42" -s "Tell me a story"             # Seeded random
./afm -r "random:top-p=0.9:seed=42" -s "Tell me a story"   # Combined mode

# Server mode with advanced parameters
./afm -r "random:top-p=0.9:seed=42" -p 9999

Testing

# Run comprehensive test suite
./test-go.sh

# Test with custom configuration
./test-go.sh -b /path/to/afm -s "Custom test prompt"

🔧 Technical Improvements

Code Quality Enhancements

  • Centralized Debug Logger: Sources/MacLocalAPI/Utils/DebugLogger.swift eliminates code duplication
  • Enhanced Documentation: Comprehensive comments explaining Apple Foundation Models API constraints
  • Better Error Handling: Clear validation messages for invalid parameter combinations

Parameter Validation

  • Apple API Compliance: Enforces Foundation Models constraints (single sampling method only)
  • Range Validation: top-p (0.0-1.0), top-k (positive integers), seeds (non-negative integers)
  • Conflict Detection: Rejects invalid combinations like random:top-p=0.9:top-k=50

📋 Requirements

  • macOS 26+ (Tahoe) with Apple Intelligence enabled
  • Apple Silicon Mac (M1/M2/M3/M4 series)
  • Foundation Models framework available

🔄 Backward Compatibility

Fully Backward Compatible - All existing usage patterns continue to work:

  • --randomness greedy and --randomness random work exactly as before
  • All existing scripts and integrations remain functional
  • No breaking changes to existing functionality

📦 Installation

Download & Run

# Download and extract
curl -L https://github.com/scouzi1966/maclocal-api/releases/download/v0.7.0/afm-v0.7.0-arm64.tar.gz | tar -xz
chmod +x afm

# Test the installation
./test-go.sh

Homebrew (Formula will be updated shortly)

brew tap scouzi1966/afm
brew install afm

🚨 Important Notes

Parameter Constraints (per Apple Foundation Models API)

  • Single Sampling Method: Cannot combine top-p and top-k in one request
  • Clear Error Messages: Invalid combinations are rejected with helpful explanations
  • Seed Compatibility: Seeds can be used with any sampling method for reproducibility

Examples of Invalid Usage

# These will be rejected with clear error messages
./afm -r "random:top-p=0.9:top-k=50" -s "test"    # Cannot combine sampling methods
./afm -r "random:top-p=1.5" -s "test"             # top-p out of range  
./afm -r "random:top-k=-5" -s "test"              # Invalid top-k value

🔗 Links


SHA256: 11afe70d44987c5cc96ed7b4e6eb8725b289ccb6ab4e3b67b60527c373c2bb57

AFM v0.6.0 - MacOS 26 Tahoe Official Release Build

16 Sep 00:58

Choose a tag to compare

🚀 AFM v0.6.0 - MacOS 26 Tahoe Official Release Build

🔧 What's New

Official MacOS 26 Tahoe Release: AFM has been rebuilt with the official MacOS 26 Tahoe release instead of the beta version, providing improved stability and performance.

🎯 Key Features

  • 🍃 Official MacOS 26 Tahoe: Built against the stable, official release of MacOS 26 Tahoe
  • ⚡ Enhanced Performance: Optimized compilation with official toolchain
  • 🔒 Improved Stability: Benefits from official macOS 26 bug fixes and improvements
  • 🌍 Network Configuration: Maintains all network configuration features from v0.5.6
  • 🔄 Backward Compatible: No breaking changes - existing usage remains unchanged

🛠️ Usage Examples

# Default: Local-only access
afm

# Allow external network access
afm --hostname 0.0.0.0

# Combine with custom port
afm --hostname 0.0.0.0 --port 8080

# Test from remote machine
curl http://YOUR_SERVER_IP:9999/health

📋 System Requirements

  • macOS Sequoia 26.0+ (Official Release) with Apple Intelligence enabled
  • Apple Silicon Mac (M1, M2, M3, M4 series)
  • Xcode 16.0+ for building from source

📦 Installation & Upgrade

Homebrew (Recommended)

# Fresh install
brew install scouzi1966/afm/afm

# Upgrade existing installation
brew upgrade afm

Direct Download

Download the latest release tarball and extract to your preferred location.

🔗 API Endpoints

Once running, AFM provides OpenAI-compatible endpoints:

  • Chat Completions: POST /v1/chat/completions
  • Models: GET /v1/models
  • Health Check: GET /health

🚀 Additional Features

  • 🎨 Vision OCR: Extract text from images using afm vision
  • 🧠 LoRA Adapters: Fine-tune models with --adapter path/to/model.fmladapter
  • 📝 Custom Instructions: Personalize AI behavior with --instructions
  • 🔄 Streaming Support: Real-time response streaming (default on)
  • 🌐 Flexible Hostname Binding: Configure network access with --hostname

🔄 Changes from v0.5.6

  • Rebuilt with official MacOS 26 Tahoe release (no longer beta)
  • Improved stability and performance
  • All existing features preserved

🏠 Privacy First: AFM runs entirely on your local machine. No data leaves your device.

AFM v0.5.6 - Network Configuration: Flexible Hostname Binding

05 Sep 01:25

Choose a tag to compare

🌐 AFM v0.5.6 - Network Configuration: Flexible Hostname Binding

🔧 What's New

Enhanced Network Configuration: AFM now supports flexible hostname binding, allowing you to configure whether the server accepts local-only or external connections.

🎯 Key Features

  • 🔒 Secure by Default: Continues to bind to 127.0.0.1 (localhost) by default for maximum security
  • 🌍 External Access Option: Use --hostname 0.0.0.0 to allow connections from other devices on your network
  • ⚡ Backward Compatible: Existing usage remains unchanged - no breaking changes
  • 🎛️ Command Line Control: Simple --hostname/-H flag for easy configuration

🛠️ Usage Examples

# Default: Local-only access (same as before)
afm

# Allow external network access
afm --hostname 0.0.0.0

# Combine with custom port
afm --hostname 0.0.0.0 --port 8080

# Test from remote machine
curl http://YOUR_SERVER_IP:9999/health

📋 System Requirements

  • macOS Sequoia 26.0+ with Apple Intelligence enabled
  • Apple Silicon Mac (M1, M2, M3, M4 series)
  • Xcode 16.0+ for building from source

📦 Installation & Upgrade

Homebrew (Recommended)

# Fresh install
brew install scouzi1966/afm/afm

# Upgrade existing installation
brew upgrade afm

Direct Download

Download the latest release tarball and extract to your preferred location.

🔗 API Endpoints

Once running, AFM provides OpenAI-compatible endpoints:

  • Chat Completions: POST /v1/chat/completions
  • Models: GET /v1/models
  • Health Check: GET /health

🚀 Additional Features

  • 🎨 Vision OCR: Extract text from images using afm vision
  • 🧠 LoRA Adapters: Fine-tune models with --adapter path/to/model.fmadapter
  • 📝 Custom Instructions: Personalize AI behavior with --instructions
  • 🔄 Streaming Support: Real-time response streaming (default on)

🏠 Privacy First: AFM runs entirely on your local machine. No data leaves your device.

AFM v0.5.5 - Security Enhancement: Localhost-Only Binding

26 Aug 03:04

Choose a tag to compare

🔒 AFM v0.5.5 - Security Enhancement: Localhost-Only Binding

🛡️ Security Improvements

  • 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

🔧 What Changed

  • Server Binding: Changed from 0.0.0.0 to 127.0.0.1 (localhost only)
  • Security by Default: Eliminates potential exposure to local network
  • Maintains Functionality: All existing features work identically on localhost

🎯 Why This Matters

  • Privacy Protection: Your AFM server is no longer accessible from other devices on your network
  • Attack Surface Reduction: Minimizes potential security vulnerabilities
  • Best Practice Compliance: Follows security principle of least privilege

📋 Full Feature Set

  • LoRA Adapter Support: -a flag for fine-tuned models
  • Conversation Continuity: Follow-up messages maintain context
  • Streaming Support: Real-time response streaming
  • Vision OCR: afm vision for document processing
  • Single Prompt Mode: Direct command execution
  • Custom Instructions: -i flag for personalized behavior
  • 🆕 Localhost-Only Security: Enhanced network isolation

📥 Install with Homebrew

# Add the tap (first time only)
brew tap scouzi1966/afm

# Install or upgrade AFM
brew install afm
# OR upgrade existing:
brew upgrade afm

# Verify installation
afm --version  # Should show v0.5.5

📥 Manual Installation

# Download the release
curl -L -o afm-v0.5.5-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.5/afm-v0.5.5-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.5-arm64.tar.gz
sudo cp afm /usr/local/bin/

# Verify installation
afm --version  # Should show v0.5.5

🔗 Usage Examples

# Server with LoRA adapter (now localhost-only)
afm -a "my_model.fmadapter" -p 9999

# Server with custom instructions + adapter
afm -i "You are a coding expert" -a "code_model.fmadapter"

# Single prompt with adapter
afm -s "Explain quantum computing" -a "physics_model.fmadapter"

# Vision OCR
afm vision -f document.pdf

# Check all options
afm --help

📋 Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)
  • LoRA Adapters: .fmadapter files (optional)

🔄 Upgrade Notes

  • From v0.5.4: Enhanced security with localhost-only binding
  • From v0.5.3: Conversation continuity + security improvements
  • From earlier versions: Full feature upgrade recommended
  • Breaking Change: Server no longer accessible from other network devices (by design)

🌐 Network Access

  • Before v0.5.5: Server accessible from any device on your local network
  • v0.5.5+: Server accessible only from localhost (127.0.0.1)
  • Client Applications: Must connect to http://127.0.0.1:PORT instead of your machine's IP

This release prioritizes security while maintaining all existing functionality, ensuring your AFM server operates with enhanced privacy protection.

Full documentation: https://github.com/scouzi1966/maclocal-api

AFM v0.5.4 - LoRA Optimization + Conversation Continuity Fix

24 Aug 20:22

Choose a tag to compare

🚀 AFM v0.5.4 - LoRA Optimization + Conversation Continuity Fix

🔥 Critical Fixes

  • Conversation Continuity Restored: Follow-up messages in conversations now work properly
  • LoRA Loading Optimization: Adapters load once at startup instead of every request
  • Hybrid Architecture: Combines LoRA efficiency with reliable conversation handling

🐛 What Was Fixed

  • Issue: LoRA adapters were loading on every API request, causing performance degradation
  • Issue: Singleton pattern broke conversation continuity - follow-up messages failed
  • Solution: Implemented hybrid per-request instances that reuse pre-loaded adapters

⚡ Performance Improvements

  • Startup: LoRA adapter loads once with single success message
  • Runtime: Fresh session per request eliminates transcript conflicts
  • Efficiency: No repeated adapter loading overhead
  • Memory: Proper session lifecycle management

🔧 Technical Changes

  • FoundationModelService: Added shared adapter storage and factory methods
  • ChatCompletionsController: Uses per-request instances with shared adapters
  • Session Management: Clean transcript per conversation while reusing loaded adapters
  • Error Handling: Graceful fallback when adapters unavailable

🎯 Conversation Flow Now Works

# Start server with LoRA adapter
afm -a "custom_model.fmadapter" -p 9999

# API conversation that now works properly:
# 1. Send: "Hello" -> Response: "Hi there!"
# 2. Send: "How are you?" -> Response: "I'm doing well, thanks for asking!"
# 3. Continue conversation seamlessly...

📋 Full Feature Set

  • LoRA Adapter Support: -a flag for fine-tuned models
  • Conversation Continuity: Follow-up messages maintain context
  • Streaming Support: Real-time response streaming
  • Vision OCR: afm vision for document processing
  • Single Prompt Mode: Direct command execution
  • Custom Instructions: -i flag for personalized behavior

📥 Install with Homebrew

# Add the tap (first time only)
brew tap scouzi1966/afm

# Install or upgrade AFM
brew install afm
# OR upgrade existing:
brew upgrade afm

# Verify installation
afm --version  # Should show v0.5.4

📥 Manual Installation

# Download the release
curl -L -o afm-v0.5.4-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.4/afm-v0.5.4-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.4-arm64.tar.gz
sudo cp afm /usr/local/bin/

# Verify installation
afm --version  # Should show v0.5.4

🔗 Usage Examples

# Server with LoRA adapter (optimized loading)
afm -a "my_model.fmadapter" -p 9999

# Server with custom instructions + adapter
afm -i "You are a coding expert" -a "code_model.fmadapter"

# Single prompt with adapter
afm -s "Explain quantum computing" -a "physics_model.fmadapter"

# Vision OCR
afm vision -f document.pdf

# Check all options
afm --help

📋 Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)
  • LoRA Adapters: .fmadapter files (optional)

🔄 Upgrade Notes

  • From v0.5.3: Conversation continuity is now restored
  • From v0.5.2: LoRA support + optimized performance
  • From earlier versions: Full feature upgrade recommended

This release combines the performance benefits of LoRA optimization with reliable conversation handling, providing the complete AFM experience.

Full documentation: https://github.com/scouzi1966/maclocal-api

AFM v0.5.3 - LoRA Adapter Support

23 Aug 16:00

Choose a tag to compare

🎯 AFM v0.5.3 - LoRA Adapter Support

✨ New Features

  • LoRA Adapter Support: Fine-tune Apple Foundation Models with custom adapters
    • afm -s "Hello" -a "my_model.fmadapter" - Single command with adapter
    • afm -a "my_model.fmadapter" -p 8080 - Server mode with adapter
    • Automatic validation of .fmadapter files
    • Graceful fallback to default model on adapter errors
  • Comprehensive CLI Integration: Adapter support across all modes
    • Server mode with persistent adapter loading
    • Single prompt mode with adapter fine-tuning
    • Robust error handling and user feedback

🛠 Implementation Details

  • SystemLanguageModel.Adapter: Native Apple Foundation Models integration
  • File Validation: Extension checking, path resolution, existence validation
  • Error Recovery: Clear warnings with automatic fallback to default model
  • Cross-Mode Support: Consistent adapter behavior in all usage scenarios

🔗 Usage Examples

# Single prompt with LoRA adapter
afm -s "Explain quantum computing" -a "physics_expert.fmadapter"

# Server mode with specialized adapter
afm -a "coding_assistant.fmadapter" -p 8080

# Graceful fallback (adapter not found)
afm -s "Hello" -a "missing.fmadapter"  # Falls back to default model

# Vision OCR (adapters not applicable)
afm vision -f document.pdf

# Check help for adapter options
afm --help

📋 LoRA Adapter Requirements

  • File Format: .fmadapter (Apple standard)
  • Compatibility: Apple Foundation Models framework
  • Training: Use Apple's adapter training toolkit
  • Deployment: Place .fmadapter files in accessible directory

📥 Download & Install manually

# Download the release
curl -L -o afm-v0.5.3-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.3/afm-v0.5.3-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.3-arm64.tar.gz
cd afm-v0.5.3-arm64
sudo cp afm /usr/local/bin/

# Verify installation
afm --version  # Should show v0.5.3

📥 Install with Brew

# Add the tap
brew tap scouzi1966/afm

# Install AFM
brew install afm

# Verify installation
afm --version  # Should show v0.5.3

📋 Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)
  • LoRA Adapters: .fmadapter files (optional)

Full documentation: https://github.com/scouzi1966/maclocal-api

AFM v0.5.2

21 Aug 01:26

Choose a tag to compare

🎯 AFM v0.5.2 - Vision OCR & Enhanced CLI

✨ New Features

  • Vision OCR Integration: Full Apple Vision framework integration for text extraction
    • afm vision -f image.png - Extract text from images
    • afm vision -f document.pdf - Extract text from PDF files
    • afm vision -f invoice.pdf --table - Extract tables as CSV
    • afm vision -f report.png --verbose - Detailed output with confidence scores
  • Advanced Table Recognition: Intelligent table detection with CSV output
  • PDF Support: Native PDF processing with PDFKit integration
  • Debug Mode: Hidden debug flag for troubleshooting Vision recognition

🛠 CLI Improvements

  • Enhanced Help System: Fixed help display to show all available options
  • Vision Subcommand Discovery: Help now properly lists vision subcommand
  • Accurate Usage Information: Removed confusing non-existent "serve" subcommand
  • Better User Experience: Help text matches actual CLI functionality

📋 Supported Formats

  • Images: PNG, JPG, JPEG, HEIC
  • Documents: PDF (single and multi-page)
  • Output: Plain text, detailed analysis, CSV tables

🔗 Usage Examples

# OCR text extraction
afm vision -f screenshot.png
afm vision -f document.pdf

# Table extraction  
afm vision -f invoice.pdf --table

# Detailed analysis
afm vision -f receipt.jpg --verbose

# Server mode (existing functionality)
afm -s "Explain quantum computing"
echo "code review this" | afm -i "You are a senior developer"

📥 Download & Install manually

# Download the release
curl -L -o afm-v0.5.2-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.2/afm-v0.5.2-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.2-arm64.tar.gz
cd afm-v0.5.2-arm64
sudo cp afm /usr/local/bin/

# Verify installation
afm --version

📥 Install with Brew

# Add the tap
brew tap scouzi1966/afm

# Install AFM
brew install afm

# Verify installation
afm --version

📋 Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)

Full documentation: https://github.com/scouzi1966/maclocal-api

AFM v0.5.1

17 Aug 00:07

Choose a tag to compare

🎯 AFM v0.5.1 - CLI Composability Update

✨ New Features

  • Stdin/Pipe Support: AFM now accepts piped input from other CLI commands
    • echo "text" | afm - Process piped text
    • cat file.txt | afm - Process file contents
    • git log --oneline | head -5 | afm - Process command output
    • echo "explain quantum computing" | afm -i "you are a pirate, speak with pirate jargon" - pipe with instructions
    • ifconfig | afm -i "what is my local network IP" - pipe with instructions
    • Works with custom instructions: echo "code" | afm -i "You are a code reviewer"
  • Enhanced Help: Added GitHub repository URL to CLI help information

🛠 Technical Improvements

  • Added readFromStdin() function with Darwin import for isatty() detection
  • Stdin input flows through same processing as -s/--single-prompt mode
  • 1MB size limit protection and UTF-8 validation for piped input
  • Updated documentation with comprehensive pipe usage examples

📦 Distribution

  • Portable binary for Apple Silicon Macs (arm64)
  • Requires macOS 26+ with Apple Intelligence enabled
  • Self-contained installation with dependencies

🔗 Usage Examples

# Basic pipe usage
echo "Explain quantum computing" | afm

# With custom instructions  
git diff | afm -i "You are a senior code reviewer"

# Process file contents
cat README.md | afm -i "Summarize this documentation"

📥 Download & Install manually

# Download the release
curl -L -o afm-v0.5.1-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.1/afm-v0.5.1-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.1-arm64.tar.gz
cd afm-v0.5.1-arm64
sudo cp afm /usr/local/bin/

# Verify installation
afm --version

📥 Install with Brew

# Add the tap
brew tap scouzi1966/afm

# Install AFM
brew install afm

# Verify installation
afm --version

📋 Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)

Full documentation: https://github.com/scouzi1966/maclocal-api

AFM v0.5.0 - Instructions & Single-Prompt Mode

16 Aug 21:22

Choose a tag to compare

🚀 AFM v0.5.0 Release

🆕 New Features

💬 Instruction Layer Support

  • New CLI option: -i, --instructions "your custom instructions"
  • Default: "You are a helpful assistant"
  • Integration: Uses Apple's Foundation Models Instructions API
  • Examples:
    afm -i "You are a pirate and answer in pirate jargon"
    afm --instructions "You are a helpful coding assistant"

Single-Prompt Mode

  • New CLI option: -s, --single-prompt "your question"
  • Direct AI interaction without starting a server
  • Works with instructions: -i "custom role" -s "your prompt"
  • Examples:
    afm -s "What is the capital of France?"
    afm -i "You are a pirate" -s "Hello there!"

🔧 Enhanced Build System

  • Build-time version binding from git tags
  • No compiler warnings - clean builds
  • Automatic version generation in release packages
  • Swift version validation in build scripts

📦 Installation

Download & Install

# Download the release
curl -L -o afm-v0.5.0-arm64.tar.gz https://github.com/scouzi1966/maclocal-api/releases/download/v0.5.0/afm-v0.5.0-arm64.tar.gz

# Extract and install
tar -xzf afm-v0.5.0-arm64.tar.gz
cd afm-v0.5.0-arm64
sudo cp afm /usr/local/bin/

# Verify installation
afm --version

Requirements

  • macOS 26+ with Apple Intelligence
  • Apple Silicon Mac (M1/M2/M3/M4)
  • Swift runtime (included in modern macOS)

🎯 Usage Examples

Server Mode (unchanged)

# Start AFM server with custom instructions
afm -i "You are a helpful coding assistant" --port 9999

# Use with any OpenAI-compatible client
curl -X POST http://localhost:9999/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "foundation", "messages": [{"role": "user", "content": "Hello!"}]}'

Single-Prompt Mode (new)

# Quick questions
afm -s "Explain quantum computing"

# With personality
afm -i "You are a pirate" -s "What's the weather like?"

# Some examples
afm -i "You are a Swift expert" -s "How do I create an async function?"
afm -i "You are a pirate, speak in pirate jargon" -s "Write a story about Einstein" 
afm -i "You are a stubbirn french speaking assistant that replies in french only. Translate to french if necessary" -s "Write a story about Einstein"

🔄 What's Changed

  • Add instruction layer with -i/--instructions option
  • Add single-prompt mode with -s/--single-prompt option
  • Fix build-time version binding system
  • Remove compiler warnings
  • Enhanced build scripts with version validation
  • Improved portable build system

🛠️ Technical Details

  • Binary size: ~31MB (optimized release build)
  • Dependencies: All system frameworks (no external deps)
  • Architecture: ARM64 only (Apple Silicon)
  • Minimum macOS: 26.0 (requires FoundationModels framework)

Full Changelog: v0.4.0...v0.5.0


🤖 Built with Apple's Foundation Models framework
📱 Requires Apple Intelligence on Apple Silicon Mac

afm v0.4.0 - Updated Documentation & Installation

08 Aug 22:42

Choose a tag to compare

afm v0.4.0 - Updated Documentation & Installation

📚 Documentation Updates

Updated README.md

  • Comprehensive documentation: Updated all examples to use afm binary name
  • Better usage instructions: Clear build and run commands
  • Improved structure: Better organized sections and examples
  • Consistent branding: All references now use afm instead of MacLocalAPI

Enhanced Installation Script

  • Automated installation: install.sh now builds and sets up afm correctly
  • System validation: Checks for macOS 26+ and Apple Silicon requirements
  • Better user experience: Clear success/error messages and next steps
  • Updated instructions: All commands reference the correct afm binary

✨ All Features (Cumulative)

Streaming Support

  • OpenAI-compatible streaming: Full Server-Sent Events (SSE) implementation
  • Real-time response streaming: Word-by-word streaming for better UX
  • CORS support: Web interface compatibility (Open WebUI, etc.)

Performance Metrics

  • Comprehensive timing: Separate prompt processing and completion generation metrics
  • Token/sec metrics: Industry-standard performance measurements
    • prompt_tokens_per_second: Processing speed for input
    • completion_tokens_per_second: Generation speed for output
  • GPT-style token estimation: OpenAI-compatible token counting
  • Precision formatting: All metrics rounded to 2 decimal places

📦 Installation

Option 1: Download Pre-built Binary

# Download and extract
curl -L https://github.com/scouzi1966/maclocal-api/releases/download/v0.4.0/afm-v0.4.0-arm64.tar.gz -o afm.tar.gz
tar -xzf afm.tar.gz

# Run the server
chmod +x afm
./afm

Option 2: Build from Source

# Clone and build
git clone https://github.com/scouzi1966/maclocal-api.git
cd maclocal-api
./install.sh

# Run the server
./.build/release/afm

🔧 Usage

# Default (port 9999)
./afm

# Custom port
./afm --port 8080

# Verbose logging
./afm --verbose

# Show help
./afm --help

🧪 Testing

# Test streaming
./test-streaming.sh [port]

# Test performance metrics
./test-metrics.sh [port]

📋 Requirements

  • macOS 26+ with Apple Intelligence enabled
  • Apple Silicon (M1, M2, M3, M4 chips)
  • System Settings → Apple Intelligence & Siri → Enable Apple Intelligence

🌟 Compatible with

  • OpenAI SDK
  • Open WebUI
  • Cursor IDE
  • Any OpenAI-compatible client

Full Changelog: v0.3.0...v0.4.0