- Type
- Machine learning framework
- Developer
- Apple (ml-explore)
- First released
- December 2023
- Licence
- MIT
- Key feature
- Unified-memory arrays across CPU and GPU
- Related
- PyTorch, JAX, llama.cpp, Core ML
- Type
- Machine learning framework
- Developer
- Apple (ml-explore)
- First released
- December 2023
- Licence
- MIT
- Key feature
- Unified-memory arrays across CPU and GPU
- Related
- PyTorch, JAX, llama.cpp, Core ML
History
MLX was released in December 2023 by Apple researchers Awni Hannun, Jagrit Digani, Angelos Katharopoulos and Ronan Collobert. Its design drew on numerical and machine-learning frameworks including NumPy, PyTorch and JAX: the Python interface mirrors NumPy, the neural-network package mlx.nn follows PyTorch conventions, and its composable function transformations echo JAX.[1][2] The framework matured through 2024 and 2025, reaching version 0.30+ with support for the neural accelerators in Apple's M5 chips announced at WWDC 2025.[3]
Key Concepts and Technology
- Unified memory. Arrays are allocated once in shared memory visible to CPU and GPU. Instead of moving tensors with
.to("cuda"), the programmer specifies the device when an operation runs —mx.add(a, b, stream=mx.cpu)orstream=mx.gpu— eliminating host-to-device copies and an entire class of placement bugs. A Mac with 128 GB of unified memory can therefore hold models far larger than any consumer discrete GPU's VRAM. - Lazy evaluation. Operations record nodes in a computation graph that is only evaluated when results are needed (
mx.eval), letting MLX fuse and schedule work before execution — which also means a forgottenevalin a loop can silently grow memory. - Composable transformations.
grad,vmapandcompilenest arbitrarily; a gradient of a compiled function is a valid program in one line. - Metal GPU backend. Kernels are hand-written Metal shaders running through Apple's GPU stack, with bindings for Python, Swift, C and C++ so the same model runs on macOS, iOS, iPadOS and visionOS.[1][4]
Applications and Impact
MLX is used mainly for local LLM inference, experimentation and prototyping on MacBooks and Mac Studios, plus image generation and speech recognition on Apple devices. It lets a single laptop run quantised 7B–70B models privately, with no cloud round-trip, and is the natural on-device path for researchers who want CUDA-free workflows. Compared with PyTorch + CUDA it remains weaker for large-scale production training, and there is no fallback into the CUDA kernel ecosystem — FlashAttention, bitsandbytes and Triton kernels must be reimplemented or replaced.[3][4] Apple positions MLX as the research and power-user framework, with Core ML and the Foundation Models framework serving shipping applications.[4]
>See Also
🇲🇾 Relevance to Malaysia: MLX lowers the entry cost of hands-on AI for Malaysian developers, students and small businesses. NVIDIA GPU pricing has historically put capable training hardware beyond individual developers and many SMEs; a second-hand or education-priced Mac can serve as a genuine local inference machine, which matters for the AI literacy and talent goals set out under the National AI Office and MDEC programmes. The privacy angle is particularly relevant under the PDPA: running a model in unified memory on-device means customer text, documents and records never leave the laptop — an easy way for Malaysian firms handling personal data to use generative AI while keeping data residency and minimisation obligations comfortably satisfied. Creative and startup ecosystems from Cyberjaya to Penang already favour Mac hardware, so MLX gives that installed base a first-class AI stack without new capital expenditure, and local open-source communities can contribute Malay-language model support to a framework whose MIT licence permits commercial reuse.[5]
References
- ↑Wikipedia contributors. (2026). MLX (machine learning framework). https://en.wikipedia.org/wiki/MLX_(machine_learning_framework)
- ↑MLX documentation. Unified memory. https://ml-explore.github.io/mlx/build/html/usage/unified_memory.html
- ↑RepoCritics. MLX repository overview. https://repocritics.com/repos/github/ml-explore/mlx
- ↑Tensor Foundry. (2025). How MLX runs LLMs on Apple Silicon. https://tensorfoundry.io/blog/mlx-apple-silicon
- ↑Malaysia Digital Economy Corporation. (2026). Official website. https://www.mdec.my/