The Stack v3
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.
Related sources
DevDocs
An open-source aggregator that pulls API documentation for major programming languages, frameworks, and tools into one searchable place. A tidy RAG source when you want up-to-date developer reference material without scraping dozens of separate documentation sites yourself.
GitHub Public Repositories (GH Archive / GHTorrent)
Two projects that capture public GitHub activity for analysis. GH Archive records the public GitHub event timeline as downloadable hourly archives, and GHTorrent offers a queryable mirror of GitHub metadata. Together they help you mine code, issues, pull requests, and documentation at scale.
RefineCode (OpenCoder)
A reproducible code pretraining corpus of roughly 960 billion tokens spanning about 607 programming languages, built with a published cleaning pipeline. It is the pretraining data behind the OpenCoder code models.
Software Heritage
A non-profit universal archive built specifically for software source code, preserving not just files but their full development history. Over 27 billion unique source files collected from public repositories, each identified by a cryptographic hash. The upstream source for The Stack v2.