Apple Silicon Unified Memory
All Apple Silicon Macs (M1, M2, M3, M4 series) use unified memory where GPU and CPU share the same RAM pool.Detection Method
llmfit usessystem_profiler to detect Apple Silicon GPUs:
- Searches for “Apple M” or “Apple GPU” in chipset line
- Example output:
Unified Memory Behavior
VRAM = Total System RAM:- 16 GB Mac → 16 GB VRAM
- 32 GB Mac → 32 GB VRAM
- 128 GB Mac → 128 GB VRAM
- GPU and CPU share the same memory pool
- Run mode is always
GPU(unified) orCPU(no separate offload) unified_memoryflag set totrue
Metal Backend
All Apple Silicon GPUs use Metal for GPU acceleration:| Chip | Bandwidth (GB/s) |
|---|---|
| M1 | 68 |
| M1 Pro | 200 |
| M1 Max | 400 |
| M1 Ultra | 800 |
| M2 | 100 |
| M2 Pro | 200 |
| M2 Max | 400 |
| M2 Ultra | 800 |
| M3 | 100 |
| M3 Pro | 150 |
| M3 Max | 400 |
| M3 Ultra | 800 |
| M4 | 120 |
| M4 Pro | 273 |
| M4 Max | 546 |
| M4 Ultra | 819 |
Available RAM Detection
Recent macOS versions (Sequoia, Tahoe) sometimes report 0 for available memory via sysinfo. llmfit has fallbacks:1. Total - Used
2. vm_stat Parsing
- Apple Silicon default page size: 16 KB (16384 bytes)
- Intel Macs: 4 KB (4096 bytes)
3. Conservative Fallback
If both fail, assume 80% of total RAM is available:Intel Mac Support
Intel Macs have discrete GPUs (AMD or NVIDIA) and do not use unified memory.NVIDIA GPUs (Older Intel Macs)
Some Intel Macs have discrete NVIDIA GPUs:AMD GPUs (Intel Macs)
Intel MacBook Pro / iMac Pro with AMD Radeon GPUs:- Detection:
system_profiler SPDisplaysDataType - VRAM: Not reported by system_profiler (shows “Metal: Supported”)
- llmfit falls back to CPU detection (no GPU reported)
Installation Methods
Homebrew (Recommended)
Quick Install Script
From Source
Runtime Providers
llmfit integrates with local runtime providers for downloading and running models on macOS:Ollama
Install Ollama:http://localhost:11434:
llama.cpp
Install llama.cpp:MLX (Apple Silicon Only)
MLX is optimized for Apple Silicon unified memory:~/.cache/huggingface/hub/.
Troubleshooting
GPU Not Detected (Apple Silicon)
-
Check system_profiler:
-
Expected output:
- If not detected, llmfit falls back to CPU detection (still works, but no GPU indication)
Available RAM Shows 0
This is a known issue on macOS Sequoia and newer:Intel Mac Discrete GPU Not Detected
Intel Macs with AMD Radeon GPUs are not auto-detected. Use manual override:OLLAMA_HOST Connection Issues
If Ollama is running but llmfit doesn’t detect it:MLX Not Detected
-
Check if MLX is installed:
-
Check MLX cache:
-
Install MLX if missing:
Performance Issues
Unified Memory Pressure: Apple Silicon shares memory between GPU and CPU. Check memory pressure:- Close unused apps
- Use smaller models or lower context lengths
- Use
--max-contextto cap memory estimation:
