Repository navigation
cli: tensorfold rm removes a cached checkpoint, or one snapshot with the refs naming it and the blobs only it links to - #3525
Merged
Merged
Conversation
ashhart
added a commit
that referenced
this pull request
Nov 16, 2026
5 tasks done
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
ashhart
force-pushed
the
lead/cli-rm
branch
2 times, most recently
from
November 17, 2026 14:35
d905486 to
4b471f8
Compare
…the refs naming it and the blobs only it links to It lists each snapshot and the bytes freed, then asks on a terminal; --yes skips the question, --dry-run only lists, and without a terminal it refuses unless --yes. It takes only a cached repo id, deletes only inside that repo's cache folder, never follows a link out of it, and refuses a repo folder that is itself a link. Hard links and copies count once per file, so a Windows cache without symlinks frees what it reports. pull's revision check moves to hub.zig so rm accepts the same refs and commits.
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today the only way to free a checkpoint
tensorfold pullcached is to delete folders under the Hugging Face cache by hand.tensorfold rm REPO[@REVISION] [--yes] [--dry-run]does it safely.What this changes
tensorfold rm REPO: removes every snapshot, blob and ref of REPO, then itsmodels--ORG--NAMEfolder.tensorfold rm REPO@REVISION: removes one snapshot.main,pr/1) or a 40-hex commit, looked up in the cache only, never on the hub..no_exist/<commit>notes.The printout before deleting: each snapshot with its refs, any link pointing outside the folder, the counts, and the bytes freed.
Confirmation: on a terminal it asks
Remove? [y/N]on stderr, so a redirected stdout can't hide the question.--yesskips the question and--dry-runonly prints. With stdin not a terminal and no--yes, it refuses and names--yes.Safety:
.., absolute paths and anything that isn't a repo id are refused (exit 2).tensorfold modelsor listing the snapshots and refs held.Order: refs first, then the snapshot's entries, then unshared blobs, then empty folders. An interrupted run never leaves a ref pointing at a half-removed snapshot, and running it again finishes.
What stays: TensorFold's own files inside a snapshot (
.tensorfold-original, rollback files,.tensorfold/) go with it. Nothing outside the repo folder is touched:~/.cache/tensorfold/packs, which are keyed by content and rebuild on demand;.locks.The README says so.
Issue: n/a. This came from the 16 Nov check of competitor gap docs against main: five tools ship a remove command, and
zig/src/cli/cli.zighad none.Stacked on: main. It merges cleanly with pull: gated and private repos come down with a Hugging Face token, sent only to the hub's own host #3524 except for the usual CHANGELOG line (trial merge, 16 Nov).
atc overlap --json: to run after review.Follow-up: refuse while a running server has the snapshot open. Servers already take a shared lock on the snapshot folder, but that code sits in a module the CLI doesn't import. On macOS and Linux, a served model keeps running from the unlinked files; the docs say to stop the server first.
Checks on this head
tools/pr_check.py: 0 errors, 1 advisory warning).zig build test-rm-host(new step on macOS, Linux and Windows): 13/13.zig build test-cli: 48/63 (15 existing info and plan tests skip as before).zig build test-pull-host test-pull-security: 43/43.pull's revision check moved intohub.zigunchanged, sormaccepts the same names.zig build test-golden: 322/335 equal, 0 unexpected differences.zig build test-cuda-host: 6777/6817 (40 skipped).zig build check-native-cuda-host: passes, and it failed on a type error planted in thermbranch.zig build native -Dcpu=apple_m1,zig fmt --check,git diff --check: clean...;.no_exist.modelsbefore and after, a dry run, the piped-stdin refusal, the path refusal,@main --yes, and a pseudo-terminal answering the prompt.test-rm-host, and its link tests skip there if the runner can't create symlinks), and a real multi-GB cache.Receipt
n/a: a CLI cache command that can't reach inference. Host checks are above.
Checklist
The title and description match the head commit.
New tests fail before the change, pass after it, and skip cleanly without their dependency.
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Synthena (Ash's Agent)