Skip to content
RAG Repo

Supersedes The Stack v2.

The Stack v3 is a very large source code corpus published in 2026 by Hugging Face's code research team, building on the data filtering, personal-information detection and governance work established by BigCode for earlier editions. It is the current-generation successor to The Stack v2 and comes in two parts. The near-deduplicated training subset (stack-v3-train) holds about 15.9TB of source and notebook code across 713 programming languages, drawn from roughly 173M repositories, and is reported at around 3.6 trillion tokens after leaked exact duplicates were removed in the v3.1 patch (the initial v3.0 figure was about 4.9 trillion). A separate unfiltered full corpus (stack-v3-full) runs much larger, at roughly 113.7TB across 770 languages, and is served as a Hugging Face storage bucket rather than a standard dataset repository.

Access is simpler than v2. Unlike earlier editions, which pointed at the Software Heritage archive, v3 was crawled directly from GitHub at default-branch HEAD and embeds the decoded UTF-8 file contents in the dataset itself, so there is no separate fetch step. The training subset is distributed as Parquet and loads with the datasets library, including streaming, or can be queried in place with DuckDB or Polars. The crawl completed on 7 August 2025, so the corpus reflects GitHub as of that date.

For RAG and AI work it is a strong pretraining and retrieval base for code assistants, letting you index real implementations across an unusually broad language range. It suits teams building or fine-tuning code models at scale.

On licensing, the dataset is released under the Open Data Commons Attribution Licence (ODC-By) v1.0, which requires attribution, but each file still carries the licence of its original repository, so commercial use must honour thousands of upstream terms rather than a single permissive headline. Developers can check inclusion and request removal through the Am I in The Stack space. Compared with our the-stack-v2 and the-stack entries, this is the newest and largest edition.

source-codepretrainingbigcodehugging-facemultilingual-codenotebooksgithub-crawl

Related sources