Using Xet Storage

Python

To access a Xet-aware version of the huggingface_hub, simply install the latest version:

pip install -U huggingface_hub

As of huggingface_hub 0.32.0, this will also install hf_xet. The hf_xet package integrates huggingface_hub with xet-core, the Rust client for the Xet backend.

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.

Where versions of huggingface_hub >= 0.30.0 and < 0.32.0 are installed, hf_xet must be installed explicitly:

pip install -U hf-xet

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.

To see more detailed usage docs, refer to the huggingface_hub docs for:

Git

Git users can access the benefits of Xet by downloading and installing the Git Xet extension. Once installed, simply use the standard workflows for managing Hub repositories with Git - no additional changes necessary.

Prerequisites

Install Git and Git LFS.

Install on macOS or Linux (amd64 or aarch64)

Install using an installation script with the following command in your terminal (requires curl and unzip):

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/main/git_xet/install.sh | sh

Or, install using Homebrew, with the following tap (direct brew install coming soon):

brew tap huggingface/tap
brew install git-xet
git-xet install

To verify the installation, run:

git-xet --version

Windows (amd64)

Using an installer:

Manual installation:

To verify the installation, run:

git-xet --version

Using Git Xet

Once installed on your platform, using Git Xet is as simple as following the Hub’s standard Git workflows.

Make sure all prerequisites are installed and configured, follow the setup instructions for working with repositories on the Hub, then commit your changes, and push to the Hub:

# Create any files you like! Then...
git add .
git commit -m "Uploading new models"  # You can choose any descriptive message
git push

Under the hood, the Xet protocol is invoked to upload large files directly to Xet storage, increasing upload speeds through the power of chunk-level deduplication.

Uninstall on macOS or Linux

Using Homebrew:

git-xet uninstall
brew uninstall git-xet

If you used the installation script (for MacOS or Linux), run the following in your terminal:

git-xet uninstall
sudo rm $(which git-xet)

Uninstall on Windows

If you used the installer:

If you manually installed:

Recommendations

Xet integrates seamlessly with all of the Hub’s workflows. However, there are a few steps you may consider to get the most benefits from Xet storage.

When uploading or downloading with Python:

When uploading or downloading in Git or Python:

Current Limitations

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:

Update on GitHub