/ds/.
All reads are lazy: only the bytes you actually cat/head get transferred.
For credential setup, see HF Datasets Setup.
Install
Config
HfDatasetsConfig takes repo_id in namespace/dataset-name form plus an
optional access token. Public datasets need no token.
Reading, not writing
This mount is read-only, the way agithub mount is. A Hub write is
a commit, and a POSIX write cannot say where a commit ends, so echo >,
rm, cp and mv are refused here rather than silently making one commit
per file. The hf CLI is the write half: hf download --local-dir
puts a copy on a ram or disk mount, which is an ordinary writable filesystem,
and hf upload sends it back as a single commit.
Filesystem Layout
Maps dataset repo files to virtual paths under the mount prefix. For example, if datasetAlienKevin/SWE-ZERO-12M-trajectories contains:
/ds/ exposes:
Example
Shell Commands
Every read command in HF Buckets’ set works here, as do the text processing and path utilities, which only read. What does not is the File Operations group: this mount is read-only, sorm and touch are refused, as is any command asked to write into it.
Cache
UsesIndexCacheStore with index_ttl = 600 (10 minutes). Directory
listings are cached and populate file-size/type entries for stat’s fast
path, so a readdir + per-entry stat (which ls, FUSE getattr, and
most shell commands trigger) costs one HTTP request instead of N.
Use Cases
- AI agents inspecting datasets: Mount, browse the README, read byte ranges from large shards without downloading the whole dataset
- Dataset triage:
ls,stat,findto see what’s in a repo before committing to a full local copy - Sandboxed access: Pin a
revisionfor reproducibility