# MLX
[**Quickstart**](#quickstart) | [**Installation**](#installation) |
[**Documentation**](https://ml-explore.github.io/mlx/build/html/index.html) |
[**Examples**](#examples)
[![CircleCI](https://circleci.com/gh/ml-explore/mlx.svg?style=svg)](https://circleci.com/gh/ml-explore/mlx)
MLX is an array framework for machine learning on Apple silicon,
brought to you by Apple machine learning research.
Some key features of MLX include:
- **Familiar APIs**: MLX has a Python API that closely follows NumPy. MLX
also has fully featured C++, [C](https://github.com/ml-explore/mlx-c), and
[Swift](https://github.com/ml-explore/mlx-swift/) APIs, which closely mirror
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 supports 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 constructed
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 the GPU).
- **Unified memory**: A notable 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 transferring 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/llms/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/usage/quick_start.html)
in the documentation.
## Installation
MLX is available on [PyPI](https://pypi.org/project/mlx/). To install the Python API, run:
**With `pip`**:
```
pip install mlx
```
**With `conda`**:
```
conda install -c conda-forge 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](https://github.com/ml-explore/mlx/tree/main/CONTRIBUTING.md) for more information
on contributing to MLX. See the
[docs](https://ml-explore.github.io/mlx/build/html/install.html) for more
information on building from source, and running tests.
We are grateful for all of [our
contributors](https://github.com/ml-explore/mlx/tree/main/ACKNOWLEDGMENTS.md#Individual-Contributors). If you contribute
to MLX and wish to be acknowledged, please add your name to the list in your
pull request.
## Citing MLX
The MLX software suite was initially developed with equal contribution by Awni
Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find
MLX useful in your research and wish to cite it, please use the following
BibTex entry:
```
@software{mlx2023,
author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
url = {https://github.com/ml-explore},
version = {0.0},
year = {2023},
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ml-explore/mlx",
"name": "mlx",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "MLX Contributors",
"author_email": "mlx@group.apple.com",
"download_url": null,
"platform": null,
"description": "# MLX\n\n[**Quickstart**](#quickstart) | [**Installation**](#installation) |\n[**Documentation**](https://ml-explore.github.io/mlx/build/html/index.html) |\n[**Examples**](#examples) \n\n[![CircleCI](https://circleci.com/gh/ml-explore/mlx.svg?style=svg)](https://circleci.com/gh/ml-explore/mlx)\n\nMLX is an array framework for machine learning on Apple silicon,\nbrought to you by Apple machine learning research.\n\nSome key features of MLX include:\n\n - **Familiar APIs**: MLX has a Python API that closely follows NumPy. MLX\n also has fully featured C++, [C](https://github.com/ml-explore/mlx-c), and\n [Swift](https://github.com/ml-explore/mlx-swift/) APIs, which closely mirror\n the Python API. MLX has higher-level packages like `mlx.nn` and\n `mlx.optimizers` with APIs that closely follow PyTorch to simplify building\n more complex models.\n\n - **Composable function transformations**: MLX supports composable function\n transformations for automatic differentiation, automatic vectorization,\n and computation graph optimization.\n\n - **Lazy computation**: Computations in MLX are lazy. Arrays are only\n materialized when needed.\n\n - **Dynamic graph construction**: Computation graphs in MLX are constructed\n dynamically. Changing the shapes of function arguments does not trigger\n slow compilations, and debugging is simple and intuitive.\n\n - **Multi-device**: Operations can run on any of the supported devices\n (currently the CPU and the GPU).\n\n - **Unified memory**: A notable difference from MLX and other frameworks\n is the *unified memory model*. Arrays in MLX live in shared memory.\n Operations on MLX arrays can be performed on any of the supported\n device types without transferring data.\n\nMLX is designed by machine learning researchers for machine learning\nresearchers. The framework is intended to be user-friendly, but still efficient\nto train and deploy models. The design of the framework itself is also\nconceptually simple. We intend to make it easy for researchers to extend and\nimprove MLX with the goal of quickly exploring new ideas. \n\nThe design of MLX is inspired by frameworks like\n[NumPy](https://numpy.org/doc/stable/index.html),\n[PyTorch](https://pytorch.org/), [Jax](https://github.com/google/jax), and\n[ArrayFire](https://arrayfire.org/).\n\n## Examples\n\nThe [MLX examples repo](https://github.com/ml-explore/mlx-examples) has a\nvariety of examples, including:\n\n- [Transformer language model](https://github.com/ml-explore/mlx-examples/tree/main/transformer_lm) training.\n- Large-scale text generation with\n [LLaMA](https://github.com/ml-explore/mlx-examples/tree/main/llms/llama) and\n finetuning with [LoRA](https://github.com/ml-explore/mlx-examples/tree/main/lora).\n- Generating images with [Stable Diffusion](https://github.com/ml-explore/mlx-examples/tree/main/stable_diffusion).\n- Speech recognition with [OpenAI's Whisper](https://github.com/ml-explore/mlx-examples/tree/main/whisper).\n\n## Quickstart\n\nSee the [quick start\nguide](https://ml-explore.github.io/mlx/build/html/usage/quick_start.html)\nin the documentation.\n\n## Installation\n\nMLX is available on [PyPI](https://pypi.org/project/mlx/). To install the Python API, run:\n\n**With `pip`**:\n\n```\npip install mlx\n```\n\n**With `conda`**:\n\n```\nconda install -c conda-forge mlx\n```\n\nCheckout the\n[documentation](https://ml-explore.github.io/mlx/build/html/install.html#)\nfor more information on building the C++ and Python APIs from source.\n\n## Contributing \n\nCheck out the [contribution guidelines](https://github.com/ml-explore/mlx/tree/main/CONTRIBUTING.md) for more information\non contributing to MLX. See the\n[docs](https://ml-explore.github.io/mlx/build/html/install.html) for more\ninformation on building from source, and running tests.\n\nWe are grateful for all of [our\ncontributors](https://github.com/ml-explore/mlx/tree/main/ACKNOWLEDGMENTS.md#Individual-Contributors). If you contribute\nto MLX and wish to be acknowledged, please add your name to the list in your\npull request.\n\n## Citing MLX\n\nThe MLX software suite was initially developed with equal contribution by Awni\nHannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find\nMLX useful in your research and wish to cite it, please use the following\nBibTex entry:\n\n```\n@software{mlx2023,\n author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},\n title = {{MLX}: Efficient and flexible machine learning on Apple silicon},\n url = {https://github.com/ml-explore},\n version = {0.0},\n year = {2023},\n}\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A framework for machine learning on Apple silicon.",
"version": "0.20.0",
"project_urls": {
"Homepage": "https://github.com/ml-explore/mlx"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4cccd61f731fe1ed70be3393e6b4e843da3d66d73463eff5ea9c4662638292d1",
"md5": "9a0dd1cae1561f78a729e9d36714a9f0",
"sha256": "31fb25c159d1cbfbcfe2e4259d8759abde39fe132f03e4b8ffe0c32d5de4c6a8"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp310-cp310-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "9a0dd1cae1561f78a729e9d36714a9f0",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 23775872,
"upload_time": "2024-11-05T20:44:34",
"upload_time_iso_8601": "2024-11-05T20:44:34.834474Z",
"url": "https://files.pythonhosted.org/packages/4c/cc/d61f731fe1ed70be3393e6b4e843da3d66d73463eff5ea9c4662638292d1/mlx-0.20.0-cp310-cp310-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33b6552ef1c5ead6df528dfdc05ff2386aa43d193d406f1fbc25fcaf5e01dfe4",
"md5": "a1566686404df307887c7f2daed86136",
"sha256": "0a289347e32526dfb101ddc1305af645804c2f5fae9e67f4b1ff9f362dbaa919"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp310-cp310-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "a1566686404df307887c7f2daed86136",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 23533845,
"upload_time": "2024-11-05T20:43:04",
"upload_time_iso_8601": "2024-11-05T20:43:04.843508Z",
"url": "https://files.pythonhosted.org/packages/33/b6/552ef1c5ead6df528dfdc05ff2386aa43d193d406f1fbc25fcaf5e01dfe4/mlx-0.20.0-cp310-cp310-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6f462b64f9255817c00bdb505f00265f04b429487b1ba81aac31ac22df37db0e",
"md5": "249638ff2e8d2fb53f86aed782ffd838",
"sha256": "8ecf314db6ed2b702f85b20a3f2fc675e4511a1a4ec35b5f83f7db9adb039be4"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp311-cp311-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "249638ff2e8d2fb53f86aed782ffd838",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 23776129,
"upload_time": "2024-11-05T20:43:57",
"upload_time_iso_8601": "2024-11-05T20:43:57.222856Z",
"url": "https://files.pythonhosted.org/packages/6f/46/2b64f9255817c00bdb505f00265f04b429487b1ba81aac31ac22df37db0e/mlx-0.20.0-cp311-cp311-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b121d390bf05f0c3be2d287bde88d090cc3be8fecc6f8b9a3deeb1a41bcbd009",
"md5": "24c85a3b1bbc5e9751c2c035a0334826",
"sha256": "97e43df023cb379e0c2b94a3a3f3ad92e1e41f69c0dbb9b94a503b28e00866dc"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp311-cp311-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "24c85a3b1bbc5e9751c2c035a0334826",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 23534033,
"upload_time": "2024-11-05T20:43:32",
"upload_time_iso_8601": "2024-11-05T20:43:32.751676Z",
"url": "https://files.pythonhosted.org/packages/b1/21/d390bf05f0c3be2d287bde88d090cc3be8fecc6f8b9a3deeb1a41bcbd009/mlx-0.20.0-cp311-cp311-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d083c7ca0b8cd7d1f6a7ed8ca2c4f656d25229bbb760d5437bb643e7a91cc19a",
"md5": "fc3fcf6b6af6be0da809239b6c8a6887",
"sha256": "d1274409c32e57959986a58199cf393ec7f75f5b01fc2da5928bc4cc76c3042a"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp312-cp312-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "fc3fcf6b6af6be0da809239b6c8a6887",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 23776129,
"upload_time": "2024-11-05T20:44:03",
"upload_time_iso_8601": "2024-11-05T20:44:03.929777Z",
"url": "https://files.pythonhosted.org/packages/d0/83/c7ca0b8cd7d1f6a7ed8ca2c4f656d25229bbb760d5437bb643e7a91cc19a/mlx-0.20.0-cp312-cp312-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "15168148875e9c23cc9c055bc3e72bd9c39e863bda320d9870a283c04babdf87",
"md5": "0fe8767e785607d9d9bf8624f976fe00",
"sha256": "ad037707762ea0ffe74bcf297d3a349cd151e981930b8465f951fd0fef11d365"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp312-cp312-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "0fe8767e785607d9d9bf8624f976fe00",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 23534039,
"upload_time": "2024-11-05T20:43:26",
"upload_time_iso_8601": "2024-11-05T20:43:26.713350Z",
"url": "https://files.pythonhosted.org/packages/15/16/8148875e9c23cc9c055bc3e72bd9c39e863bda320d9870a283c04babdf87/mlx-0.20.0-cp312-cp312-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "930757feaad207d1ce0d690d255cda0c35b9246911cc24f2f3c0634000ed658f",
"md5": "bddc640d7d5d0913295f4838395c5070",
"sha256": "7d6fc39d36464d07fca0469619b01eb08e6dda19610f26bbe03703079c445abf"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp313-cp313-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "bddc640d7d5d0913295f4838395c5070",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 23776068,
"upload_time": "2024-11-05T20:44:12",
"upload_time_iso_8601": "2024-11-05T20:44:12.624344Z",
"url": "https://files.pythonhosted.org/packages/93/07/57feaad207d1ce0d690d255cda0c35b9246911cc24f2f3c0634000ed658f/mlx-0.20.0-cp313-cp313-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ecb6cba81e5b0fdd20e752e1863f02ef5579bb733c23794f13c5f549de30f84d",
"md5": "0fddf51bfa92120fcd4283d9104a1b75",
"sha256": "8630277a508c58d70193dc40b87df821f51093f9baa36ee4d8984aad9f0eed91"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp313-cp313-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "0fddf51bfa92120fcd4283d9104a1b75",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 23533987,
"upload_time": "2024-11-05T20:44:06",
"upload_time_iso_8601": "2024-11-05T20:44:06.478966Z",
"url": "https://files.pythonhosted.org/packages/ec/b6/cba81e5b0fdd20e752e1863f02ef5579bb733c23794f13c5f549de30f84d/mlx-0.20.0-cp313-cp313-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4af5feed0f86b90060e05d083d7b2bbad02423381f061a176ba7d0510a1d6292",
"md5": "13c80eeba776c0bdae9d969e7171b9ad",
"sha256": "88c34853c34d669a6a5351e055cf98ef0b2c761f833003516797687c5f935bbb"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp39-cp39-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "13c80eeba776c0bdae9d969e7171b9ad",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 23776254,
"upload_time": "2024-11-05T20:44:14",
"upload_time_iso_8601": "2024-11-05T20:44:14.552763Z",
"url": "https://files.pythonhosted.org/packages/4a/f5/feed0f86b90060e05d083d7b2bbad02423381f061a176ba7d0510a1d6292/mlx-0.20.0-cp39-cp39-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "21613f45610fe3de76c71b0e334307a0a7d15246dbf5bb00fe9e5e646dbbe626",
"md5": "2acfacd57161050c2ad705a6c88c80a3",
"sha256": "342830592790a233e514ad30908739773da4526b6c4eb0d7d540e6450ebf415b"
},
"downloads": -1,
"filename": "mlx-0.20.0-cp39-cp39-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "2acfacd57161050c2ad705a6c88c80a3",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 23534239,
"upload_time": "2024-11-05T20:44:52",
"upload_time_iso_8601": "2024-11-05T20:44:52.256303Z",
"url": "https://files.pythonhosted.org/packages/21/61/3f45610fe3de76c71b0e334307a0a7d15246dbf5bb00fe9e5e646dbbe626/mlx-0.20.0-cp39-cp39-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 20:44:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ml-explore",
"github_project": "mlx",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"circle": true,
"lcname": "mlx"
}