What do you want to do?
3 use cases
-
Chat with an open LLM locally on your Mac
Install MLX LM and generate text or open a chat REPL with any MLX-compatible model from the Hub.
View prompt
Using ml-explore/mlx-lm on my Mac, install it, run mlx_lm.chat with a model from mlx-community that fits in <RAM> GB, and tell me the tokens per second it reports.
-
Quantize a model and publish it for MLX
Convert a Hugging Face model to a 4-bit MLX model and optionally upload it to the Hub.
View prompt
With ml-explore/mlx-lm, quantize <model id> to 4-bit using mlx_lm.convert -q, test it with mlx_lm.generate, and upload it to <my HF repo> with --upload-repo.
-
Ask many questions about one long document quickly
Cache a long prompt once with mlx_lm.cache_prompt and reuse it for each new question.
View prompt
Using ml-explore/mlx-lm, cache <document> with mlx_lm.cache_prompt into a safetensors file, then answer these questions one by one with mlx_lm.generate --prompt-cache-file: <questions>.
Quick start with MLX LM
- Check you have what it needs: A Mac with Apple silicon; Python with pip or conda; macOS 15 or later to speed up models that are large relative to RAM.
- Open ml-explore/mlx-lm on GitHub and read the README and license.
- Install with
pip install mlx-lmorconda install -c conda-forge mlx-lm - Generate text with
mlx_lm.generate --prompt "How tall is Mt Everest?" - Start a chat REPL that keeps context for its lifetime with mlx_lm.chat
- Pick another model with --model, for example
mlx_lm.generate --model mistralai/Mistral-7B-Instruct-v0.3 --prompt "hello"
These steps come from our top use case, Chat with an open LLM locally on your Mac, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for ml-explore/mlx-lm
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forMac users and developers who want to run, quantize or fine-tune open LLMs locally on Apple silicon.
- Why it is hot7.5k stars, talked about in 2 AI sources we track
- LanguagePython
- Sourcegithub.com/ml-explore/mlx-lm ยท Back to Hot repos
Requirements
- A Mac with Apple silicon
- Python with pip or conda
- macOS 15 or later to speed up models that are large relative to RAM
- Optional: a Hugging Face account to upload converted models
Add this badge to your README
Maintain MLX LM? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/ml-explore-mlx-lm/?utm_source=github&utm_medium=badge&utm_campaign=ml-explore-mlx-lm)
HTML
<a href="https://dedupedai.com/use-cases/ml-explore-mlx-lm/?utm_source=github&utm_medium=badge&utm_campaign=ml-explore-mlx-lm"><img src="https://dedupedai.com/badge/ml-explore/mlx-lm.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about MLX LM
What is MLX LM?
MLX LM is a Python package for generating text and fine-tuning large language models on Apple silicon with MLX. It runs thousands of models from the Hugging Face Hub with a single command, quantizes and uploads models, supports low-rank and full fine-tuning including quantized models, distributed inference and fine-tuning with mx.distributed, and tools for long prompts such as a rotating KV cache and prompt caching. It is an open-source project on GitHub: https://github.com/ml-explore/mlx-lm.
How do I use MLX LM?
Install with pip install mlx-lm or conda install -c conda-forge mlx-lm; then generate text with mlx_lm.generate --prompt "How tall is Mt Everest?"; start a chat REPL that keeps context for its lifetime with mlx_lm.chat. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is MLX LM for?
Mac users and developers who want to run, quantize or fine-tune open LLMs locally on Apple silicon.
What can I do with MLX LM?
3 use cases so far, for example: Chat with an open LLM locally on your Mac; Quantize a model and publish it for MLX; Ask many questions about one long document quickly. Each has steps and a copy-paste agent prompt.
What do I need to run MLX LM?
A Mac with Apple silicon; Python with pip or conda; macOS 15 or later to speed up models that are large relative to RAM; Optional: a Hugging Face account to upload converted models.
What are alternatives to MLX LM?
Other hot AI repos in Software and DevOps: ECC, Thinkrail, Superpowers, Deep Infer, Instructor.
Is MLX LM safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.