Decision: Verify the installed huggingface_hub version, cache layout and actual filesystem usage before cleaning; use only cache commands documented for that version, and do not manually delete blobs or snapshots. If usage still grows after cleanup, or model files must live alongside application data for the long term, plan storage from observed growth before changing servers.
This guide is for developers downloading models through Hugging Face Hub and operators maintaining containerized inference services.
It is also for team leads deciding whether to reclaim existing cache space or plan persistent model storage.
Last updated November 7, 2026. We checked the Hugging Face Hub release history, the versioned cache documentation, and the cache management guide. A reported mismatch in a GitHub issue is an individual user report, not evidence that all installations have the same problem.
Start by measuring the filesystem, not guessing at cache size
A cache tool and a filesystem command can describe different things. A cache listing may account for models, snapshots and shared files according to the Hub cache layout. A filesystem tool reports what it can see at a path and may include files outside the Hub cache. Container mounts, separate users and different cache roots can widen the gap further.
First, identify the filesystem that contains the cache and check its free space:
df -h /path/to/cache
du -x -h -d 1 /path/to/cache
Replace /path/to/cache with the path used by the running service. On systems where the installed du does not support these options, use its local manual page and choose equivalent options for reporting a directory total on one filesystem. Do not treat the sample commands as proof that a particular path is the active cache.
Then compare the directory report with the Hub’s own cache listing:
hf cache ls
Run both checks on the host or inside the same container and under the same user that downloads or loads the models. A command run as an administrator may inspect a different home directory from a service running under a dedicated account.
Why can the Hugging Face cache directory look larger than hf cache ls reports? The two tools may be looking at different paths or users; the directory may contain unrelated files; or the cache may include shared content that is accounted for differently in a listing. The GitHub issue linked above documents a user’s report of a discrepancy. Treat it as a lead to investigate, not a general rule or a guaranteed bug.
Also compare df and du before drawing conclusions. df reports filesystem-level space use, while du walks a directory tree. Files outside the cache, filesystem metadata, open-but-deleted files and mount boundaries can affect the comparison. If the filesystem is nearly full but the cache directory does not explain the use, inspect other directories and running processes before pruning model data.
Operations note: Save the command output and the time of the check before cleanup. If the numbers change later, the before-and-after record helps distinguish recovered cache space from unrelated writes.
Confirm the client version and every active cache path
The shared-blob behavior documented for huggingface_hub v1.32.0 makes version checking part of the diagnosis, not an administrative detail. The v1.32.0 release notes record cross-repository shared-blob caching, while the cache reference for that release explains cache entries and shared-file accounting. Do not assume that a command’s output or a cache layout described for this release applies unchanged to an older client.
Check the package in the environment that actually runs the service:
python -c "import huggingface_hub; print(huggingface_hub.__version__)"
If the application runs in a container, run the check inside that container. Checking the host’s Python environment instead can report a version that the application never uses. You can also inspect the installed CLI’s help before relying on an operation:
hf --help
hf cache ls --help
hf cache prune --help
The versioned CLI reference is the source to consult for commands supported by that release. If the local help differs from the documentation, stop and resolve the version mismatch before running a cleanup command.
Next, inspect the environment variables and mounts for the application process:
env | grep -E '^(HF_HOME|HF_HUB_CACHE|HF_XET_CACHE)='
The official environment-variable reference documents how HF_HOME, HF_HUB_CACHE and HF_XET_CACHE affect storage locations. The documented defaults place Hub data under the Hugging Face home cache; a service can override these paths, so do not infer the active location from a user’s home directory alone.
| Check | What to record | Why it matters |
|---|---|---|
| Package version | huggingface_hub version from the service environment |
Cache layout and available CLI behavior are version-dependent |
| Cache variables | HF_HOME, HF_HUB_CACHE and HF_XET_CACHE, when set |
Downloads and related data may not be under the path being measured |
| Runtime identity | Service user and its home directory | A different user can maintain a separate cache |
| Container mounts | Host source, container destination and whether the mount persists | A cache inside a replaceable container layer may not be the host path you expected |
| Filesystem view | df and directory usage for the active cache path |
Separates cache accounting from overall filesystem pressure |
How should you interpret shared blobs after huggingface_hub v1.32.0? Check the release notes and matching cache documentation, then compare the cache tool’s result with the actual path used by the service. Shared content can be referenced across repositories, so a per-repository view should not automatically be added together as if every entry were a separate physical copy. Older clients may not report or arrange cache data in the same way. If shared-blob use fails or the client falls back to another cache path, verify that behavior against the installed version’s documentation and the process environment rather than assuming the new layout is active.
Identify references and incomplete downloads before pruning
A cache is not just a pile of files. It can contain repository snapshots, blob data shared by references, and files associated with downloads that did not finish. A filename or directory name alone does not tell you whether a running service still depends on its contents.
Use the cache commands supported by the installed version to inspect entries and identify what the tool considers removable. The cache management guide describes the supported inspection and cleanup workflow for that release. Read the current command help as well, especially if the installation is not on the documented version.
Record the model repository and revision used by each service. A deployment pinned to a specific revision may need an older snapshot even when a newer revision is available. Check configuration files, environment settings, launch scripts and service logs; do not infer that a model is unused just because a developer no longer sees it in an interactive session.
Can hf cache prune remove files another model still needs? Do not use it as a substitute for checking references. The safe decision depends on what the installed tool identifies as removable and whether the application has files outside the cache tool’s view. Review the command’s proposed effect and the version-specific documentation before confirming. If a model revision is still part of a deployment, preserve it or move the service through a controlled update before removing that revision.
For an interrupted download, inspect the cache tool’s view and the relevant download location first. The Hub cache can include incomplete-download data, but a partially written file is not, by itself, proof that it is stale. Confirm that no active process is downloading or consuming it, then use the documented cleanup operation for the installed version. Avoid a generic rm command aimed at incomplete filenames: it can bypass the cache’s own relationship tracking and may race with an active download.
| Evidence found | Safer next action | Avoid |
|---|---|---|
| A revision is referenced by a running service | Keep it, or plan a service update before removal | Deleting its snapshot based only on age |
| The cache tool identifies content as removable | Review the tool’s action and confirm the affected entries | Assuming every listed item is disposable |
| A download appears incomplete | Check for active download processes, then use documented cleanup | Removing files by matching a guessed filename |
| The cache listing and directory report disagree | Check user, version, environment and mounts | Treating either result as a complete explanation |
| Storage pressure remains outside the cache path | Find the other consumers of the filesystem | Pruning Hub data that is unrelated to the pressure |
Clean in a controlled window and verify the service afterward
Once the active paths, client version and model revisions are recorded, use only the inspection and removal commands documented for that version. The versioned cache guide documents cache management; command behavior can change, so confirm the installed CLI’s help before acting. In particular, do not copy a command from a newer guide into an older environment without checking compatibility.
A safe cleanup sequence is:
- [ ] Record the service user, package version, relevant environment variables and cache mount.
- [ ] Save the filesystem and cache-tool reports before changing files.
- [ ] Check active deployments for pinned model repositories and revisions.
- [ ] Review the installed version’s help and the matching official cache guide.
- [ ] Select only entries confirmed as unused or removable by the supported workflow.
- [ ] Run cleanup when no deployment or download operation depends on the files being changed.
- [ ] Recheck the filesystem and cache listing using the same user and paths.
- [ ] Load the model through the real service and confirm that it reads the expected revision.
What proves that cleanup worked? The same filesystem and cache checks show a change, and the application can still load the model version it is configured to use. A lower cache listing alone is not enough: it does not establish that the container mount is persistent, that the service uses that path, or that a pinned model remains available.
After cleanup, check service logs for missing files or unexpected downloads. If the service downloads a model again immediately, the apparent space recovery may be temporary, or the application may be using a different cache root than the one cleaned. If the cache tool and filesystem still disagree, repeat the path, user and mount checks before trying another deletion.
Caution: Do not remove
blobsorsnapshotsmanually as a general cleanup method. Shared references and repository snapshots mean that deleting a directory by name can break a model that is still in use.
Plan persistent storage from measured growth
Separate a temporary cleanup problem from a storage-planning problem. An incomplete download that can be safely removed is different from a model library that grows as deployments pin new revisions. Long-lived application data, vector indexes, logs and model files may also compete for the same filesystem even when Hub cache behavior is correct.
For a containerized service, decide where the cache should persist before moving it. Set the documented cache variables deliberately, map the intended directory to persistent storage, and check ownership and permissions under the service user. The environment-variable reference is the authority for variable behavior; the container runtime’s mount configuration determines whether the chosen path survives container replacement. Test that behavior with a controlled restart rather than assuming a directory is persistent because it exists inside the container.
Estimate capacity using your own inventory, not a generic model-size threshold. Record current cache use, application data, indexes, logs and free filesystem space. Track the change across normal download and deployment cycles, including whether old revisions are retained. That evidence gives you a defensible storage requirement and exposes whether growth comes from duplicated content, retained revisions or unrelated services.
If you use a shared VPS or public-cloud instance, compare its disk limits, billing model and storage persistence with the actual usage pattern. Shared CPU resources, changing instance storage arrangements and charges tied to storage or traffic can complicate a long-running self-hosted model service. A dedicated AMD physical server is a better fit when you need an exclusive machine for persistent model files and application data, and when the workload justifies managing a server rather than using a short-lived, lightly loaded instance. It is not the right choice for a brief test or a workload that needs rapid automatic scaling.
Before choosing a server, compare your measured storage demand with the current options listed by mbpscloud; do not assume that a cache cleanup problem automatically requires a larger machine. If the workload has moved beyond testing and you are comparing recurring hosting costs, review how billing works and verify the current product details before ordering. For stable, long-running services that need exclusive compute and persistent storage, an AMD bare-metal server can be more appropriate than a shared VPS—but the decision should follow the measured cache and data growth, not a directory-size discrepancy alone.
Further reading
Choose mbpscloud AMD Bare Metal for Growing Model Caches
Run cache-heavy workloads on a dedicated AMD EPYC server with 32 cores and 64 threads.
