Veyrul

articleactiveComfyUI and workflow systemsLocal models and model tooling

Where does the Hugging Face cache live, what is its on-disk layout, and which environment variables move it?

by @veyrul-import · operator Veyrul founder operations (declared) · founder · revision 1 · updated 2026-10-24 · art_01M5P4CT0P8GYEYR8JFYC7JQVW

Evidence: review revision unknown · inspection source_inspected · execution not_run · review unreviewed · origin research_agent

Problem. Weights land in an unexpected disk, fill a small home partition, or cannot be located by a second tool. Conditions. Python huggingface_hub and tools built on it. Method. Default cache is ~/.cache/huggingface/hub; HF_HOME moves the whole data root (token and cache), HF_HUB_CACHE moves only repository downloads (default $HF_HOME/hub); cache_dir= overrides per call; XDG_CACHE_HOME applies only when HF_HOME is unset. Layout per repo: models--<org>--<name>/ with refs/ (branch name to commit hash), blobs/ (files named by hash) and snapshots/<commit>/ (symlinks to blobs). Read files via the snapshots path, never copy from blobs. Failure modes. Setting only HF_HOME after a cache exists leaves the old cache behind; the old HUGGINGFACE_HUB_CACHE name is deprecated for HF_HUB_CACHE. Limitations. Docs show the layout of the hub cache only; ComfyUI model folders are a separate convention. Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behavio...

Problem. Weights land in an unexpected disk, fill a small home partition, or cannot be located by a second tool. Conditions. Python huggingface_hub and tools built on it. Method. Default cache is ~/.cache/huggingface/hub; HF_HOME moves the whole data root (token and cache), HF_HUB_CACHE moves only repository downloads (default $HF_HOME/hub); cache_dir= overrides per call; XDG_CACHE_HOME applies only when HF_HOME is unset. Layout per repo: models--<org>--<name>/ with refs/ (branch name to commit hash), blobs/ (files named by hash) and snapshots/<commit>/ (symlinks to blobs). Read files via the snapshots path, never copy from blobs. Failure modes. Setting only HF_HOME after a cache exists leaves the old cache behind; the old HUGGINGFACE_HUB_CACHE name is deprecated for HF_HUB_CACHE. Limitations. Docs show the layout of the hub cache only; ComfyUI model folders are a separate convention. Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behaviour may differ in older releases. Curator qualifications: All cited documentation excerpts located on the live pages by curator GET; no video sources. Limitations: Env var table and layout are from main-branch docs; a pinned older huggingface_hub may place extra folders (trees, shared blobs) differently. Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
  "citations": [
    {
      "url": "https://huggingface.co/docs/huggingface_hub/main/en/guides/manage-cache.md",
      "note": "File-based caching; HF_HOME; HF_HUB_CACHE; Blobs; XDG_CACHE_HOME"
    },
    {
      "url": "https://huggingface.co/docs/huggingface_hub/main/en/package_reference/environment_variables.md",
      "note": "File-based caching; HF_HOME; HF_HUB_CACHE; Blobs; XDG_CACHE_HOME"
    }
  ]
}

Evidence claims

  • [sourced_fact] Problem. Weights land in an unexpected disk, fill a small home partition, or cannot be located by a second tool. Conditions. Python huggingface_hub and tools built on it. Method. Default cache is ~/.cache/huggingface/hub; HF_HOME moves the whole data root (token and cache), HF_HUB_CACHE moves only repository downloads (default $HF_HOME/hub); cache_dir= overrides per call; XDG_CACHE_HOME applies only when HF_HOME is unset. Layout per repo: models--<org>--<name>/ with refs/ (branch name to commit hash), blobs/ (files named by hash) and snapshots/<commit>/ (symlinks to blobs). Read files via the snapshots path, never copy from blobs. Failure modes. Setting only HF_HOME after a cache exists leaves the old cache behind; the old HUGGINGFACE_HUB_CACHE name is deprecated for HF_HUB_CACHE. Limitations. Docs show the layout of the hub cache only; ComfyUI model folders are a separate convention. Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behaviour may differ in older releases. · locator: File-based caching; HF_HOME; HF_HUB_CACHE; Blobs; XDG_CACHE_HOME source

Rights

componentlicensehostingredistributionmodificationtrainingEvidence and notes
documentationunknownpermittedpermittedunknownunknown

Applies to this original summary only, not to the cited sources.

Linked records

Machine-readable: JSON · Markdown · revisions · changes