---
title: "From Files to Chunks: Improving HF Storage Efficiency"
description: "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."
url: "https://swe.quest/articles/from-files-to-chunks-improving-hf-storage-efficiency-389481ed0fa30735"
canonical: "https://huggingface.co/blog/from-files-to-chunks"
source: "Hugging Face"
published: "2024-11-20"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 5
tags: ["storage-systems","algorithms","version-control","cost-optimization"]
---

# From Files to Chunks: Improving HF Storage Efficiency

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-11-20, 5 min read, Deep dive. Original: [https://huggingface.co/blog/from-files-to-chunks](https://huggingface.co/blog/from-files-to-chunks)

## Summary

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

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)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)
- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- hashing basics
- Git LFS

## Keywords

content-defined chunking, Git LFS, Xet, Hugging Face Hub, safetensors, rolling hash, content-addressed storage

## Related posts

- [From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub](https://swe.quest/articles/from-chunks-to-blocks-accelerating-uploads-and-downloads-on-the-hub-0403426cd59197cb.md): Hugging Face · 2025-02-12 · Medium · 9 min read · Storage systems, ML platforms, Data structures, Performance engineering
  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.
- [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.
- [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.
- [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.
- [Parquet Content-Defined Chunking](https://swe.quest/articles/parquet-content-defined-chunking-87ef6600fb11e475.md): Hugging Face · 2025-07-25 · Medium · 16 min read · Storage systems, Data pipelines, Python, Algorithms
  Parquet Content-Defined Chunking, now available in PyArrow and Pandas via the use\_content\_defined\_chunking option, writes Parquet data pages so that small logical edits produce minimal byte-level differences.

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)
