#7 · Primary category: NLP Tools & Text Processing
minbpe
Minimal, clean code for the Byte Pair Encoding (BPE) algorithm commonly used in LLM tokenization.
Project last updated:07/01/24
GitHub Stars
10.7K
Forks
1.1K
Contributors
10
License
MIT
Why we included this project
minbpe offers a small, readable implementation of byte-level Byte Pair Encoding, the tokenization method behind GPT, Llama, and Mistral. It includes three tokenizer classes: a basic one, a regex-based variant that prevents merges across category boundaries, and a GPT-4 wrapper that matches tiktoken's output exactly. All three handle training, encoding, and decoding, which makes the code a practical starting point for developers who want to build a custom tokenizer or understand how tokenization works before reaching for tiktoken's optimized internals. Because the code is deliberately minimal, it also works well as a teaching tool for teams getting familiar with LLM fundamentals. Teams that need predictable, auditable tokenization can adapt it as a reference implementation.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
flair
A very simple framework for state-of-the-art Natural Language Processing (NLP)
compromise
modest natural-language processing
tokenizers
💥 Fast State-of-the-Art Tokenizers optimized for Research and Production
CoreNLP
CoreNLP: A Java suite of core NLP tools for tokenization, sentence segmentation, NER, parsing, coreference, sentiment analysis, etc.
Chinese-Word-Vectors
100+ Chinese Word Vectors 上百种预训练中文词向量