Expand description
Byte-level BPE tokenizer — HF tokenizer.json parity.
Faithful pipeline (matches tokenizers for Qwen-style files):
added-token split (raw text) → NFC → pre-tokenizer regex
(GPT-2 style, needs lookahead) → byte-level mapping → ranked BPE
merges → vocab ids. Decode reverses through the byte-level map,
assembling UTF-8 across token boundaries.
No silent corruption: a symbol that cannot be encoded is reported (tracing::error), never dropped without a trace.
Structs§
- Tokenizer
- A loaded BPE tokenizer.
Enums§
Constants§
- TOOL_
MARKUP_ TOKENS - Tool-call grammar tokens that decode as TEXT even when the vocabulary marks them special.
Functions§
- template_
reads_ reasoning_ effort - Whether a chat template consumes a
reasoning_effortvariable (Minico-M1’s off/low/medium/high/max dial, GLM-5, gpt-oss): only such templates are handed a caller’s effort, verbatim, byrun --reasoning-effortand the server’sreasoning_effortfield.