[Spaces]: add Spaces attached volumes documentation#2377
Conversation
Document the attached volumes feature for Spaces, including how volumes are displayed in the Space page dropdown and the access-aware filtering that masks private repository sources for unauthorized viewers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address review feedback: merge the redundant sections into a single "Attached Volumes" section and remove the separate configure note. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| <img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-attached-volumes-light.png"/> | ||
| <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-attached-volumes-dark.png"/> |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davanstrien
left a comment
There was a problem hiding this comment.
Holding off on approval until clarifying API vs UI cc @kefranabg
The new section says "Spaces can mount Storage Buckets and Hugging Face repositories (models, datasets, other Spaces) as volumes", which is accurate based on the huggingface_hub API but looking at the actual Space settings UI today, I only see "Mount a bucket" — there's no UI option to mount a model, dataset, or Space as a volume IIUC?
Question for @kefranabg: is repo volume mounting intended to be exposed in the UI, or is it API-only by design? Think we can document either here but we should be careful of what we suggest is possible via UI vs huggingface_hub or API.
Yes currently you cannot mount a model/dataset/space via the UI. However if you've mounted a model/dataset/space via
|
|
@mishig25 might be worth making clearer what is possible to do via UI/ |
|
please do |
Split how-to-attach into per-type bullets: buckets via UI or API, repos via huggingface_hub Python API. Add read-only rule for repo volumes. Update intro to mention repos alongside buckets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
pushed some suggested wording @mishig25 |
Addresses julien-c review: keep the main "Attached Volumes" section focused on Storage Buckets, and move models/datasets/other Spaces into a dedicated "Mounting models, datasets, and other Spaces" section with the read-only API-only wording.
| [Storage Buckets](./storage-buckets) are the recommended way to persist data in your Space. You can attach a bucket when creating a Space or from the Space settings later. The bucket is mounted into your Space and can be used to store files that persist across restarts. | ||
| [Storage Buckets](./storage-buckets) are the recommended way to persist data in your Space. Attached buckets are mounted into the Space container at the path you specify, making their contents available as local files at runtime. | ||
|
|
||
| Buckets can be attached when creating a Space, from the Space settings UI, or programmatically via the [`huggingface_hub`](/docs/huggingface_hub/guides/manage-spaces#mount-volumes-in-your-space) Python API. They can be mounted read-write (the default) or read-only. |
There was a problem hiding this comment.
potentially could put a code snippet in this page as well (so agents can do it)
|
ok this works probably :) Buckets can be attached when creating a Space, from the Space settings UI, or programmatically via the huggingface_hub Python API. They can be mounted read-write (the default) or read-only. |
|
related PR here to make it easier for agents/humans to discover code examples huggingface/huggingface_hub#4108. Think that is probably sufficient vs adding more snippets here for now? |



Summary
docs/hub/spaces-storage.md)https://moon-ci-docs.huggingface.co/docs/hub/pr_2377/en/spaces-storage
🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes describing how to attach and view volumes; no product code or behavior is modified.
Overview
Updates
docs/hub/spaces-storage.mdto reframe persistent storage as attached volumes, detailing how Storage Buckets mount into the Space container (RW/RO) and how volumes are shown in the Space actions dropdown.Adds documentation for mounting models/datasets/other Spaces as read-only volumes via the
huggingface_hubAPI, including UI behavior for private repo sources being masked for unauthorized viewers.Reviewed by Cursor Bugbot for commit 13282a2. Bugbot is set up for automated code reviews on this repo. Configure here.