File size: 2,047 Bytes
9d12148
 
7c4323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9d12148
7c4323b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
license: apache-2.0
language:
- en
tags:
- code
- rust
- pretraining
- programming
- alacritty
- rust-lang
- datafusion
- clap
- tokio
- egui
- eza 
- dust 
- fd
- zoxide
- redox
- candle
size_categories:
- 100K<n<1M
---

# Rust and Docs Training Dataset

A massive, multi-format code and documentation corpus built from 70 major open-source Rust repositories (Including but not limited to datafusion clap tokio egui eza dust fd zoxide redox candle).

## Dataset Structure

The dataset is processed using a deterministic token-based chunking pipeline (`cl100k_base` BPE encoding, fixed 512-token chunks with 0-token overlap) across 70 major open-source Rust repositories, preserving repository headers, file boundaries, crate manifests, and multi-line code blocks.

Each record in the JSONL and Parquet shards contains:
- **`id`**: Unique identifier for the chunk (`rust_dataset_chunk_<index>`).
- **`source`**: Originating consolidated corpus filename (`rust_dataset.txt`).
- **`chunk_index`**: Sequential zero-based index of the chunk.
- **`token_count`**: Exact BPE token count for the chunk (`512` for full chunks, `<512` for the final tail chunk).
- **`content`**: Raw text block containing Rust source code, TOML manifests, or technical documentation.

## Corpus Breakdown
- **Source & Manifest Corpus (`rust_dataset.txt`)**: ~30.78M lines (~1.10 GB) extracted repository-by-repository from 70 flagship Rust projects (`rust`, `cargo`, `tokio`, `serde`, `bevy`, `polars`, `zed`, `deno`, `ruff`, `uv`, `servo`, `redox`, `candle`, and others), ordered within each repository by `.rs` source files, `.toml` configuration/manifest files (`Cargo.toml`), and documentation (`.md`, `.rst`, `.adoc`, `README`, `LICENSE`).
- **Shards & Token Totals**: 520,141 chunks totaling ~266.3M tokens, distributed across Zstd-compressed Apache Parquet (`rust_dataset.parquet`, ~237.3 MB), JSONL (`rust_dataset.jsonl`, ~1.21 GB), and raw `uint32` binary token arrays (`rust_dataset.bin`).

## License
Distributed under the **Apache-2.0** open-source license.