DataPacts

The Stack

Checked

At a glance

The Stack is a dataset of source code from public repositories, released for training code language models, first by the BigCode project in 2022 and most recently as The Stack v3 in 2026.

Independent reference. Every buyer is covered on the same terms, every figure carries its source and check date, and no buyer pays to be listed or placed higher.

Request an independent introduction

Tell us what data your company holds. We reply with the buyers that fit and what their terms leave out. Your details reach a buyer only after you agree to a named introduction.

IndependentYour details stay with us until you agreeNot selling is a valid outcome

It exists in three versions: v1 was built from GitHub repositories named in GH Archive, v2 from the Software Heritage archive, and v3 from a direct GitHub crawl that completed on August 7, 2025.

Every version filters code by license instead of paying or asking its authors, and each lets developers check for and remove their code. This page reads The Stack from the side of the people whose code it holds: within AI training data licensing, it is code selected by license, the unpaid counterpart to licensed code.

Who Builds The Stack: BigCode, Its Two Host Companies and the v3 Publisher

The Stack v1 and v2 were built by BigCode, an open scientific collaboration that ServiceNow and Hugging Face jointly lead, and The Stack v3 is published by Hugging Face's HuggingFaceCode organization. The table lists the identity facts as of 2026-11-17.

Attribute Value Source
Builder of v1 and v2 BigCode, open scientific collaboration; no separate legal entity named bigcode-project.org
Leadership jointly led by Hugging Face and ServiceNow under a research collaboration agreement arXiv 2312.03872
Publisher of v3 HuggingFaceCode organization on Hugging Face; the card calls v3 the successor to v2 huggingface.co
Host Hugging Face, Inc. (Delaware corporation) huggingface.co/terms-of-service
Papers arXiv 2211.15533 (v1, 2022-11-20); arXiv 2402.19173 (v2 and StarCoder2, 2024-02-29) arxiv.org
Governance card arXiv 2312.03872, 2023-12-06 arxiv.org
Models trained on it StarCoder (v1); StarCoder2 3B, 7B and 15B (v2.0.1), weights under an OpenRAIL license arxiv.org; huggingface.co
Participants 675 participants from 62 countries, as of 2023-05-04 arXiv 2312.03872

BigCode names no legal entity, so it is written here as a collaboration. The governance card says ServiceNow handled the data collection, and Hugging Face, Inc. hosts the files. The v3 card is published under HuggingFaceCode, so v3 is not written here as a BigCode release.

The Stack v1, v2 and v3: Sources, Cutoffs, Sizes and Languages

Each version of The Stack is a new collection rather than an update: v1 reflects GitHub up to 2022, v2 the Software Heritage archive of September 2023, and v3 a GitHub crawl completed on August 7, 2025.

The table sets the three versions side by side as their papers and cards describe them, as of 2026-11-17, each figure from the source named in its row.

Version Released (repository created) Source of code Cutoff Full size Deduplicated Languages Source
v1 2022-10-03 (paper 2022-11-20) GitHub repositories named in GH Archive events 2015-01-01 to 2022-03-31; files fetched Nov 2021 to Jun 2022 6.4 TB (BigCode page); paper: 3.1 TB permissive, 30 languages 2.9 TB (v3 card); 1.4 TB for v1.0 (paper) 358 (from v1.1) arXiv 2211.15533; bigcode/the-stack card; bigcode-project.org
v2 2024-02-26 (paper 2024-02-29) Software Heritage archive, metadata from GH Archive SWH graph 2023-09-06; GH Archive to 2023-09-14 67.5 TB 32.1 TB 658 (card); 619 (paper); 618 (v3 card) bigcode/the-stack-v2 card; arXiv 2402.19173
v3 2026-07-23 direct GitHub crawl; list from GH Archive and SWH origins (2025-05-18) crawl completed 2025-08-07 113.7 TB, 770 languages 99.3 TB 713 (training subset) HuggingFaceCode/stack-v3-train card

v1 started from 220.92 million repository names in GH Archive events, of which 137.36 million were still public. v2 took 3.28 billion unique files from 104.2 million repositories.

The v3 crawl list joins GH Archive with Software Heritage's origin table and covers 224 million repositories and 43.9 billion files, as source code and notebooks only. v2 releases file identifiers only, with the contents in Software Heritage's storage; v3 carries the text inline.

A text corpus that took the openly licensed part of Stack V2 is the Common Pile.

Why Sizes for The Stack Differ Between Papers and Cards

The Stack has no single size, because each paper and card counts a different stage: all files, permissively licensed files, deduplicated files or a training subset.

For v1, the paper's title says 3 TB and its text says 3.1 TB of permissively licensed code in 30 languages, cut from over 29 TB of all-license data with roughly 10 % kept, and 1.4 TB after near-deduplication.

