hf-cache-reader
hf-cache-reader reads the standard Hugging Face cache layout without making
network requests. It is synchronous, read-only, and has no runtime
dependencies.
The crate understands repositories, snapshots, refs, nested files, and shared content-addressed blobs. It does not download, modify, prune, or interpret model files.
use ;
To inventory every supported repository type in a cache:
Cache location
resolve_cache_dir() uses this precedence:
HF_HUB_CACHEHUGGINGFACE_HUB_CACHE$HF_HOME/hub$XDG_CACHE_HOME/huggingface/hub$HOME/.cache/huggingface/hub$USERPROFILE/.cache/huggingface/hub- The platform temporary directory under
huggingface/hub
An explicit path passed to scan_cache or scan_repo is preferable when an
application already owns cache configuration.
Layout
The reader recognizes the standard layout documented by Hugging Face:
<cache>/
models--<owner>--<name>/
refs/<ref>
snapshots/<commit>/<file>
blobs/<content>
Dataset, Space, and Kernel repositories use the corresponding datasets,
spaces, and kernels prefixes.
Malformed or dangling entries below a readable cache root are reported as
ScanWarning values. A missing cache directory is treated as an empty cache.