Self-hosted service
togethercomputer/RedPajama-Data avatar
togethercomputer/RedPajama-Data

RedPajama-Data: the pipeline code behind RedPajama-V2, with its knobs left unset

The RedPajama-Data repository contains code for preparing large datasets for training large language models.

4,998 stars371 forksPythonApache-2.0

At a glance

What is it?
The RedPajama-Data repository holds the pipeline that prepared RedPajama-V2, not the dataset itself: three stages you drive yourself, placeholders left standing for capacity, error rate and similarity, and listings files that name the ccnet data each run processes.
Who is it for?
Use RedPajama-Data when you mean to rebuild the RedPajama-V2 corpus from ccnet dumps and you already have S3 access, apptainer and a machine in the neighborhood of the 64 core, 500G of RAM scale the fuzzy stage was tested at; the dataset published on HuggingFace is the cheaper route for most people.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 172 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • togethercomputer/RedPajama-Data4,998 ★ · +9
Star history
Repository2026-09-232026-11-22
togethercomputer/RedPajama-Data5k5k

9 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

rp_v2.0.conf has to be copied before any stage runs

Nothing runs until you copy `configs/rp_v2.0.conf` to a file of your own, `configs/default.conf` for example, and set the environment variables inside it. Those variables are read throughout the pipeline instead of being passed on the command line. The container build sources that file and runs from the `app` directory:

bash
. configs/default.conf
cd app
docker build -t "${DOCKER_REPO}:" .

The image tag in that command ends in a colon and nothing after it, so it is easy to paste the line as written and end up with a name you cannot reference later. Two prerequisites sit outside the repository: `s5cmd` has to be installed, and your S3 profile configured so you can pull data from an S3 bucket. Running without any containerized environment is allowed, yet the shipped scripts still assume you have a docker and apptainer installation.

A listings file is the only place you name a CommonCrawl dump

Step 1 prepares the artifacts the later stages consume: quality classifiers, bag-of-ngram generative models for importance weight computation, a bad words list pulled from the LDNOOBW repo, and the most recent list of blacklisted urls from the UT1 blacklist. One artifact is manual: download the english wikipedia reference classifier and place it at `${DATA_ROOT}/wikiref-model/en/en-model.bin`, the same fasttext classifier used in RedPajama-V1. Then, from the root directory:

bash
bash scripts/run_prep_artifacts.sh \
  --config configs/rp_v2.0.conf \
  --listings /path/to/listings/file.txt\
  --max_workers 32

`--listings` names a text file holding the keys to the ccnet data you want processed, entries shaped like `2023-06/0000/en_head.json.gz`; the quality signals and LSH steps also take a `--dump_id`. `--max_workers` sets the number of parallel processes. The run produces an id you can store in `ARTIFACTS_ID` for the next step, which is how downstream work learns which artifacts to trust.

PYTHONHASHSEED decides whether two runs agree

If you are not running steps 1 and 2 with the provided scripts and containers, you have to hold `PYTHONHASHSEED` at a consistent value, and the suggested one is 42:

bash
export PYTHONHASHSEED=42

The variable exists to keep the hash functions used in the computation of DSIR weights consistent. A custom environment that leaves it unset lets those weights differ between runs, so importance weights computed on two machines quietly stop being comparable. Pinning the value costs one line in your environment file. Discovering the mismatch after a finished run costs the run.

Quality signals and minhash signatures leave in one pass

Step 2 is the annotation stage, and it also computes the minhash signatures that step 3 needs for fuzzy deduplication, which is why the two cannot be scheduled independently. From the root directory:

bash
bash scripts/apptainer_run_quality_signals.sh \
  --config configs/rp_v2.0.conf \
  --dump_id "2022-49" \
  --input_base_uri "file:///path/to/data/root" \
  --output_base_uri "file:///path/to/outout/data/root" \
  --max_docs -1

`--output_base_uri` in that command really does spell its directory `outout`, and `--max_docs -1` puts no ceiling on how many documents a single run absorbs. Both ends are `file://` URIs here, while the exact deduplication stage reaches the same kind of data through `s3://`, a split that decides where your intermediate copies have to live before you start. The signals this step produces are grouped under a quality annotations table of tags and descriptions, and the list is meant to grow as more signals are developed.

Bloom filter capacity is a promise your document count has to keep

Exact deduplication is implemented in `app/src/bloomfilter.py`, and it runs from the `app` directory:

bash
python3 app/src/bloomfilter.py \
  --listings /path/to/listings/file.txt \
  --input_base_uri "s3://path/to/ccnet/data" \
  --output_dir "/path/to/output" \
  --s3_profile "..." \
  --endpoint_url "..." \
  --parallel_readers 32 \
  --batch_size 10 \
  --capacity "..." \
  --error_rate "..."

