hf_models,
hf_datasets and
hf_spaces mounts are the read half, and ls,
cat and grep are how an agent explores one without downloading it. hf is
the write half.
The three tiers
A Hub write is a commit, and a POSIX write cannot say where a commit ends, so the mount does not take one. That is the same splitgithub and git
already draw, and it gives three places rather than two:
So editing a Hub file is download, edit, upload:
hf upload batches every file of one invocation into a single commit carrying
the message the line gave it, which is exactly what a cp -r onto a mount
could not express.
Install
/m keeps the default read mode, which is all a Hub mount can offer. /work
is the mount that takes MountMode.WRITE, and that asymmetry is the workflow
above rather than an oversight: the Hub half is read-only, the local half is
where edits live.
The Hub resources need no extra: they speak the Hub API over aiohttp, which
mirage already depends on. mirage-ai[hf-buckets] is a different product, the
Xet object store behind HF Buckets.
Commands
There is no
hf auth login or logout, and that is deliberate rather than
missing: the token comes from the config the embedding program registers, so
there is nothing to log in to.
Downloads
--local-dir writes the files as themselves. Without it, hf download builds
upstream’s cache layout under --cache-dir, byte for byte:
refs/<name> is written only when the revision is a branch or tag. A
sha-pinned download writes no ref, which is what the real binary does.
--revision takes a branch, a tag or a commit sha. --include and
--exclude take globs, and --force-download refetches rather than reusing
the cached blob.