How do you run offline AI inference on Apple Silicon Macs?
Apple Silicon (M1/M2/M3/M4 series) provides excellent offline AI performance due to unified memory architecture, high memory bandwidth, and dedicated Neural Engine. Advantages: unified memory means CPU and GPU share the same memory pool (no data transfer overhead), memory bandwidth of 100-400 GB/s (depending on chip), and Neural Engine provides 15-38 TOPS of dedicated ML acceleration. LLM inference: use llama.cpp with Metal backend (GPU acceleration via Apple's Metal API), achieving 30-60 tokens/second for 7B Q4 models on M2 Pro. Ollama natively supports Metal acceleration. MLX (Apple's ML framework) provides NumPy-like API optimized for Apple Silicon with lazy evaluation and unified memory. Model capacity by chip: M1 (16GB) runs 7B Q4 models comfortably, M2 Pro (32GB) handles 30B Q4 or 13B Q8, M2 Max (64GB) runs 70B Q4 models, and M2 Ultra (128-192GB) can run 180B+ models. Core ML: convert models to Core ML format using coremltools for maximum Neural Engine utilization, particularly beneficial for vision models and smaller language models. Performance tips: set GPU layers appropriately in llama.cpp (offload as many layers as VRAM allows), use MLX for training and fine-tuning workloads, enable high-performance power mode, and close memory-hungry applications to maximize available unified memory. Development workflow: develop and test on Mac with Ollama/llama.cpp, export optimized models, and deploy to production Linux servers or other target platforms.