Mojourney

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.

GitHub ↗ · first seen in GH Archive 2026-10-01 (description / language) · 17,421 lines of Mojo in 55 files at the last of 75 commits (2026-09-07 to 2026-09-11)

Stars4as of 2026-11-23
Forks0as of 2026-11-23
Depends on0Mojo libraries, of 5 declared
Used by0census repos that depend on it
Open issues4
Watchers0
Created2026-09-072 months ago
Lines of Mojo17,42155 files
Commits752026-09-07 to 2026-09-11
Contributors22 new in 2026-09
Mojo version1.0.0from lock file
CategoryML and inferenceapproximate
Toolingpixi
Packagingrattler
LicenseEUPL-1.2

Over time

2026-09-07 to 2026-09-11; peak 17,421 lines

Dependencies

Declared in its manifests at HEAD (toolchain left out): python, regex, rs-bpe, tiktoken, tokenizers.

Similar repos

RepoDescriptionSimilarity
ratulb/mbpembpe — 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.84%
amarbaro/mojo-tokenizersHugging Face tokenizer.json runtime for Mojo: byte-level BPE (GPT-2, Llama 3, Qwen)83%
mempirate/mojobagBPE tokenizer in Mojo83%
mikeleppane/mojo-tiktokenPure-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.82%
ratulb/simple_bpeA simple BPE tokenizer implementation Mojo82%

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 (WatchEvents) and forks per month in GH Archive, 2023-01 to 2026-10022023-012023-052023-092024-012024-052024-092025-012025-052025-092026-012026-052026-09
  • stars
  • forks

2 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

People with a commit each month, and the ones with their first, 2026-09 to 2026-09022026-09
  • 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

DateTagNameFromMojo versionCommit
2026-09-11v1.0.0–git tag1.0.04c5b07a909

Issues and pull requests

0 open and 0 closed issues; 4 open, 3 merged and 1 closed pull requests, from GitHub by mojo_issues.

Pull requests

#TitleOpenedStateComments
8build(deps): bump certifi from 2026.7.22 to 2026.10.182026-11-04open1
7build(deps-dev): bump regex from 2026.9.3 to 2026.9.292026-11-01open1
6build(deps-dev): bump tokenizers from 0.23.2 to 0.23.32026-11-01open1
5ci(deps): bump github/codeql-action from 3 to 42026-10-01open1
4build(deps-dev): bump regex from 2026.9.3 to 2026.9.102026-10-01closed2
3ci(deps): bump actions/upload-artifact from 4 to 72026-09-08merged1
1ci(deps): bump actions/checkout from 5 to 72026-09-08merged1
2ci(deps): bump actions/setup-python from 5 to 72026-09-08merged1

Migrations

DateWhatFromToCommit
2026-09-07mojo_version–1.0.0571c26a698
2026-09-07toolingnonepixi571c26a698
2026-09-08packagingnonerattler15876c8e47

Commits

Commit types: Feature 17% · Fix 8% · Mojo version 1% · Refactor 1% · Performance 9% · Docs 33% · Tests 5% · Build and chores 24%

