ratulb / mbpe
mbpe — A BPE tokenizer engine in Mojo, generic over a compile-time pre-tokenizer. Trains vocabularies from scratch, reads/writes the standard .tiktoken format, and reproduces OpenAI's GPT-2/GPT-4/GPT-4o vocabularies byte-for-byte. Outperforms tiktoken-rs (Rust) on every benchmark.
Over time
2026-07-23 to 2026-10-28; peak 7,931 lines
2026-07-23 to 2026-10-28; 191 commits, counted up by commit date
- Opened 11
- Closed or merged 10
2026-08-06 to 2026-10-26; 11 issues and pull requests opened (2 issues, 9 pull requests), from GitHub by mojo_issues
Dependencies
Used by ratulb/tenmo.
Through those (second degree): ratulb/chargpt.
Declared in its manifests at HEAD (toolchain left out): gcc, pytest, pytest-cov, python, regex, tiktoken.
Similar repos
| Repo | Description | Similarity |
|---|---|---|
| olaflaitinen/knap | A byte level BPE tokenizer written from scratch in pure Mojo. Implements the seven encodings OpenAI models use, runs with no Python interpreter in the process, and publishes its evidence: 191.7 million tokens and every token id checked against the reference implementation. | 84% |
| ratulb/simple_bpe | A simple BPE tokenizer implementation Mojo | 83% |
| mempirate/mojobag | BPE tokenizer in Mojo | 81% |
| mikeleppane/mojo-tiktoken | Pure-Mojo rewrite of OpenAI's tiktoken - byte-level BPE with hand-compiled Unicode scanners instead of a regex engine, golden-tested byte-for-byte against the reference. | 80% |
| amarbaro/mojo-tokenizers | Hugging Face tokenizer.json runtime for Mojo: byte-level BPE (GPT-2, Llama 3, Qwen) | 79% |
By the cosine of the embeddings of each repo's name, description and topics: bge-small-en-v1.5 at bbddccb7, from snapshot 3454761910736014829 of mojo.repo_embeddings, which mojo_embed writes.
Stars per month
- stars
- forks
0 stars over the months of GH Archive loaded so far (47; months in between aren't loaded yet), counted from its events.
Contributors per month
- contributors
- new
2 people authored or co-authored its commits (every commit reachable from HEAD, Co-authored-by trailers included, bots left out), counted by email.
Releases and tags
| Date | Tag | Name | From | Mojo version | Commit |
|---|---|---|---|---|---|
| 2026-07-27 | mbpe | – | git tag | 1.0.0 | d35dfb4b97 |
Issues and pull requests
1 open and 1 closed issues; 0 open, 9 merged and 0 closed pull requests, from GitHub by mojo_issues.
Open issues
| # | Title | Updated | Labels | Comments |
|---|---|---|---|---|
| 11 | Mojo 1.2.0 detected (pinned 1.1.0) — migration needed | 2026-10-26 | toolchain | 0 |
Pull requests
| # | Title | Opened | State | Comments |
|---|---|---|---|---|
| 10 | Benchmark image location and pypi release version automation | 2026-09-20 | merged | 0 |
| 8 | Build recipe with Mojo 1.1.0 | 2026-09-19 | merged | 0 |
| 7 | Migrate to Mojo 1.1.0; bump version to 0.1.10 | 2026-09-19 | merged | 0 |
| 6 | Integration | 2026-09-19 | merged | 0 |
| 5 | Integration | 2026-09-15 | merged | 0 |
| 4 | Zero-warning Mojo 1.0.0 sweep, public Tokenizer trait, refreshed benc… | 2026-09-10 | merged | 0 |
| 3 | Update tokenizer toolchain, benchmarks, and packaging metadata | 2026-09-09 | merged | 0 |
| 2 | Merge Integration | 2026-08-07 | merged | 0 |
| 1 | Merge housekeeping to main | 2026-08-06 | merged | 0 |
Migrations
| Date | What | From | To | Commit |
|---|---|---|---|---|
| 2026-07-23 | mojo_version | – | 1.0.0 | 71a98eda31 |
| 2026-07-23 | tooling | none | pixi | 71a98eda31 |
| 2026-07-28 | packaging | none | rattler | c224022e45 |
| 2026-09-19 | mojo_version | 1.0.0 | 1.1.0 | 55e168bbcc |
| 2026-10-28 | mojo_version | 1.1.0 | 1.2.0 | 9d36bb2d58 |
Commits
Commit types: Feature 12% · Fix 8% · Mojo version 1% · Migration 2% · Refactor 14% · Performance 2% · Docs 27% · Tests 2% · Build and chores 10% · Merge 10% · Other 14%
| Date | Commit | Type | Subject | Lines of Mojo | Tooling | Mojo version |
|---|---|---|---|---|---|---|
| 2026-10-28 | 1e7aa381f3 | Build and chores | Bump version from 0.1.10 to 0.1.11 | 6,251 | pixi | 1.2.0 |
| 2026-10-28 | 9d36bb2d58 | Migration | Migrate to Mojo 1.2.0 | 6,251 | pixi | 1.2.0 |
| 2026-10-08 | ca06186383 | Refactor +docs | Rename stale simple_bpe strings to mbpe; refresh benchmark chart | 6,257 | pixi | 1.1.0 |
| 2026-09-22 | 8cef990adb | Docs | Update README.md | 6,257 | pixi | 1.1.0 |
| 2026-09-21 | 925da3a01f | Mojo version | Update Mojo version to 1.1.0 in README | 6,257 | pixi | 1.1.0 |
| 2026-09-21 | 38edafe0ce | Docs | Update introduction in UNICODE_EVENT_POINTS.md | 6,257 | pixi | 1.1.0 |
| 2026-09-21 | 5c2ad578c3 | Docs | Revise README for clarity and improved descriptions | 6,257 | pixi | 1.1.0 |
| 2026-09-21 | e7b7f9b397 | Docs | Update README for clarity and performance claims | 6,257 | pixi | 1.1.0 |
| 2026-09-21 | 26688bf097 | Docs | Update README.md | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | 67b2780654 | Feature | Enhance README with badges and description | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | b0b62d20c0 | Merge +docs | Merge pull request #10 from ratulb/integration | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | 28dcb27cd1 | Build and chores | unpin stale mojo version in echo | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | aeeaaeb3ee | Fix | Fix empty build number | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | 753c05a5bd | Build and chores | Ignore legacy 25.* releases | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | 65f9ec5bed | Build and chores | Empty build.number fix | 6,257 | pixi | 1.1.0 |
| 2026-09-20 | c60a6085c9 | Feature | Add toolchain-watch and release-train automation | 6,257 | pixi | 1.1.0 |
| 2026-09-19 | 3e1ed1c48c | Merge | Merge pull request #8 from ratulb/integration | 6,257 | pixi | 1.1.0 |
| 2026-09-19 | 55e168bbcc | Merge | Merge pull request #7 from ratulb/integration | 6,257 | pixi | 1.1.0 |
| 2026-09-19 | c90ada3b2a | Build and chores | Bump version from 0.1.8 to 0.1.9 | 6,257 | pixi | 1.0.0 |
| 2026-09-19 | 42d586808b | Merge +docs | Merge pull request #6 from ratulb/integration | 6,257 | pixi | 1.0.0 |
| 2026-09-15 | b2da942764 | Build and chores | Bump version from 0.1.7 to 0.1.8 | 6,268 | pixi | 1.0.0 |
| 2026-09-15 | 0207f008e6 | Merge +docs | Merge pull request #5 from ratulb/integration | 6,268 | pixi | 1.0.0 |
| 2026-09-12 | 9745ad535d | Refactor | Remove benchmarking tables from README | 6,268 | pixi | 1.0.0 |
| 2026-09-12 | deeb1b365d | Docs | Benchmark chart | 6,268 | pixi | 1.0.0 |
| 2026-09-10 | c0dde361df | Build and chores | Packaging: [package] + rattler-build backend so mbpe is consumable as a pixi source dependency | 6,268 | pixi | 1.0.0 |
| 2026-09-10 | 713b54e83c | Merge | Merge pull request #4 from ratulb/integration | 6,268 | pixi | 1.0.0 |
| 2026-09-09 | e67c4ca3df | Build and chores | Bump version from 0.1.6 to 0.1.7 | 6,229 | pixi | 1.0.0 |
| 2026-09-09 | a6ae5075a3 | Merge | Merge pull request #3 from ratulb/integration | 6,229 | pixi | 1.0.0 |
| 2026-08-09 | df8c710012 | Docs | Update PyPI badge to include SVG format | 6,220 | pixi | 1.0.0 |
| 2026-08-09 | 6f88548cbb | Build and chores | Bump version from 0.1.5 to 0.1.6 | 6,220 | pixi | 1.0.0 |
| 2026-08-07 | c2c3868818 | Refactor | Clean up README by removing duplicate discovery line | 6,220 | pixi | 1.0.0 |
| 2026-08-07 | 98c5710401 | Feature | Add benchmarks section to README | 6,220 | pixi | 1.0.0 |
| 2026-08-07 | 4b3a3fed26 | Merge | Merge pull request #2 from ratulb/integration | 6,220 | pixi | 1.0.0 |
| 2026-08-06 | 606509737c | Docs | Refresh benchmark tables and replace support callout with star | 5,823 | pixi | 1.0.0 |
| 2026-08-06 | bc47e0b071 | Refactor | Simplify support request in README | 5,823 | pixi | 1.0.0 |
| 2026-08-06 | 50df7c930b | Docs | Update README.md | 5,823 | pixi | 1.0.0 |
| 2026-08-06 | 32c748d202 | Merge | Merge pull request #1 from ratulb/housekeeping | 5,823 | pixi | 1.0.0 |
| 2026-08-06 | 5d4e84138c | Refactor | Remove obsolete GPreTokenizer removal note from README | 7,585 | pixi | 1.0.0 |
| 2026-08-06 | 98e1eee616 | Merge | Merge branch 'dev' | 7,585 | pixi | 1.0.0 |
| 2026-08-06 | e662d5ff3b | Build and chores | Bump version from 0.1.4 to 0.1.5 | 7,575 | pixi | 1.0.0 |
| 2026-08-05 | 6d4470e291 | Merge | Merge branch 'dev' | 7,575 | pixi | 1.0.0 |
| 2026-08-05 | 15be30d221 | Refactor | Remove unused import of Writer from shared.mojo | 7,930 | pixi | 1.0.0 |
| 2026-08-05 | 4983ea0234 | Docs | Update README benchmark tables (5MB corpus run) | 7,931 | pixi | 1.0.0 |
| 2026-08-05 | b4e2ca710b | Refactor | Take care of warning message | 7,931 | pixi | 1.0.0 |
| 2026-08-05 | 80030a5206 | Feature +tests | Replace Unicode if-chains with generated lookup table; add pretokenize() and parity suite | 7,931 | pixi | 1.0.0 |
| 2026-08-05 | 66f51b4221 | Docs | Refresh README benchmarks and fix stale example ids and Mojo snippets | 7,664 | pixi | 1.0.0 |
| 2026-08-05 | cdfa22342d | Refactor | Format O200K_BYTE_TO_ID table | 7,664 | pixi | 1.0.0 |
| 2026-08-05 | b126eb5296 | Docs | Latest benchmark numbers | 7,713 | pixi | 1.0.0 |
| 2026-08-05 | 91c3085eab | Refactor +tests | Refactor encode_ordinary into dispatcher + named merge strategies | 7,713 | pixi | 1.0.0 |
| 2026-08-04 | b66b09d067 | Other +docs | fieldwise_init, renaming | 7,682 | pixi | 1.0.0 |
The latest 50 of 191 commits; all of them are in the JSON.