Rearchitecting Hugging Face Uploads and Downloads
Hugging Face's Xet team is replacing the Hub's direct-to-S3 uploads and CloudFront downloads with a content-addressed store (CAS) built on "dumb reads, smart writes": reads fetch reconstruction info from CAS, and writes are chunked, deduplicated and validated before reaching S3. Byte-level handling gets around CloudFront's 50GB file limit, enables format-aware dedup and compression for Parquet and Safetensors, and adds audit telemetry. Analysis of 8.2M upload requests (130.8 TB from 88 countries) in one day showed the top 7 countries produce 80% of bytes, so CAS nodes will run in three AWS regions: us-east-1 and eu-west-3 with 4 nodes each, and ap-southeast-1 with 2. Hugging Face accepts an estimated 12% drop in aggregate first-hop bandwidth, expecting other optimizations to offset it.
Related posts
- Migrating the Hub from Git LFS to Xet
Hugging Face mediumAdeptHugging Face moved 500,000 repositories and about 20 PB from Git LFS to its Xet content-addressed storage with almost no user disruption. Two pieces made that possible. A Git LFS Bridge lets older clients keep working by returning presigned URLs and reconstructing files from chunks in S3. A webhook-driven background pipeline, with an orchestrator batching files into jobs of 1,000 files or 500 MB for worker pods, migrates LFS content without locks. Scaling to multi-petabyte accounts exposed three problems: a cross-mount `/tmp` move bug that filled disks, an undersized CAS, and network/EBS I/O bottlenecks on the workers. After fixes, CAS throughput rose from about 35 Gb/s to peaks near 300 Gb/s.
- Xet is on the Hub
Hugging Face mediumAdeptHugging Face migrated its first model and dataset repositories from Git LFS to Xet storage, which uses content-defined chunking (~64 KB chunks aggregated into ~64 MB blocks) so that only changed bytes are uploaded. The migration moved 4.5 TB and ~6% of Hub download traffic in one day and exposed two production issues. First, unaligned range requests from hf_transfer forced CAS to stream whole blocks, a 4:1 read amplification. Adding chunk-length metadata to the block format fixed this and cut GET latency ~35%. Second, unflushed page cache during uploads caused disk throttling and pod load imbalance, which was mitigated with per-pod concurrent upload limits. The core lesson is that incremental migrations of real traffic surface problems test environments can't.
- From Files to Chunks: Improving HF Storage Efficiency
Hugging Face mediumAdeptHugging Face's Xet team plans to replace file-level Git LFS storage with content-defined chunking (CDC), where a rolling hash over a sliding window sets variable-size chunk boundaries and chunks are deduplicated in a content-addressed store, so edits only upload and store changed chunks. A prior XetHub benchmark on the CORD-19 dataset showed roughly 50% gains, with storage dropping from 8.9 GB to 3.52 GB and download time from 51 to 19 minutes. On two versions of GPT-2's safetensors file, CDC cut total storage by 53%. Fine-tuned models and checkpoints show 30-85% dedup ratios, which could save about 100 TB immediately, and Xet-backed repos are targeted for early 2025.
- Run AI workloads on any cloud, store on Hugging Face: zero-egress storage with SkyPilot
Hugging Face mediumAdeptSkyPilot now supports Hugging Face Storage as a first-class backend (`store: hf`), so jobs on any of 20+ clouds, Kubernetes or on-prem can mount Hub buckets (read-write) or model/dataset repos (read-only) via an `hf://` URL and an existing `HF_TOKEN`. MOUNT mode uses the `hf-mount` FUSE driver with lazy, byte-range reads and an on-disk cache. Because Hugging Face charges no egress, reads onto GPUs anywhere are free; writes still pay the compute cloud's egress. A Qwen3.5-4B fine-tune loaded the model in about 30 seconds and wrote 8.43 GB checkpoints at roughly 112-168 MB/s across AWS, GCP and Lambda, while Xet content-defined chunking deduplicates incremental checkpoints, model variants and appended Parquet data.
- From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub
Hugging Face mediumAdeptHugging Face's Xet storage backend uses content-defined chunking for deduplication but avoids per-chunk overhead by aggregating chunks into content-addressed blocks of up to 64MB and using shards to map files to chunks. That cuts CAS entries roughly 1,000x. A global index over key chunks, a 0.1% subset picked by hash modulo, exploits spatial locality to find shards for deduplication without a network query per chunk. On a 191GB repo of 29 Gemma-2-9B GGUF quantizations, only about 97GB of unique blocks were stored, nearly halving upload time. Local chunk caching also avoids re-downloading unchanged data.