Configure storage modes: HF Cache vs Local Directory
masterThe tool supports two distinct storage strategies for downloaded models.
Mode 1: HuggingFace Cache (Default)
Files are stored in the standard ~/.cache/huggingface/ structure. This is a dual-layer system:
- Layer 1 (
hub/): The standard content-addressed HF cache. Python libraries liketransformersanddiffusersfind these automatically. - Layer 2 (
models/): A human-readable view using symlinks to the blobs in Layer 1.
Note for Windows users: Layer 2 requires Administrator or Developer Mode to create symlinks. If not enabled, files will still download to Layer 1, but the readable paths in Layer 2 won't exist.
Mode 2: Flat Files (Local Directory)
If you want real files in a specific folder without symlinks or blob hashes, use --local-dir. This is ideal for tools like llama.cpp or ollama, or for Windows users without elevated privileges.
Usage
# Default (HF Cache)
hfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# Local directory (Flat files)
hfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF --local-dir ./my-model
# Legacy syntax (identical to --local-dir)
hfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF --legacy -o ./my-modelhfdownloader download TheBloke/Mistral-7B-Instruct-v0.2-GGUF --local-dir ./my-model