mlx-lm
brew install mlx-lm
v0.31.3_2
MIT
Run LLMs with MLX
1.1k
30-day installs · #1240
2.8k
90-day · #1403
5.0k
365-day · #1943
6.0k
★ GitHub stars · updated 2mo ago
Runtime dependencies
Build dependencies
GitHub topics
llms
mlx
Links
- https://github.com/ml-explore/mlx-lm
- GitHub: ml-explore/mlx-lm
- Brew formula source: Formula/m/mlx-lm.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"pkgconf",
"rust"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [
"certifi",
"libyaml",
"mlx",
"numpy",
"protobuf",
"python@3.14",
"sentencepiece"
],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Run LLMs with MLX",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:41:24+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "mlx-lm",
"github_default_branch": "main",
"github_last_commit_at": "2026-06-12T22:12:31Z",
"github_readme_excerpt": "## MLX LM \n\nMLX LM is a Python package for generating text and fine-tuning large language\nmodels on Apple silicon with MLX.\n\nSome key features include:\n\n* Integration with the Hugging Face Hub to easily use thousands of LLMs with a\n single command. \n* Support for quantizing and uploading models to the Hugging Face Hub.\n* [Low-rank and full model\n fine-tuning](https://github.com/ml-explore/mlx-lm/blob/main/mlx_lm/LORA.md)\n with support for quantized models.\n* Distributed inference and fine-tuning with `mx.distributed`\n\nThe easiest way to get started is to install the `mlx-lm` package:\n\n**With `pip`**:\n\n```sh\npip install mlx-lm\n```\n\n**With `conda`**:\n\n```sh\nconda install -c conda-forge mlx-lm\n```\n\n### Quick Start\n\nTo generate text with an LLM use:\n\n```bash\nmlx_lm.generate --prompt \"How tall is Mt Everest?\"\n```\n\nTo chat with an LLM use:\n\n```bash\nmlx_lm.chat\n```\n\nThis will give you a chat REPL that you can use to interact with the LLM. The\nchat context is preserved during the lifetime of the REPL.\n\nCommands in `mlx-lm` typically take command line options which let you specify\nthe model, sampling parameters, and more. Use `-h` to see a list of available\noptions for a command, e.g.:\n\n```bash\nmlx_lm.generate -h\n```\n\nThe default model for generation and chat is\n`mlx-community/Llama-3.2-3B-Instruct-4bit`. You can specify any MLX-compatible\nmodel with the `--model` flag. Thousands are available in the\n[MLX Community](https://huggingface.co/mlx-community) Hugging Face\norganization.\n\n### Python API\n\nYou can use `mlx-lm` as a module:\n\n```python\nfrom mlx_lm import load, generate\n\nmodel, tokenizer = load(\"mlx-community/Mistral-7B-Instruct-v0.3-4bit\")\n\nprompt = \"Write a story about Einstein\"\n\nmessages = [{\"role\": \"user\", \"content\": prompt}]\nprompt = tokenizer.apply_chat_template(\n messages, add_generation_prompt=True,\n)\n\ntext = generate(model, tokenizer, prompt=prompt, verbose=True)\n```\n\nTo see a description of all the arguments you can do:\n\n```\n\u003e\u003e\u003e help(generate)\n```\n\nCheck",
"github_repo": "ml-explore/mlx-lm",
"github_stars": 5984,
"github_topics": [
"llms",
"mlx"
],
"homepage": "https://github.com/ml-explore/mlx-lm",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 1123,
"installs_365d": 4964,
"installs_90d": 2753,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": null,
"llm_model": null,
"name": "mlx-lm",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 1240,
"rank_365d": 1943,
"rank_90d": 1403,
"raw_hash": "bc4b6acdf4dfde5b",
"recommended_dependencies": [],
"revision": 2,
"ruby_source_path": "Formula/m/mlx-lm.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.31.3",
"versioned_formulae": [],
"why_use_this": null
}