Credentials. Uploading uses your Hugging Face credentials and publishes the model; check the original model's license allows redistribution.
Who it is forA developer who wants a smaller, faster version of a model that has no MLX build yet.
The problemFull precision models are too large to run comfortably on most Macs.
The outcomeA quantized MLX model saved locally in mlx_model, and optionally uploaded to your Hub repo.
What you need first
- 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
Steps
- Install with
pip install mlx-lm - Quantize from the command line with
mlx_lm.convert --model mistralai/Mistral-7B-Instruct-v0.3 -q - Add --upload-repo with your target repo name to publish the result to Hugging Face
- Or do it in Python with convert(repo, quantize=True, upload_repo=upload_repo)
- Run the converted model with mlx_lm.generate --model pointing at it
Prompt for your agent
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.
Caveat. This card is written from the ml-explore/mlx-lm README, not from a test run by Deduped. Before you start, make sure you have a Mac with Apple silicon. Check the repo for newer instructions before you rely on these steps.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for ml-explore/mlx-lm and "Quantize a model and publish it for MLX"
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 freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer