Benchmarking tool for tokenizer efficiency across languages and models
Project description
mothertoken
Every model has a native tongue. The question is whether yours matches.
Benchmarking tool and dataset exploring how tokenizer design creates silent efficiency, quality, and carbon inequities for non-English languages.
[!NOTE] Alpha release: tokenizer coverage is still expanding. The current tokenizer list is useful for comparison, but it is not complete yet.
Installation
# Published package
pip install mothertoken
For local development:
git clone https://github.com/inimaz/mothertoken
cd mothertoken
uv sync
uv pip install -e .
CLI Usage
The mothertoken command is available after installation.
📊 Rank tokenizers for a language
Rank supported tokenizers for a specific language using the precomputed benchmark data.
mothertoken rank spanish
# Raw FLORES+ codes still work
mothertoken rank spa_Latn
🧭 List tokenizers
See which tokenizer IDs can be used and which familiar models use them.
mothertoken list
# Only local tokenizers
mothertoken list --local-only
🔤 Tokenize exact text
Count tokens for exact text using local tokenizers by default. Add --language to estimate the English-equivalent token count from the benchmark multiplier.
mothertoken tokenize "Hola Mundo" --language es
# Check one model
mothertoken tokenize "Hello" --model gpt-4o
# Include API-backed provider token counters when API keys are configured
mothertoken tokenize "Hello" --include-api
mothertoken tokenize "Hello" --model claude-sonnet --include-api
# Estimate the English-equivalent count for a known language
mothertoken tokenize "مرحبا بالعالم" --language ar --model gpt-4o
# Compare against your own English translation
mothertoken tokenize "مرحبا بالعالم" --language ar --english-text "Hello world"
# Tokenize a file
mothertoken tokenize --file prompt.txt
# Compare translated files
mothertoken tokenize --file prompt.ar.txt --language ar --english-file prompt.en.txt
Researcher Workflow
Benchmark regeneration and model-extension docs live in docs/benchmarking.md.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mothertoken-0.1.0.0a1.tar.gz.
File metadata
- Download URL: mothertoken-0.1.0.0a1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea8b0b6989f2c227a7543c840fb3c4577c36f8188918173813f440cfb9ede057
|
|
| MD5 |
5410e2f25dc5e99b451fc1520e3773f6
|
|
| BLAKE2b-256 |
76e06cb318ff5907c20ca859a1931d7d1f9225d0877f41e4cf7eb735a09a5aae
|
Provenance
The following attestation bundles were made for mothertoken-0.1.0.0a1.tar.gz:
Publisher:
python-publish.yml on inimaz/mothertoken
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mothertoken-0.1.0.0a1.tar.gz -
Subject digest:
ea8b0b6989f2c227a7543c840fb3c4577c36f8188918173813f440cfb9ede057 - Sigstore transparency entry: 1418044232
- Sigstore integration time:
-
Permalink:
inimaz/mothertoken@b1120c6594a9697dee8a339000a9f71b49889a51 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/inimaz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b1120c6594a9697dee8a339000a9f71b49889a51 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mothertoken-0.1.0.0a1-py3-none-any.whl.
File metadata
- Download URL: mothertoken-0.1.0.0a1-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2e07197dd66c0901802aedb1c8997139130995c065d94224217fae20b05ec3d
|
|
| MD5 |
bb5e810c6d13977ac48a049933bb1ad9
|
|
| BLAKE2b-256 |
7293c124ea3ef5f4d967ef6c46175168298862e12fb15570cba571aceb7ea815
|
Provenance
The following attestation bundles were made for mothertoken-0.1.0.0a1-py3-none-any.whl:
Publisher:
python-publish.yml on inimaz/mothertoken
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mothertoken-0.1.0.0a1-py3-none-any.whl -
Subject digest:
a2e07197dd66c0901802aedb1c8997139130995c065d94224217fae20b05ec3d - Sigstore transparency entry: 1418044242
- Sigstore integration time:
-
Permalink:
inimaz/mothertoken@b1120c6594a9697dee8a339000a9f71b49889a51 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/inimaz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b1120c6594a9697dee8a339000a9f71b49889a51 -
Trigger Event:
workflow_dispatch
-
Statement type: