Skip to main content
A Hugging Face Storage Bucket mounts as a tree of files, with every / in a file’s path as a folder.

Setup

  1. Create a bucket at huggingface.co/new-bucket: pick the owner (an account or an organization), a name and the visibility. The bucket’s id is <owner>/<name>, for example my-user/my-data.
  2. Create a token at huggingface.co/settings/tokens: Read for a read mount, Write to upload. A fine-grained token needs read access, or write access to upload, on the bucket’s namespace.

Connect

workspace.yaml

Layout

  • A folder exists only while it holds a file, so mkdir creates nothing. key_prefix (keyPrefix in TypeScript) mounts one folder as the root.
  • mv and rmdir are not supported. grep -r, find and du stop after 1000 files; a glob matching more, tar -c, cp -r and rm -r are refused.
  • TypeScript runs it in Node only, with the opendal package installed. Python needs the hf-buckets extra.

Sample runs

On a write mount, cp, > and rm change the bucket in place. A bucket keeps no history, so a removed file is gone for good.

SDK guides

Python

Every config field, the VFS.md and write support.

TypeScript

Every config field, the VFS.md and write support.