This guide documents the steps needed to download HuggingFace models (especially MLX models) correctly on Mac OS.
Install the required tools
pip install huggingface_hub hf_transfer
brew install git-lfs
Enable accelerated downloads
export HF_HUB_ENABLE_HF_TRANSFER=1
This makes HuggingFace downloads much faster using parallel connections.
Set up your local model storage
Create a clean folder structure for storing MLX models:
mkdir -p ~/Models/MLX
cd ~/Models/MLX
Example structure:
~/Models/MLX/
├── mistral-7b-instruct-v0.3-4bit/
├── phi-2/
├── smolvlm-256m/
Initialize Git LFS
After installing git-lfs, you must initialize it:
git lfs install
Why? Git needs to know how to handle large files (like model weights) separately from normal, small text files.
Verify installation:
git lfs --version
Download and clone a model
Move any old partial downloads if necessary:
mv mistral-7b-instruct-v0.3-4bit mistral-7b-instruct-v0.3-4bit-old
Clone the model repo cleanly:
git clone https://huggingface.co/mlx-community/Mistral-7B-Instruct-v0.3-4bit mistral-7b-instruct-v0.3-4bit
Go into the model folder:
cd mistral-7b-instruct-v0.3-4bit
Pull the actual large model weights:
git lfs pull
This downloads all .mlx weights, tokenizer files, and configs.
Example of the final model path
After successful download:
~/Models/MLX/mistral-7b-instruct-v0.3-4bit/
├── config.json
├── model-00001-of-00002.safetensors
├── model-00002-of-00002.safetensors
├── tokenizer.json
├── tokenizer_config.json
├── special_tokens_map.json
└── ...
Important tips
- Avoid folders with spaces (e.g., use
mistral-7b-instruct, notMistral 7B Instruct). - Always use
git lfs pullafter cloning! - Store models in
~/Models/MLX/for clean organization. - If cloning fails, move old folders aside first.
Related tools
Respectfully,
Uki D. Lucas https://x.com/ukidlucas