Skip to content

Commit 52e5f1d

Browse files
committed
Reorganized Xet docs, hopefully this renders ok
1 parent 3520a6c commit 52e5f1d

22 files changed

+321
-312
lines changed

docs/hub/_toctree.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,42 @@
5050
- local: storage-backends
5151
title: Storage Backend - Xet
5252
sections:
53-
- local: xet/index
53+
- local: xet/overview
54+
title: Xet History & Overview
55+
- local: xet/using-xet-storage
56+
title: Using Xet Storage
57+
- local: xet/deduplication
58+
title: Deduplication
59+
- local: xet/protocol/index
5460
title: Open Source Xet Protocol
5561
sections:
5662
- title: Building a client library for xet storage
5763
sections:
58-
- local: xet/upload-protocol
64+
- local: xet/protocol/upload-protocol
5965
title: Upload Protocol
60-
- local: xet/download-protocol
66+
- local: xet/protocol/download-protocol
6167
title: Download Protocol
62-
- local: xet/api
68+
- local: xet/protocol/api
6369
title: CAS API
64-
- local: xet/auth
70+
- local: xet/protocol/auth
6571
title: Authentication and Authorization
66-
- local: xet/file-id
72+
- local: xet/protocol/file-id
6773
title: Hub files conversion to Xet File ID's
6874
- title: Overall Xet architecture
6975
sections:
70-
- local: xet/chunking
76+
- local: xet/protocol/chunking
7177
title: Content-Defined Chunking
72-
- local: xet/hashing
78+
- local: xet/protocol/hashing
7379
title: Hashing Methods
74-
- local: xet/file-reconstruction
80+
- local: xet/protocol/file-reconstruction
7581
title: File Reconstruction
76-
- local: xet/xorb
82+
- local: xet/protocol/xorb
7783
title: Xorb Format
78-
- local: xet/shard
84+
- local: xet/protocol/shard
7985
title: Shard Format
80-
- local: xet/deduplication
86+
- local: xet/protocol/deduplication
8187
title: Deduplication
88+
8289
- local: repositories-pull-requests-discussions
8390
title: Pull Requests & Discussions
8491
- local: notifications

docs/hub/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Hugging Face Hub is a platform with over 1.7M models, 400k datasets, and 600
2727
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./repositories-getting-started">Getting Started</a>
2828
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./repositories-settings">Repository Settings</a>
2929
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./storage-limits">Storage Limits</a>
30-
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./storage-backends">Storage Backends</a>
30+
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./storage-backends">Storage Backend - Xet</a>
3131
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./repositories-pull-requests-discussions">Pull requests and Discussions</a>
3232
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./notifications">Notifications</a>
3333
<a class="transform no-underline! transition-colors hover:translate-x-px hover:text-gray-700" href="./collections">Collections</a>
@@ -105,7 +105,7 @@ The Hugging Face Hub is a platform with over 1.7M models, 400k datasets, and 600
105105

106106
We are helping the community work together towards the goal of advancing Machine Learning 🔥.
107107

108-
The Hugging Face Hub is a platform with over 1.7M models, 400k datasets, and 600k demos in which people can easily collaborate in their ML workflows. The Hub works as a central place where anyone can share, explore, discover, and experiment with open-source Machine Learning.
108+
The Hugging Face Hub is a platform with over 2M models, 500k datasets, and 600k demos in which people can easily collaborate in their ML workflows. The Hub works as a central place where anyone can share, explore, discover, and experiment with open-source Machine Learning.
109109

110110
No single company, including the Tech Titans, will be able to “solve AI” by themselves – the only way we'll achieve this is by sharing knowledge and resources in a community-centric approach. We are building the largest open-source collection of models, datasets, and demos on the Hugging Face Hub to democratize and advance ML for everyone 🚀.
111111

@@ -122,7 +122,7 @@ On it, you'll be able to upload and discover...
122122
- Spaces: _interactive apps for demonstrating ML models directly in your browser_
123123