DateCommitTypeSubjectLines of MojoToolingMojo version
2026-09-11b1c30f3ab8Fixfix(conda): the package acceptance test proved less than it claimed17,421pixi1.0.0
2026-09-1167056e08fdDocsdocs: record the Zenodo DOI17,421pixi1.0.0
2026-09-114c5b07a909Build and choresrelease: add .zenodo.json so the DOI record carries the right metadata17,421pixi1.0.0
2026-09-1105aceb717aBuild and choresrelease: pin the recipe at the 1.0.0 tree17,421pixi1.0.0
2026-09-11e83f0ea34fFix +docsfix(conda): the recipe pinned a commit older than its own build script17,421pixi1.0.0
2026-09-10d90b59d4c4Docsdocs: read every document against the code and fix what disagreed17,421pixi1.0.0
2026-09-100008794d5bFeature +tests +docsfeat(gates): refuse a Contents list that has drifted from its document17,421pixi1.0.0
2026-09-103a2ce50309Docsdocs: wire the new material into the documents that point at things17,421pixi1.0.0
2026-09-103927e1dbf3Build and choresbuild(sbom): a CycloneDX bill of materials, generated and gated for drift17,421pixi1.0.0
2026-09-103bc1e184e1Docsdocs: the toolchain findings and the method, as documents of their own17,421pixi1.0.0
2026-09-103fde614cd2Feature +tests +docsfeat(tokenizer): padded batches with attention masks, and two examples17,324pixi1.0.0
2026-09-103fbf271be5Feature +testsfeat(cli): shell completions, and a test that keeps them true16,565pixi1.0.0
2026-09-1054afd98f91Performance +docsperf(memory): survey every encoding, and fix the two things the survey found16,565pixi1.0.0
2026-09-100bcc85d015Fixfix(ci): run the drift check before the generators, not instead of them16,461pixi1.0.0
2026-09-10bacb031bafFix +docsfix(ci): green the standards job, and make the gate that let it through16,461pixi1.0.0
2026-09-108342c79ce3Docsdocs: link the Knap website from docs/ROADMAP.md16,461pixi1.0.0
2026-09-10efdf05c43dDocsdocs: link the Knap website from docs/PACKAGING.md16,461pixi1.0.0
2026-09-1092853d574fDocsdocs: link the Knap website from docs/CORRECTNESS.md16,461pixi1.0.0
2026-09-101bcee0c364Docsdocs: link the Knap website from docs/BENCHMARKS.md16,461pixi1.0.0
2026-09-100982d712a1Docsdocs: link the Knap website from docs/ARCHITECTURE.md16,461pixi1.0.0
2026-09-10cc2617a765Docsdocs: link the Knap website from docs/API.md16,461pixi1.0.0
2026-09-104734f8c609Docsdocs: link the Knap website from the README16,461pixi1.0.0
2026-09-10899e0442aaFeature +testsfeat(api): the helpers a caller would otherwise write, and write wrong16,461pixi1.0.0
2026-09-10eb910bb9a7Feature +tests +docsfeat(count): a counting entry point, a memory measurement, and a correction15,586pixi1.0.0
2026-09-09304ec2c092Build and chores +docsci(badges): the full badge set, and the gate that went red under it14,851pixi1.0.0
2026-09-097405a02614Build and choreschore: drop the executable bit from files that are not executed14,851pixi1.0.0
2026-09-0904f50b66baBuild and chores +docsbuild(conda): prepare the package, up to but not including publishing14,851pixi1.0.0
2026-09-09eebb252a41Docsdocs: state the rs-bpe gap in the direction the arithmetic supports14,786pixi1.0.0
2026-09-09fa89bae14eDocsdocs: re-baseline every remaining document on the 2026-09-09 run14,786pixi1.0.0
2026-09-098f17fd6aa9Performance +docsperf(encode): make the merge path 1.4 to 1.9 times faster, output unchanged14,786pixi1.0.0
2026-09-09a7a45a73d6Feature +tests +docsfeat(encodings): ship the remaining five tiktoken encodings14,532pixi1.0.0
2026-09-090814805655Teststest(fuzz): re-run twenty million inputs on the changed encode path12,894pixi1.0.0
2026-09-09fb45b7c0b0Build and choresci: generate the API reference alongside the other generated files12,894pixi1.0.0
2026-09-0971003bfd65Docsdocs: record two claims that did not survive being measured12,894pixi1.0.0
2026-09-09d7bcacb321Docsdocs(api): generate a reference, and stop reading links inside code12,894pixi1.0.0
2026-09-096ec02ea191Performanceperf(encode): stop allocating per pre-token, and size the output12,894pixi1.0.0
2026-09-09b1d2ee2547Docsdocs: list the required checks by name, and say why extra approval is off12,775pixi1.0.0
2026-09-0982075426c4Build and choresci(deps): bump actions/upload-artifact from 4 to 7 (#3)12,775pixi1.0.0
2026-09-0945fc6d3df4Build and choresci(deps): bump actions/setup-python from 5 to 7 (#2)12,775pixi1.0.0
2026-09-09ff3d7bdd76Build and choresci(deps): bump actions/checkout from 5 to 7 (#1)12,775pixi1.0.0
2026-09-097f87cd73fbBuild and choresci: fix the include paths, and move the claims gate where it belongs12,775pixi1.0.0
2026-09-0964c1d6d437Docsdocs: describe the command line tool and six toolchain findings12,775pixi1.0.0
2026-09-09cd59ada95fBuild and choresci: gate the command line tool, and ship it in the conda package12,775pixi1.0.0
2026-09-09f762cdb4d6Feature +testsfeat(cli): add a knap command for counting, encoding and decoding12,775pixi1.0.0
2026-09-089faff20ba4Docsdocs: correct how the branch protection is actually split11,449pixi1.0.0
2026-09-084c50132f06Docsdocs: describe what the branch protection on main enforces11,449pixi1.0.0
2026-09-0800d0c794eeBuild and chores +docschore: declare version 1.0.011,449pixi1.0.0
2026-09-08413264e6daDocsdocs: add the missing root and community files11,449pixi1.0.0
2026-09-08b070918786Fix +testsfix(docs): repair every docstring the gate rejects, and widen the gate11,449pixi1.0.0
2026-09-085dc05024f7Docsdocs(brand): give the exact size of each asset file11,422pixi1.0.0

The latest 50 of 75 commits; all of them are in the JSON.