hf cache rm removes an individual cached file
Introduced 2026-09-17 · score 0.98
HOW TO USE IT
When you need to remove one exact cached file while keeping the repo cache usable, pass its `hf://` file URI to `hf cache rm`; it removes that file from every cached revision and deletes its blob only when no other cached file references it. The path must be exact, and file targets cannot be mixed with repository or revision targets.
hf cache rm hf://models/<owner>/<repo>/<exact-file-path> --dry-runWHY THIS HELPS
Remove one cached file such as a GGUF quantization while keeping the rest of its repository cache usable.
REQUIREMENTS AND LIMITATIONS
- Version: v1.32.0
- TARGETS... (required): One or more repo IDs, `hf://` URIs, or revision hashes to delete; for this task, use one exact `hf://` file URI.
- --dry-run: Preview deletions without removing anything.
- --cache-dir TEXT: Cache directory to scan; defaults to the Hugging Face cache.
- -y, --yes: Skip the confirmation prompt.
- Paths must match exactly; folders and glob patterns are not supported.
- File targets cannot be mixed with repositories or revisions in the same call.
- `@revision` in `hf://` URIs is rejected.
- Refs and snapshot folders are kept.
- A deleted file is downloaded again the next time it is needed.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.32.0
- https://github.com/huggingface/huggingface_hub/pull/4847
- https://huggingface.co/docs/huggingface_hub/v1.32.0/guides/manage-cache
- https://huggingface.co/docs/huggingface_hub/package_reference/cli
Check the installed version and the source before using it. Entry JSON