yoshuawuyts/components

[component] tokenizer — text ↔ tokens

Open

#6 创建于 2026年5月1日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Rust (1 fork)github user discovery
good first issue

仓库指标

Star
 (1 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南