`--capacity` and `--error_rate` are placeholders, and capacity has to be greater than the number of documents you feed in. Set it too low and the error rate you asked for is not guaranteed, which shows up as extra false positives: genuine non-duplicate documents get discarded as duplicates. `--parallel_readers 32` and `--batch_size 10` are the only numbers carrying suggested values. This stage can run independently of the previous step, but its input has to be stored in an S3 bucket, and the implementation sits on the pybloomfiltermmap3 library.

Fuzzy deduplication inherits step 2 configuration and your threshold

Locality sensitive hashing runs on the minhash signatures produced earlier and asks you to use the same configuration as in the quality signals step:

bash
bash scripts/apptainer_run_lsh.sh \
  --config configs/rp_v2.0.conf \
  --dump_id "2022-49" \
  --input_base_uri "file:///path/to/data/root" \
  --output_dir "/path/to/output" \
  --similarity "<similarity_threshold>" \
  --listings "/minhash/listings/file.txt" \
  --max_docs -1

`--similarity` is a placeholder, so the number that decides what counts as a near duplicate is yours to pick, and no starting value is offered. The listings file here points at minhash output, not the raw ccnet keys step 1 consumed, so the two steps never share that input. The step numbers are also unreliable: the signatures are attributed to the first step even though step 1 builds artifacts and step 2 is where minhash is computed. The code is built on polars and was tested with 200M documents on a 64 core machine with 500G of RAM.

Five languages carry the 30.4T tokens of head_middle

Document and token counts for the annotated and deduplicated `head_middle` part of the dataset:

| | # Documents | Estimated Token count (deduped) | |-------|-------------|---------------------------------| | en | 14.5B | 20.5T | | de | 1.9B | 3.0T | | fr | 1.6B | 2.7T | | es | 1.8B | 2.8T | | it | 0.9B | 1.5T | | Total | 20.8B | 30.4T |

The full corpus is much larger: over 100B text documents drawn from 84 CommonCrawl snapshots and processed through the CCNet pipeline, of which 30B documents additionally come with quality signals and 20B documents are deduplicated. The table above covers one split of that corpus, not all of it, and the language list ends at English, German, French, Italian and Spanish. Anyone planning training runs on languages outside that set has to source data elsewhere, because nothing here describes a pipeline run over them.

No releases, and the classifier download is pinned to v1.0.0

There are no GitHub releases in this repository, so there is no tagged version of the pipeline code to pin a run to, and the last recorded push is 2026-06-03. The version information that does exist is scattered: the reference classifier download URL carries v1.0.0 in its path, and the code for the RedPajama-1T dataset sits on a separate `rp_v1` branch in the same repository rather than in any release. The top level is `.gitignore`, `LICENSE`, `README.md`, `app/`, `configs/`, `docs/` and `scripts/`, with Apache-2.0 as the license and Python as the primary language. If you rebuild this corpus, record the commit and the config file you used, because nothing in the repository makes that pairing retrievable afterwards. The finished dataset itself is published separately, as togethercomputer/RedPajama-Data-V2 on HuggingFace.

Editorial conclusion

Use RedPajama-Data when you mean to rebuild the RedPajama-V2 corpus from ccnet dumps and you already have S3 access, apptainer and a machine in the neighborhood of the 64 core, 500G of RAM scale the fuzzy stage was tested at; the dataset published on HuggingFace is the cheaper route for most people. Settle the bloom filter capacity and the similarity threshold before the first run instead of discovering their effect on dropped documents afterward, and write down the commit and config file you used, since no release tags exist to return to.

Frequently asked questions

How large is the RedPajama-V2 dataset that this pipeline code builds?

The annotated and deduplicated head_middle part totals 20.8B documents and an estimated 30.4T tokens, with English alone at 14.5B documents and 20.5T tokens. The wider corpus holds over 100B text documents from 84 CommonCrawl snapshots processed with the CCNet pipeline, and 30B of those documents also carry quality signals.

What does RedPajama-Data ask you to install before the pipeline runs?

You copy configs/rp_v2.0.conf to a file of your own and set the environment variables inside it, install s5cmd, and configure your S3 profile so data can be pulled from an S3 bucket. The pipeline can run without a containerized environment, but the provided scripts assume a docker and apptainer installation.

Why do the RedPajama-Data dedup stages have different input paths?

The quality signals stage takes file:// base URIs, and the exact deduplication script reads its input from an s3:// bucket and can run independently of the previous step. The fuzzy stage also expects a minhash listings file rather than the raw ccnet keys used in step 1.

Where does the RedPajama-Data pipeline code for the 1T dataset live?

The code used for the RedPajama-1T dataset is kept in the rp_v1 branch of the same repository. The RedPajama-V2 dataset itself is published on HuggingFace as togethercomputer/RedPajama-Data-V2, and the repository has no GitHub releases.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. togethercomputer/RedPajama-Data on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/togethercomputer-redpajama-data.svg)](https://hysenlabs.com/projects/togethercomputer-redpajama-data)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/togethercomputer-redpajama-data.svg)](https://hysenlabs.com/projects/togethercomputer-redpajama-data)

Was this useful?