pub enum PreSplit {
Qwen35,
DeepseekV3,
Glm4,
Spm,
UnknownFallbackQwen35,
}Expand description
The pre-tokenizer split a loaded Tokenizer runs. Constructed only through
PreSplit::resolve, so “we do not know how to split for this model” is not a state a live
tokenizer can be in unless the operator asked for it via the env opt-out.
Variants§
Qwen35
unicode::split_qwen35 — serves both qwen35 and qwen2.
DeepseekV3
unicode::split_deepseek_v3 — DeepSeek-V3 and the Step-3.5/3.7-Flash family.
Glm4
unicode::split_glm4 — the zai-org GLM-4.x / GLM-5.x line (llama.cpp
LLAMA_VOCAB_PRE_TYPE_CHATGLM4). qwen2’s pattern with \p{N}{1,3} digit grouping.
Spm
gemma4 SPM-style BPE: bpe_tokenize splits whole lines itself and the pre id is never
consulted. Requires the gemma4 vocab model, not just the pre string.
UnknownFallbackQwen35
MEMRA_ALLOW_UNKNOWN_PRETOKENIZER=1 was set for an unrecognized pre. Runs the qwen35
split; token ids are NOT exact and every downstream measurement is invalid.