Skip to content
RAG Repo

The Stack v1 / v2

The Stack is BigCode's open dataset of source code. Version 1 collects permissively licensed files scraped from GitHub, filtered so that only code under licences such as MIT and Apache is included. Duplicate and near-duplicate files are removed, so you are not storing the same snippet many times over.

Version 2 is a step up in scale. It uses Software Heritage, a long-term archive of public code, as its source and spans 600+ programming languages. Both versions are published on Hugging Face as Parquet files, and you can stream them or download them in full.

For RAG, The Stack is useful as a retrieval corpus for code assistants and as pretraining data for code models such as StarCoder. Because it tracks the original repository licences, it is a safer starting point than a raw GitHub scrape if you care about the terms attached to the code you index.

source-codepermissive-licencepretrainingbigcodededuplicationmultilingual-code

Related sources