yoshuawuyts/components

[component] tokenizer — text ↔ tokens

Open

#6 opened on May 1, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Rust (1 fork)github user discovery
good first issue

Repository metrics

Stars
 (1 star)
PR merge metrics
 (PR metrics pending)

Description

Goal

Tokenize and detokenize text for popular BPE and LLM vocabularies (tiktoken/BERT/GPT/etc). Input: text; output: tokens (and reverse).

Scope/Features

  • Text in, tokens out (and reverse)
  • Configurable vocabulary (select via param)
  • Optional: return byte offsets for each token

Rough WIT shape

  • tokenize(input: string, vocab: string) -> list<u32>
  • detokenize(tokens: list<u32>, vocab: string) -> string

Candidate crates

Labels

  • good first issue

Contributor guide