Skip to main content
macOS has full support for Apple Silicon unified memory and discrete GPU detection on Intel Macs.

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 uses system_profiler to detect Apple Silicon GPUs:
Detection criteria:
  • 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
No CPU Offload Path:
  • GPU and CPU share the same memory pool
  • Run mode is always GPU (unified) or CPU (no separate offload)
  • unified_memory flag set to true

Metal Backend

All Apple Silicon GPUs use Metal for GPU acceleration:
Memory Bandwidth: llmfit uses actual unified memory bandwidth for speed estimation: Source: hardware.rs:1584-1632

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

Calculation:
  • 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:
If nvidia-smi works, llmfit detects VRAM and uses CUDA backend. Note: NVIDIA stopped official macOS support after macOS 10.13 (High Sierra). Most Intel Macs with discrete GPUs have AMD cards.

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)
Workaround: Use manual override:

Installation Methods

Quick Install Script

From Source

Runtime Providers

llmfit integrates with local runtime providers for downloading and running models on macOS:

Ollama

Install Ollama:
llmfit auto-detects Ollama at http://localhost:11434:

llama.cpp

Install llama.cpp:
llmfit detects llama.cpp runtime and uses local GGUF cache.

MLX (Apple Silicon Only)

MLX is optimized for Apple Silicon unified memory:
llmfit detects MLX models in ~/.cache/huggingface/hub/.

Troubleshooting

GPU Not Detected (Apple Silicon)

  1. Check system_profiler:
  2. Expected output:
  3. 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:
llmfit should automatically fall back to vm_stat parsing. If it shows unrealistic values, file a bug report.

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

  1. Check if MLX is installed:
  2. Check MLX cache:
  3. Install MLX if missing:

Performance Issues

Unified Memory Pressure: Apple Silicon shares memory between GPU and CPU. Check memory pressure:
If memory pressure is high:
  • Close unused apps
  • Use smaller models or lower context lengths
  • Use --max-context to cap memory estimation:
Swap Usage: Apple Silicon Macs use swap aggressively. Check swap usage:
High swap usage degrades performance. Consider models that fit in ~70-80% of physical RAM.

Next Steps