How to get a model from HuggingFace on Mac OS

-

1 minute read

Abstract

A short, practical guide for anyone who wants to download MLX models from Hugging Face and run them locally on a Mac. I install the Hugging Face hub tools and Git LFS, turn on faster parallel downloads, and set up a clean folder for models. Then I clone a Mistral 7B Instruct model and pull the large weight files that a plain clone leaves behind. I show what the finished folder should look like and close with tips, such as avoiding spaces in folder names.

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, not Mistral 7B Instruct).
  • Always use git lfs pull after cloning!
  • Store models in ~/Models/MLX/ for clean organization.
  • If cloning fails, move old folders aside first.

Respectfully,

Uki D. Lucas https://x.com/ukidlucas