Native LLM and MLLM Inference at Scale on Apple Silicon
Wayner Barrios
TL;DR
This work tackles the challenge of efficient, on-device multimodal LLM inference on Apple Silicon by introducing vllm-mlx, a native MLX-based framework that exploits unified memory for zero-copy execution. It delivers continuous batching, an OpenAI-compatible API, and a content-based prefix cache for vision inputs, enabling substantial throughput improvements over state-of-the-art Apple Silicon solutions and dramatic reductions in multimodal latency. Key contributions include a comprehensive benchmarking across 10+ models, a novel content hashing scheme for image caching, and memory-aware cache management that yields up to $28x$ speedups on repeated image queries and up to $24.7x$ on video frames. The framework is released as open source to enable privacy-preserving, low-latency on-device AI agents on consumer Apple hardware, with future work targeting audio modalities, distributed inference, and energy efficiency.
Abstract
The growing adoption of Apple Silicon for machine learning development has created demand for efficient inference solutions that leverage its unique unified memory architecture. However, existing tools either lack native optimization (PyTorch MPS) or focus solely on text models (llama.cpp), leaving multimodal workloads underserved. We present vllm-mlx, a framework for efficient LLM and MLLM inference on Apple Silicon built natively on MLX. For text models, we achieve 21% to 87% higher throughput than llama.cpp across models ranging from Qwen3-0.6B to Nemotron-30B, while providing continuous batching that scales to 4.3x aggregate throughput at 16 concurrent requests. For multimodal models, we introduce content-based prefix caching that eliminates redundant vision encoding by identifying identical images through content hashing, regardless of input format. Our evaluation on Apple M4 Max demonstrates throughput of up to 525 tokens per second on text models and 28x speedup on repeated image queries, reducing multimodal latency from 21.7 seconds to under 1 second. Video analysis with up to 64 frames achieves 24.7x cache speedup. We release our implementation as open source to support efficient inference on consumer Apple hardware.