The card's changelog gives v1.0 as "3TB" near-deduplicated and v1.1 as "6TB", while BigCode's page says 6.4 TB.

For v2, the card gives 67.5 TB in full and 32.1 TB deduplicated. It counts 658 languages, the paper counts 619, and the v3 card's comparison table says 618. Training tokens are "~900B" on the v2 card and "~550B tokens" in the v3 card.

For v3, the card's summary gives a 15.9 TB training subset in 713 languages from 173 million repositories, about 3.6 trillion tokens, while the same card's comparison table gives the training set as 11.5 TB.

The full corpus is 113.7 TB in 770 languages. Version v3.1 removed leaked exact duplicates, taking the token count from 4.9 to 3.6 trillion. No figure here is averaged or merged.

The Permissive License Filter in The Stack and What Each Version Kept

The Stack keeps code whose license BigCode classes as permissive, meaning it places minimal restrictions on copying, modifying and redistributing, and excludes copyleft code such as the GPL. The table shows what each version detected, kept and excluded, as of 2026-11-17.

Version License detection Kept Excluded Source
v1.0 GH Archive (about 12 %), go-license-detector 18 licenses, incl. MPL, EPL, LGPL then labeled permissive repositories with no detected license (about 81 %); copyleft such as GPL arXiv 2211.15533; v1 card
v1.1 to v1.3 same 193 permissive licenses MPL, EPL, LGPL as weak copyleft v1 card
v2 GH Archive (repo license missing for 96.93 %), ScanCode per file permissive (Blue Oak Council plus ScanCode Permissive and Public Domain) and unlicensed files non-permissive files arXiv 2402.19173; v2 card
v3 ScanCode per file, propagated by directory permissive and no_license non_permissive v3 card

In v1, GH Archive supplied a license for about 12 % of repositories, and go-license-detector found none for about 81 %, which were excluded. A file counted if at least one repository holding it was permissive.

MPL, EPL and LGPL were first labeled permissive and were removed in v1.1 as weak copyleft, when the list grew from 18 to 193 licenses.

In v2 and v3, ScanCode detects licenses per file, and the allowlist is the Blue Oak Council list plus ScanCode's "Permissive" and "Public Domain" categories.

The v2 paper states that the main difference from v1 is that "we include both permissively licensed and unlicensed files". v3 labels each file permissive or no_license and drops only non_permissive files.

Code with no license stays in v2 and v3 although no license grants permission, an observation and not a legal finding. The cards say license attribution is only as accurate as the detection tools. How copyleft and permissive families matter for a company's own codebase is covered under open-source license contamination when licensing a codebase.

Terms of Use for The Stack and the ODC-By License on v3

The Stack v1 and v2 sit behind a click-through gate with terms of use, while The Stack v3 is open access under the Open Data Commons Attribution License v1.0.

The v1 terms say any use must follow the code's original licenses, "including attribution clauses when relevant", with provenance given per file. Users agree to move to the most recent usable version, and anyone re-hosting must pass the terms on.

The v2 terms add that bulk retrieval "requires a an agreement with SoftwareHeritage and INRIA" (quoted as printed) and that training must follow Software Heritage's principles. BigCode's page says that if it stops maintaining the dataset it plans to stop distributing it and limit its terms further, "including for training new LLMs".

The v3 dataset is released under ODC-By v1.0, and the card repeats that the code inside keeps its original licenses. ODC-By governs rights in the database, not the contents (s. 2.4), a split set out under dataset licenses for AI training.

Software Heritage and Its Principles for Training on The Stack v2

The Stack v2 was built with Software Heritage, the source code archive launched by Inria in partnership with UNESCO, and the v2 paper states that a significant portion of the training data was sourced under license from it.

The paper releases SWHIDs, the archive's identifiers, so that any file can be traced. Software Heritage's statement of 2023-10-19 sets four principles: knowledge derived from the archive "must be given back to humanity", models should carry a suitable open license, training data should be identified, for example by SWHIDs, and authors should have mechanisms "where possible" to exclude their code before training. v3 no longer takes contents from Software Heritage but uses its origin table to build the crawl list. No terms of the license between BigCode and Software Heritage are on record.

Am I in The Stack: Checking Inclusion and Version Opt-out Cutoffs

Am I in The Stack is a search tool on Hugging Face where developers enter a GitHub username to see whether their repositories are in the dataset and start an opt-out request. The table lists the opt-out cutoff each version states, as of 2026-11-17.

