hf-xet

Rust-powered Python bindings enabling fast, chunk-deduplicated file transfer with the Hugging Face Hub.

Library
PyPI
v1.6.0
602 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
86 /100 Excellent
Development Activity 92
Maintenance 100
Community 68
Maturity 44
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 84
Code Quality 85
Innovation 82
Learning Curve 55

hf-xet is the Python package (Rust core with PyO3 bindings, built via maturin) that gives huggingface_hub access to Xet storage, Hugging Face’s chunk-based deduplication transport for the Hub. Instead of transferring and storing whole files, Xet splits models and datasets into content-defined chunks, deduplicates chunks shared across versions or files, and only transfers what has actually changed, with a local chunk-based disk cache layered alongside huggingface_hub’s existing cache.

The package is not designed to be used directly by application code; it is pulled in automatically as a dependency of huggingface_hub and activated transparently whenever a repository on the Hub is Xet-enabled, handling concurrent network communication with HF’s Content-Addressed Storage (CAS) backend behind the scenes. It ships as a compiled Rust extension for each supported platform, with a companion git-xet CLI (Git LFS-compatible) and WebAssembly-target support so downstream browser SDKs like hf-hub can also depend on the same core crates.

What You Get

  • Chunk-based deduplication that skips retransferring and restoring content shared across files, models, and dataset versions
  • A compiled Rust core (PyO3/maturin bindings) delivering high-throughput concurrent uploads and downloads to Hugging Face’s Xet CAS backend
  • A local chunk-based disk cache that layers alongside huggingface_hub’s existing cache for faster repeat access
  • Backwards compatibility with Git LFS semantics, plus a standalone git-xet CLI and WebAssembly build target for browser-based consumers

Common Use Cases

  • Transparently accelerating huggingface_hub uploads and downloads of large model weights and dataset files without any user-facing configuration
  • Reducing bandwidth and storage costs for teams repeatedly pushing incremental checkpoints of large models to the Hub
  • Powering browser-based Hub integrations (e.g. hf-hub) that need the same chunking/dedup logic compiled to WebAssembly
  • Git-LFS-compatible workflows via the git-xet CLI for repositories that mix traditional Git tooling with Xet storage

Under The Hood

Architecture - xet-core is a Rust workspace split into focused crates: xet_pkg (published as the hf-xet crate) exposes the high-level session API, xet_client handles HTTP communication with Xet CAS backend services, xet_data implements the chunking/deduplication/reconstruction pipeline, xet_core_structures defines shared types like MerkleHash and Xorb objects, and xet_runtime provides the async runtime, config, and logging infrastructure. The hf_xet/ directory wraps these crates with PyO3 bindings (py_file_download_handle.rs, py_upload_commit.rs, py_xet_session.rs, etc.) compiled via maturin into the hf-xet PyPI wheel that huggingface_hub imports.

Tech Stack - Overwhelmingly Rust (94.5% of the codebase), using pyo3 with abi3-py38 for stable-ABI Python bindings across versions 3.8+, maturin as the Python build backend, and a WebAssembly target (wasm32-unknown-unknown) so browser consumers can reuse the same crates via wasm-bindgen/tokio_with_wasm shims. A small Python test suite (hf_xet/tests/) exercises the compiled extension’s upload/download/session/progress APIs directly.

Code Quality - The workspace uses cargo test/cargo bench for the Rust core and cargo clippy -D warnings for linting, with CI enforcing a clean WebAssembly build in addition to native targets. The README goes further than most, documenting platform-specific diagnostic scripts (scripts/diag/) for collecting stack traces and core dumps when hf-xet misbehaves in production, and explicit patterns (conditional ?Send, web_time::Instant, filesystem gating) that wasm-reachable code must follow — evidence of a codebase actively guarding against regressions across its unusually wide target matrix.

API Design - hf-xet is explicit that it ‘is not meant to be used directly’ — its Python API exists purely to be called by huggingface_hub, so developer experience is optimized for that one integration point rather than general usability, with a narrow set of async session, upload, and download handle types instead of a broad public surface.

Used by 6 apps in this directory

Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 4 days ago
Python
92%
Apache 2.0

ART

AI Development

10,779

Give your LLM agents on-the-job training—ART lets you apply GRPO reinforcement learning to any multi-step agentic workflow with minimal code changes.

View details
85
Repo Health
82
Technical
73
Dependency
Built with
Python 92%
Updated 5 days ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,047

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
62
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 6 days ago
Python
73%
Apache 2.0

timesfm

AI Development · Analytics

33,870

A pretrained decoder-only foundation model by Google Research that delivers zero-shot time series forecasting with calibrated quantile prediction intervals — no training required.

View details
78
Repo Health
81
Technical
71
Dependency
Built with
Python 73%
HTML 14%
Jupyter Notebook 12%
Updated 2 weeks ago
Python
73%
Apache 2.0

Unsloth

AI Assistants · AI Development

76,886

Run and fine-tune LLMs, diffusion, audio and embedding models on your own hardware, from a native desktop app, a browser UI, or a Python library.

View details
89
Repo Health
83
Technical
70
Dependency
Built with
Python 73%
TypeScript 21%
Updated 4 days ago
AGPL 3.0

VoiceStudio

Mcp · Music Audio · Voice AI

50,643

Open-source, fully local ElevenLabs alternative for voice cloning, voice design, video dubbing, dictation, transcription and audiobooks, with a local API and MCP server for agents.

View details
84
Repo Health
83
Technical
70
Dependency

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers