---
title: "From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub"
description: "Hugging 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."
url: "https://swe.quest/articles/from-chunks-to-blocks-accelerating-uploads-and-downloads-on-the-hub-0403426cd59197cb"
canonical: "https://huggingface.co/blog/from-chunks-to-blocks"
source: "Hugging Face"
published: "2025-02-12"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 9
tags: ["storage-systems","ml-platform","data-structures","performance"]
---

# From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-02-12, 9 min read, Deep dive. Original: [https://huggingface.co/blog/from-chunks-to-blocks](https://huggingface.co/blog/from-chunks-to-blocks)

## Summary

Hugging 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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Data structures](https://swe.quest/tags/data-structures.md) (Architecture & design)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- content-addressed storage
- hashing basics

## Keywords

Xet, hf\_xet, xet-core, Hugging Face Hub, content-defined chunking, GGUF

## Related posts

- [From Files to Chunks: Improving HF Storage Efficiency](https://swe.quest/articles/from-files-to-chunks-improving-hf-storage-efficiency-389481ed0fa30735.md): Hugging Face · 2024-11-20 · Medium · 5 min read · Storage systems, Algorithms, Version control, Cost optimization
  Hugging 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.
- [Xet is on the Hub](https://swe.quest/articles/xet-is-on-the-hub-31527082840b41cc.md): Hugging Face · 2025-03-18 · Medium · 9 min read · Storage systems, Performance engineering, Load balancing, Scaling
  Hugging 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.
- [Rearchitecting Hugging Face Uploads and Downloads](https://swe.quest/articles/rearchitecting-hugging-face-uploads-and-downloads-9e61a9e3c6d67f4e.md): Hugging Face · 2024-11-26 · Medium · 7 min read · Storage systems, System design, CDN & edge, Cloud platforms, Capacity planning
  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.
- [Migrating the Hub from Git LFS to Xet](https://swe.quest/articles/migrating-the-hub-from-git-lfs-to-xet-20a0038190c32d42.md): Hugging Face · 2025-07-15 · Medium · 9 min read · Storage systems, Schema migrations, Scaling, ML platforms
  Hugging Face moved 500,000 repositories and about 20 PB from Git LFS to its Xet content-addressed storage with almost no user disruption.
- [Scaling data ingestion for machine learning training at Meta](https://swe.quest/articles/scaling-data-ingestion-for-machine-learning-training-at-meta-87e5966270af4276.md): Meta Engineering · 2022-09-19 · Medium · 11 min read · ML platforms, Data pipelines, Performance engineering, Storage systems, Recommendations & ranking
  Meta's disaggregated Data PreProcessing tier (DPP) reads training data from the Tectonic file system, decodes it, extracts features and turns it into tensors for ML training.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