Version Opt-out cutoff stated Other removals stated Source
v1.1 requests submitted by 2022-11-15 MPL, EPL, LGPL files v1 card
v1.2 requests submitted by 2023-02-09 initially flagged malicious files (not exhaustive) v1 card
v1.3 opted out before 2026-07-29 repositories of users and organizations no longer on GitHub v1 card
v2.0.1 (StarCoder2 trained on it) opted out before 2023-10-20 none stated v2 card
v2.1.0 opted out before 2024-04-09 unreachable or private repositories (per SWH) v2 card
v2.2.0 opted out before 2026-07-29 repositories of users and organizations no longer on GitHub v2 card
v3 removed "before each patch release"; no date stated v3.1: leaked exact duplicates v3 card

The request is an issue in BigCode's GitHub opt-out repository, listing whole accounts and organizations or single repositories. BigCode stores validated requests so the code stays out of future versions, and its documentation states a plan to update every 3 months.

The opt-out README says opting out excludes code from the next iteration "and from current and future model training", which is BigCode's statement and not a verified outcome. Difficulties go to contact@bigcode-project.org.

Counts are on record for two moments. The governance card says 44 people had opted out when StarCoder's data was processed. After the 2023-11-20 deadline for StarCoder2, 1,561 repositories of 91 users and organizations and 22,066 files were removed.

Copies already made under earlier versions fall outside the cutoffs. Removal routes across other datasets are compared under removing content from AI training datasets.

The BigCode Project Governance Card, published on arXiv on December 6, 2023, is the project's own account of how it organized the work and handled the consent of developers whose code it collected.

It names the consent of data subjects as one of three social-impact dimensions, with the permissive license filter as the first step.

The reasons it records for opting out are a preference for opt-in, the view that it is "unfair to use their code without compensation", and fear of legal liability if model outputs trace back to the developer's work.

The developers interviewed liked the tool, but none wanted to opt out, and code copied into other repositories is hard to remove after an opt-out.

Personal Data, Malicious Code and Other Limits the Cards State

The cards of all three versions warn that the data may still contain personal data such as emails, IP addresses and keys, and may contain malicious code.

  • v1 card: the PII pipeline is "still a work in progress".
  • v2 card: sensitive data published to GitHub may remain, and complaints go to contact@bigcode-project.org.
  • v3 card: StarPII replaces detected emails, keys, names, passwords and IP addresses with placeholders such as <EMAIL>, and the card says "detection is imperfect".

SQL, Batchfile and TypeScript are less often permissively licensed, at 4 % against an average of 10 % per the v1 card, so the license filter skews language coverage. The seller's side of personal data is covered under PII removal and de-identification before licensing.

No court record on file names The Stack, and none of the 59 text notices in Hugging Face's public takedown repository names it, BigCode, StarCoder or HuggingFaceCode, as of November 17, 2026. The repository also holds 18 PDF notices, which were not read.

The code case on file, Doe v. GitHub, concerns GitHub Copilot and not The Stack.

Code in The Stack: Benefits, Risks, Downsides and Alternatives for Its Authors

For a developer whose public repository sits in The Stack, inclusion follows from the license on the repository, or in v2 and v3 from the absence of one, and it brings no payment and no contract.

Benefits

  • A public tool to check inclusion and a documented opt-out.
  • File-level provenance that makes attribution possible.

Risks

  • License labels can be wrong, as the cards state.
  • Opt-outs reach later versions only and not copies already made.
  • Personal data may remain in the files.

Downsides

  • No payment for inclusion, which is a description of the model and not a claim that payment is owed.
  • Opting out is the author's own work, one request per account or repository.

Alternatives

  • Request removal through Am I in The Stack, with no claim on its timing.
  • Choose a license deliberately for future code, knowing the filter excludes copyleft; this is information, not legal advice.
  • Licensing a private codebase directly, as covered under licensing source code and codebases to AI companies.
  • Not licensing at all.

Not licensing is a valid outcome, and nothing here suggests that inclusion in The Stack creates a claim to payment.

Other Code Sources, Corpora, Cases and Rules Beyond This Page

This page covers The Stack; other corpora, code licensing, cases and the option of not licensing each have their own page.

This page is information, not legal advice.

Frequently Asked Questions About The Stack

What is The Stack dataset?

The Stack is a code dataset for training code models, filtered by license. It comes from BigCode (v1 in 2022, v2 in 2024) and Hugging Face's HuggingFaceCode (v3 in 2026).

How big is The Stack?

The size depends on the version and the stage. v1 is 3.1 TB permissive per its paper, v2 is 67.5 TB in full, and v3 is 113.7 TB in full and 15.9 TB as a training subset per its card.

What license does The Stack use?

v1 and v2 carry terms of use, and v3 carries ODC-By v1.0 on the dataset. In every version the code inside keeps its original licenses.

How do I know if my code is in The Stack?

Search the Am I in The Stack tool on Hugging Face by GitHub username, then file an opt-out issue. Removal applies from the next version, not to earlier copies. This page is information, not legal advice.