124124
The Hub offers **versioning, commit history, diffs, branches, and over a dozen library integrations**!
125-
All repositories build on [Xet](https://huggingface.co/join/xet), a new technology to efficiently store Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads.
125+
All repositories build on [Xet](./storage-backends), a new technology to efficiently store Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads.
126126

127127
You can learn more about the features that all repositories share in the [**Repositories documentation**](./repositories).
128128

docs/hub/repositories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In these pages, you will go over the basics of getting started with Git and Xet
1717
- [Getting Started with Repositories](./repositories-getting-started)
1818
- [Settings](./repositories-settings)
1919
- [Storage Limits](./storage-limits)
20-
- [Storage Backends](./storage-backends)
20+
- [Storage Backend - Xet](./storage-backends)
2121
- [Pull Requests & Discussions](./repositories-pull-requests-discussions)
2222
- [Pull Requests advanced usage](./repositories-pull-requests-discussions#pull-requests-advanced-usage)
2323
- [Collections](./collections)

docs/hub/storage-backends.md

Lines changed: 10 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Storage
1+
# Xet Storage
22

33
Repositories on the Hugging Face Hub are different from those on software development platforms. They contain files that are:
44

@@ -11,118 +11,16 @@ Storing these files directly in a pure Git repository is impractical. Not only a
1111

1212
Instead, on the Hub, these large files are tracked using "pointer files" and identified through a `.gitattributes` file (both discussed in more detail below), which remain in the Git repository while the actual data is stored in remote storage (like [Amazon S3](https://aws.amazon.com/s3/)). As a result, the repository stays small and typical Git workflows remain efficient.
1313

14-
Historically, Hub repositories have relied on [Git LFS](https://git-lfs.com/) for this mechanism. While Git LFS remains supported (see the [Legacy section below](#legacy-storage-git-lfs)), the Hub has adopted Xet, a modern custom storage system built specifically for AI/ML development. It enables chunk-level deduplication, smaller uploads, and faster downloads than Git LFS.
14+
Historically, Hub repositories have relied on [Git LFS](https://git-lfs.com/) for this mechanism. While Git LFS remains supported (see [Legacy Storage using Git LFS](#legacy-storage-git-lfs)), the Hub has adopted Xet, a modern custom storage system built specifically for AI/ML development. It enables chunk-level deduplication, smaller uploads, and faster downloads than Git LFS.
1515

16-
## Xet
16+
In these pages you will get started in using Xet Storage, including the open-source Xet protocol.
1717

18-
[In August 2024 Hugging Face acquired XetHub](https://huggingface.co/blog/xethub-joins-hf), a [seed-stage startup based in Seattle](https://www.geekwire.com/2023/ex-apple-engineers-raise-7-5m-for-new-seattle-data-storage-startup/), to replace Git LFS on the Hub.
18+
## Contents
1919

20-
Like Git LFS, a Xet-backed repository utilizes S3 as the remote storage with a `.gitattributes` file at the repository root helping identify what files should be stored remotely.
20+
- [Xet History & Overview](./xet/overview)
21+
- [Using Xet Storage](./xet/using-xet-storage)
22+
- [Deduplication](./xet/deduplication)
23+
- [Open Source Xet Protocol](./xet/protocol/index)
24+
- [Backwards Compatibility & Legacy](./xet/legacy-git-lfs)
25+
- [Security](./xet/security)
2126

22-
<div class="flex justify-center">
23-
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/gitattributes-light.png"/>
24-
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/gitattributes-dark.png"/>
25-
</div>
26-
27-
A Git LFS pointer file provides metadata to locate the actual file contents in remote storage:
28-
29-
- **SHA256**: Provides a unique identifier for the actual large file. This identifier is generated by computing the SHA-256 hash of the file’s contents.
30-
- **Pointer size**: The size of the pointer file stored in the Git repository.
31-
- **Size of the remote file**: Indicates the size of the actual large file in bytes. This metadata is useful for both verification purposes and for managing storage and transfer operations.
32-
33-
A Xet pointer includes all of this information by design. Refer to the section on [backwards compatibility with Git LFS](#backward-compatibility-with-lfs) with the addition of a `Xet backed hash` field for referencing the file in Xet storage.
34-
35-
<div class="flex justify-center">
36-
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/pointer-file-light.png"/>
37-
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/pointer-file-dark.png"/>
38-
</div>
39-
40-
Unlike Git LFS, which deduplicates at the file level, Xet-enabled repositories deduplicate at the level of bytes. When a file backed by Xet storage is updated, only the modified data is uploaded to remote storage, significantly saving on network transfers. For many workflows, like incremental updates to model checkpoints or appending/inserting new data into a dataset, this improves iteration speed for yourself and your collaborators. To learn more about deduplication in Xet storage, refer to the [Deduplication](#deduplication) section below.
41-
42-
### Using Xet Storage
43-
44-
To start using Xet Storage, you need a Xet-enabled repository and a Xet-aware version of the [huggingface_hub](https://huggingface.co/docs/huggingface_hub) Python library. As of May 23rd, 2025, Xet-enabled repositories are the default [for all new users and organizations on the Hub](https://huggingface.co/changelog/xet-default-for-new-users).
45-
46-
> [!TIP]
47-
> For user and organization profiles created before May 23rd, 2025, you can make Xet the default for all your repositories by [signing up here](https://huggingface.co/join/xet). You can apply for yourself or your entire organization (requires [admin permissions](https://huggingface.co/docs/hub/organizations-security)). Once approved, all existing repositories will be automatically migrated to Xet and future repositories will be Xet-enabled by default.
48-
>
49-
> PRO users and Team or Enterprise organizations will be fast-tracked for access.
50-
51-
To access a Xet-aware version of the `huggingface_hub`, simply install the latest version:
52-
53-
```bash
54-
pip install -U huggingface_hub
55-
```
56-
57-
As of `huggingface_hub` 0.32.0, this will also install `hf_xet`. The `hf_xet` package integrates `huggingface_hub` with [`xet-core`](https://github.com/huggingface/xet-core), the Rust client for the Xet backend.
58-
59-
If you use the `transformers` or `datasets` libraries, it's already using `huggingface_hub`. So long as the version of `huggingface_hub` >= 0.32.0, no further action needs to be taken.
60-
61-
Where versions of `huggingface_hub` >= 0.30.0 and < 0.32.0 are installed, `hf_xet` must be installed explicitly:
62-
63-
```bash
64-
pip install -U hf-xet
65-
```
66-
67-
And that's it! You now get the benefits of Xet deduplication for both uploads and downloads. Team members using a version of `huggingface_hub` < 0.30.0 will still be able to upload and download repositories through the [backwards compatibility provided by the LFS bridge](#backward-compatibility-with-lfs).
68-
69-
To see more detailed usage docs, refer to the `huggingface_hub` docs for:
70-
71-
- [Upload](https://huggingface.co/docs/huggingface_hub/guides/upload#faster-uploads)
72-
- [Download](https://huggingface.co/docs/huggingface_hub/guides/download#hfxet)
73-
- [Managing the `hf_xet` cache](https://huggingface.co/docs/huggingface_hub/guides/manage-cache#chunk-based-caching-xet)
74-
75-
#### Recommendations
76-
77-
Xet integrates seamlessly with the Hub's current Python-based workflows. However, there are a few steps you may consider to get the most benefits from Xet storage:
78-
79-
- **Use `hf_xet`**: While Xet remains backward compatible with legacy clients optimized for Git LFS, the `hf_xet` integration with `huggingface_hub` delivers optimal chunk-based performance and faster iteration on large files.
80-
- **Utilize `hf_xet` environment variables**: The default installation of `hf_xet` is designed to support the broadest range of hardware. To take advantage of setups with more network bandwidth or processing power read up on `hf_xet`'s [environment variables](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#xet) to further speed up downloads and uploads.
81-
- **Leverage frequent, incremental commits**: Xet's chunk-level deduplication means you can safely make incremental updates to models or datasets. Only changed chunks are uploaded, so frequent commits are both fast and storage-efficient.
82-
- **Be Specific in .gitattributes**: When defining patterns for Xet or LFS, use precise file extensions (e.g., `*.safetensors`, `*.bin`) to avoid unnecessarily routing smaller files through large-file storage.
83-
- **Prioritize community access**: Xet substantially increases the efficiency and scale of large file transfers. Instead of structuring your repository to reduce its total size (or the size of individual files), organize it for collaborators and community users so they may easily navigate and retrieve the content they need.
84-
85-
#### Current Limitations
86-
87-
While Xet brings fine-grained deduplication and enhanced performance to Git-based storage, some features and platform compatibilities are still in development. As a result, keep the following constraints in mind when working with a Xet-enabled repository:
88-
89-
- **64-bit systems only**: The `hf_xet` client currently requires a 64-bit architecture; 32-bit systems are not supported.
90-
- **Git client integration (git-xet)**: Planned but remains under development.
91-
92-
### Deduplication
93-
94-
Xet-enabled repositories utilize [content-defined chunking (CDC)](https://huggingface.co/blog/from-files-to-chunks) to deduplicate on the level of bytes (~64KB of data, also referred to as a "chunk"). Each chunk is identified by a rolling hash that determines chunk boundaries based on the actual file contents, making it resilient to insertions or deletions anywhere in the file. When a file is uploaded to a Xet-backed repository using a Xet-aware client, its contents are broken down into these variable-sized chunks. Only new chunks not already present in Xet storage are kept after chunking, everything else is discarded.
95-
96-
To avoid the overhead of communicating and managing at the level of chunks, new chunks are grouped together in [64MB blocks](https://huggingface.co/blog/from-chunks-to-blocks#scaling-deduplication-with-aggregation) and uploaded. Each block is stored once in a content-addressed store (CAS), keyed by its hash.
97-
98-
The Hub's [current recommendation](https://huggingface.co/docs/hub/storage-limits#recommendations) is to limit files to 20GB. At a 64KB chunk size, a 20GB file has 312,500 chunks, many of which go unchanged from version to version. Git LFS is designed to notice only that a file has changed and store the entirety of that revision. By deduplicating at the level of chunks, the Xet backend enables storing only the modified content in a file (which might only be a few KB or MB) and securely deduplicates shared blocks across repositories. For the large binary files found in Model and Dataset repositories, this provides significant improvements to file transfer times.
99-
100-
For more details, refer to the [From Files to Chunks](https://huggingface.co/blog/from-files-to-chunks) and [From Chunks to Blocks](https://huggingface.co/blog/from-chunks-to-blocks) blog posts, or the [Git is for Data](https://www.cidrdb.org/cidr2023/papers/p43-low.pdf) paper by Low et al. that served as the launch point for XetHub prior to being acquired by Hugging Face.
101-
102-
### Open Source Xet Protocol
103-
104-
The Xet storage backend is built on an open source protocol that enables efficient, chunk-based storage and retrieval of large files. This protocol provides the foundation for the deduplication and performance benefits described throughout this documentation.
105-
106-
For detailed technical specifications about the Xet protocol, including API endpoints, authentication mechanisms, chunking algorithms, and file reconstruction processes, see the [Xet Protocol Specification](./xet/index).
107-
108-
### Backward Compatibility with LFS
109-
110-
Xet storage provides a seamless transition for existing Hub repositories. It isn't necessary to know if the Xet backend is involved at all. Xet-backed repositories continue to use the Git LFS pointer file format; the addition of the `Xet backed hash` is only added to the web interface as a convenience. Practically, this means existing repos and newly created repos will not look any different if you do a `bare clone` of them. Each of the large files (or binary files) will continue to have a pointer file that matches the Git LFS pointer file specification.
111-
112-
This symmetry allows non-Xet-aware clients (e.g., older versions of the `huggingface_hub`) to interact with Xet-backed repositories without concern. In fact, within a repository a mixture of Git LFS and Xet backed files are supported. The Xet backend indicates whether a file is in Git LFS or Xet storage, allowing downstream services to request the proper URL(s) from S3, regardless of which storage system holds the content.
113-
114-
Within the Xet architecture, backward compatibility for downloads is achieved by the Git LFS bridge. While a Xet-aware client will receive file reconstruction information from CAS to download the Xet-backed file, a legacy client will get a single URL from the bridge which does the work of reconstructing the request file and returning the URL to the resource. This allows downloading files through a URL so that you can continue to use the Hub's web interface or `curl`.
115-
116-
Meanwhile, uploads from non‑Xet‑aware clients still follow the standard Git LFS path, even if the file is already Xet-backed. Once the file is uploaded to LFS, a background process automatically migrates the content, turning it into a Xet-backed revision. Coupled with the Git LFS bridge, this lets repository maintainers and the rest of the Hub adopt Xet at their own pace without disruption.
117-
118-
### Security Model
119-
120-
Xet storage provides data deduplication over all chunks stored in Hugging Face. This is done via cryptographic hashing in a privacy sensitive way. The contents of chunks are protected and are associated with repository permissions. i.e. you can only read chunks which are required to reproduce files you have access to, and no more. See [xet-core](https://github.com/huggingface/xet-core) for details.
121-
122-
## Legacy Storage: Git LFS
123-
124-
The legacy storage system on the Hub, Git LFS utilizes many of the same conventions as Xet-backed repositories. The Hub's Git LFS backend is [Amazon Simple Storage Service (S3)](https://aws.amazon.com/s3/). When Git LFS is invoked, it stores the file contents in S3 using the SHA hash to name the file for future access. This storage architecture is relatively simple and has allowed Hub to store millions of models, datasets, and spaces repositories' files (45PB total as of this writing).
125-
126-
The primary limitation of Git LFS is its file-centric approach to deduplication. Any change to a file, irrespective of how large of small that change is, means the entire file is versioned - incurring significant overheads in file transfers as the entire file is uploaded (if committing to a repository) or downloaded (if pulling the latest version to your machine).
127-
128-
This leads to a worse developer experience along with a proliferation of additional storage.

0 commit comments

Comments
 (0)