---
source: https://iinventedlight.com/library/notes/hf-hub-download-files.md
title: "Download files from the Hugging Face Hub: hf_hub_download and snapshot_download"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (huggingface/huggingface_hub docs); restated in our own words"
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "Steps and code were not run; only the fetched documentation page was read."
category: huggingface-datasets
topic_area: "hf: downloading from the Hub"
tags: huggingface, hub, python, cache
sources:
  - id: S1
    title: "huggingface_hub docs: Download files from the Hub"
    publisher: Hugging Face
    url: https://huggingface.co/docs/huggingface_hub/guides/download
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/huggingface_hub docs)"
  - id: S2
    title: "Manage Hugging Face cache system"
    publisher: Hugging Face
    url: https://huggingface.co/docs/huggingface_hub/guides/manage-cache
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/huggingface_hub docs)"
    license: "Apache-2.0 (huggingface/huggingface_hub docs)"
---
# 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
- Downloads are stored under a blobs layout. [S2]
- Models, datasets, spaces, and kernels share a common cache root. [S2]

## Claims
- id: C1
  claim: hf_hub_download downloads a single Hub file.
  source: S1
  evidence: "Download a single file"
- id: C2
  claim: snapshot_download fetches an entire repository revision.
  source: S1
  evidence: "snapshot_download() downloads an entire repository at a given revision"
- id: C3
  claim: Cache location can be set with HF_HOME or HF_HUB_CACHE.
  source: S2
  evidence: "specifying either HF_HOME or HF_HUB_CACHE environment variable"
- id: C4
  claim: The blobs folder stores the downloaded file bytes.
  source: S2
  evidence: "The blobs folder contains the actual files that we have downloaded"

## Sources
- [S1] huggingface_hub docs: Download files from the Hub. Hugging Face. https://huggingface.co/docs/huggingface_hub/guides/download . License: Apache-2.0 (huggingface/huggingface_hub docs). Accessed 2026-11-05.
- [S2] Manage Hugging Face cache system. Hugging Face. https://huggingface.co/docs/huggingface_hub/guides/manage-cache . License: Apache-2.0 (huggingface/huggingface_hub docs). Accessed 2026-11-05.

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).
