omlx is an optimized LLM inference engine designed specifically for Apple Silicon, offering a macOS menu bar application to manage local model serving. The system implements advanced memory management features, including a tiered KV cache that utilizes a "hot" in-memory tier and a "cold" SSD tier (using safetensors format) to persist context across requests and restarts. It supports continuous batching, prefix sharing with Copy-on-Write, and multi-model serving for LLMs, Vision-Language Models (VLM), embeddings, and rerankers. Users can control model lifecycles via LRU eviction, manual pinning, or time-to-live (TTL) settings, all while a process memory enforcer prevents system-wide OOM by capping total usage. For high-performance requirements, the engine supports native custom Metal kernels; for instance, using fused DSA prefill kernels for GLM-5.2 can increase performance from approximately 29 to 845 tokens per second on an M3 Ultra. The server provides an OpenAI-compatible API and a web-based admin dashboard for real-time monitoring, benchmarking, and model management. Additionally, it supports distributed inference across multiple Macs using MLX pipeline ranks over Ring or Thunderbolt RDMA/JACCL, enabling large-scale model execution across heterogeneous hardware clusters.

Read original