# MLX [**Quickstart**](#quickstart) | [**Installation**](#installation) | [**Documentation**](https://ml-explore.github.io/mlx/build/html/index.html) | [**Examples**](#examples) MLX is an array framework for machine learning on Apple silicon. Some key features of MLX include: - **Familiar APIs**: MLX has a Python API which closely follows NumPy. MLX also has a fully featured C++ API which closely mirrors the Python API. MLX has higher level packages like `mlx.nn` and `mlx.optimizers` with APIs that closely follow PyTorch to simplify building more complex models. - **Composable function transformations**: MLX has composable function transformations for automatic differentiation, automatic vectorization, and computation graph optimization. - **Lazy computation**: Computations in MLX are lazy. Arrays are only materialized when needed. - **Dynamic graph construction**: Computation graphs in MLX are built dynamically. Changing the shapes of function arguments does not trigger slow compilations, and debugging is simple and intuitive. - **Multi-device**: Operations can run on any of the supported devices (currently the CPU and GPU). - **Unified memory**: A noteable difference from MLX and other frameworks is the *unified memory model*. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without moving data. MLX is designed by machine learning researchers for machine learning researchers. The framework is intended to be user friendly, but still efficient to train and deploy models. The design of the framework itself is also conceptually simple. We intend to make it easy for researchers to extend and improve MLX with the goal of quickly exploring new ideas. The design of MLX is inspired by frameworks like [NumPy](https://numpy.org/doc/stable/index.html), [PyTorch](https://pytorch.org/), [Jax](https://github.com/google/jax), and [ArrayFire](https://arrayfire.org/). ## Examples The [MLX examples repo](https://github.com/ml-explore/mlx-examples) has a variety of examples including: - [Transformer language model](https://github.com/ml-explore/mlx-examples/tree/main/transformer_lm) training. - Large scale text generation with [LLaMA](https://github.com/ml-explore/mlx-examples/tree/main/llama) and finetuning with [LoRA](https://github.com/ml-explore/mlx-examples/tree/main/lora). - Generating images with [Stable Diffusion](https://github.com/ml-explore/mlx-examples/tree/main/stable_diffusion). - Speech recognition with [OpenAI's Whisper](https://github.com/ml-explore/mlx-examples/tree/main/whisper). ## Quickstart See the [quick start guide](https://ml-explore.github.io/mlx/build/html/quick_start.html) in the documentation. ## Installation MLX is available on [PyPi](https://pypi.org/project/mlx/). To install the Python API run: ``` pip install mlx ``` Checkout the [documentation](https://ml-explore.github.io/mlx/build/html/install.html#) for more information on building the C++ and Python APIs from source. ## Contributing Check out the [contribution guidelines](CONTRIBUTING.md) for more information on contributing to MLX.