← All notes

Hugging Face Hub: download files and cache

Short answer

hf_hub_download fetches one Hub file into the local cache; snapshot_download fetches a whole repo revision. Override the cache with cache_dir, HF_HOME, or HF_HUB_CACHE. [S1][S2]

Points

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: Hugging Face Hub library documentation, Apache License 2.0 (https://github.com/huggingface/huggingface_hub/blob/main/LICENSE).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Hugging Face, huggingface_hub docs: Download files from the Hub, Apache-2.0 (huggingface/huggingface_hub docs); Hugging Face, Manage Hugging Face cache system, Apache-2.0 (huggingface/huggingface_hub docs).

Cite this

Permanent ID: iil:note:5gdnmxgs

iinventedlight. 2026. "Download files from the Hugging Face Hub: hf_hub_download and snapshot_download." iinventedlight Library, iil:note:5gdnmxgs, version of 2026-11-04. https://iinventedlight.com/library/notes/hf-hub-download-files/. License: CC-BY-4.0.

@misc{iil_note_5gdnmxgs,
  author = {{iinventedlight}},
  title = {{Download files from the Hugging Face Hub: hf\_hub\_download and snapshot\_download}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/hf-hub-download-files/},
  note = {Permanent ID iil:note:5gdnmxgs. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/hf-hub-download-files.md.