bodaay/HuggingFaceModelDownloader
Simple go utility to download HuggingFace Models and Datasets
🤖 HuggingFace Model Downloader (hfdownloader)
What it is – A fast, parallel, and proxy‑aware command‑line tool (written in Go) for pulling models, datasets, LoRAs, Diffusers pipelines, etc. from the HuggingFace Hub. It stores files in the standard HF cache so existing Python libraries (transformers, diffusers, llama.cpp bindings…) can find them automatically, while also offering a human‑readable view via symlinks/hardlinks.
Why you might care – Large model files can be dozens of gigabytes. hfdownloader:
- Splits each file into up to 16 parallel connections and can download 8 files at once, dramatically reducing wall‑clock time.
- Resumes automatically after interruptions and verifies LFS files with SHA‑256.
- Provides an interactive GGUF picker that shows quality stars, RAM estimates, and a “recommended” quantization, making it easy to choose the right version of a quantized model.
- Works behind corporate firewalls with full HTTP/SOCKS5 proxy support, authentication, and CIDR bypass rules.
- Offers a web UI (real‑time progress, cache browser, mirror sync, settings) for users who prefer a graphical interface.
- Includes mirror sync to push/pull a local cache to NAS, USB drives, or other machines – handy for air‑gapped or team environments.
How you get it
- One‑liner install (no sudo):
bash <(curl -sSL https://g.bodaay.io/hfd) install - Pre‑built binaries for Linux, macOS, and Windows are on the GitHub Releases page.
- Build from source with Go 1.25+:
go build -o hfdownloader ./cmd/hfdownloader - Docker image
ghcr.io/bodaay/huggingfacemodeldownloader(mount your~/.cache/huggingfaceto keep the cache).
Typical command‑line workflow
# See what a repo contains (interactive GGUF picker)
hfdownloader analyze -i TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# Download a specific quantization (or multiple)
hfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF:q4_k_m
# Or download everything with maximum parallelism
hfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF -c 16 --max‑active 8
# Export already‑cached files as plain directories (for llama.cpp, Ollama, etc.)
hfdownloader export TheBloke/Mistral-7B-Instruct-v0.2-GGUF ~/models/mistral
# Start the web UI (http://localhost:8080)
hfdownloader serve
Key concepts
- Storage Mode 1 – HF cache (default) – Files live under
~/.cache/huggingface/hub/…(content‑addressed blobs) plus a human‑readable symlink tree under~/.cache/huggingface/models/. Python tools just work. - Storage Mode 2 – Flat directory – Use
--local-dir <path>or the legacy-o <dir>to get a plain<owner>/<repo>/folder with real files, useful for tools that don’t understand the HF cache layout. - Manifest (
hfd.yaml) – Every download writes a tiny YAML file describing repo, commit, selected files, size, and the exact command used.hfdownloader listandhfdownloader infolet you query this metadata. - Proxy configuration – Can be passed per‑command (
--proxy …) or stored in~/.config/hfdownloader.yaml. - Mirror sync – Define named targets (
hfdownloader mirror target add office /mnt/nas/hf-models) and thenpush,pull, ordiffto keep caches in sync.
Who should use it
- Researchers or engineers who regularly pull large GGUF, GPTQ, or Diffusers models.
- Teams in corporate networks needing robust proxy handling.
- Users of Windows or macOS who want the convenience of the HF cache without dealing with symlink quirks.
- Anyone who prefers a web dashboard for monitoring downloads and managing a shared model cache.
License – Apache 2.0 (free for personal and commercial use).
Quick links
Related
- Dispatch
- Project
- Dispatch
- Project
- Dispatch