Skip to content

Language-independent tokenizer that trains on raw Unicode text using BPE or Unigram algorithms.

CCM score
61 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers training, encoding, and decoding with Python and command-line workflows, including spm_train and subword regularization
  • Includes character coverage guidance for English, CJK, and multilingual corpora, plus T5-style special-symbol configuration
  • Treats whitespace as a ▁ meta symbol so decoding restores spacing exactly and vocabularies stay deterministic
  • Designed for multilingual models, CJK text, and reproducible tokenization, with integration into transformers via T5Tokenizer

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill sentencepiece -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

SentencePiece - Language-Independent Tokenization

Unsupervised tokenizer that works on raw text without language-specific preprocessing.

When to use SentencePiece

Use SentencePiece when:

  • Building multilingual models (no language-specific rules)
  • Working with CJK languages (Chinese, Japanese, Korean)
  • Need reproducible tokenization (deterministic vocabulary)
  • Want to train on raw text (no pre-tokenization needed)
  • Require lightweight deployment (6MB memory, 50k sentences/sec)

Performance:

  • Speed: 50,000 sentences/sec
  • Memory: ~6MB for loaded model
  • Languages: All (language-independent)

Use alternatives instead:

  • HuggingFace Tokenizers: Faster training, more flexibility
  • tiktoken: OpenAI models (GPT-3.5/4)
  • BERT WordPiece: English-centric tasks

Quick start

Installation

# Python
pip install sentencepiece

# C++ (requires CMake)
git clone https://github.com/google/sentencepiece.git
cd sentencepiece
mkdir build && cd build
cmake .. && make -j $(nproc)
sudo make install

Train model

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI Agents & LLM Apps, Data Science & Analytics
First seen
Jun 3, 2026

Questions

What does the sentencepiece skill do?

The sentencepiece skill teaches an agent to train and use SentencePiece, a language-independent tokenizer that treats text as raw Unicode. It supports the BPE and Unigram algorithms and can train on raw text without pre-tokenization. Use it when you need multilingual support, CJK language handling, or reproducible tokenization.

How do I install the sentencepiece skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill sentencepiece -y in a project to install the sentencepiece skill. Once installed, the agent can train, encode and decode text with SentencePiece models.

Which category does the sentencepiece skill belong to?

The sentencepiece skill is listed in the AI Agents & LLM Apps category on Claude Marketplaces. Its SKILL.md notes that T5, ALBERT, XLNet and mBART use SentencePiece tokenization.

What does the sentencepiece skill need to run?

The sentencepiece skill relies on the sentencepiece Python package and the transformers library, as listed in its dependencies. Training a model also needs a plain text corpus file as input.

More from orchestra-research/ai-research-skills

All 92

Similar to Sentencepiece

More AI Agents & LLM Apps