Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mothertoken-0.1.0.0a1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mothertoken-0.1.0.0a1-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

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

Hashes for mothertoken-0.1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 ea8b0b6989f2c227a7543c840fb3c4577c36f8188918173813f440cfb9ede057
MD5 5410e2f25dc5e99b451fc1520e3773f6
BLAKE2b-256 76e06cb318ff5907c20ca859a1931d7d1f9225d0877f41e4cf7eb735a09a5aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for mothertoken-0.1.0.0a1.tar.gz:

Publisher: python-publish.yml on inimaz/mothertoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mothertoken-0.1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for mothertoken-0.1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2e07197dd66c0901802aedb1c8997139130995c065d94224217fae20b05ec3d
MD5 bb5e810c6d13977ac48a049933bb1ad9
BLAKE2b-256 7293c124ea3ef5f4d967ef6c46175168298862e12fb15570cba571aceb7ea815

See more details on using hashes here.

Provenance

The following attestation bundles were made for mothertoken-0.1.0.0a1-py3-none-any.whl:

Publisher: python-publish.yml on inimaz/mothertoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page