leleka-tokenizer gains gguf_bpe: a byte-level BPE tokenizer built from the vocabulary in the GGUF file (gpt2 model, gpt-4o pre-tokenizer), with special-token parsing that is off by default so user text cannot forge markers, and a UTF-8-safe streaming decoder. Checked against llama.cpp's /tokenize on 67 strings: same ids except the two documented differences (llama.cpp forges some Harmony markers from text; it splits words at combining marks, which the o200k expression keeps together). New leleka-harmony crate: render() reproduces the gpt-oss chat template (including its whitespace) and is byte-identical to llama.cpp's /apply-template on ten conversations with many tool-schema shapes; HarmonyParser turns generated tokens into reasoning, answer and tool-call events. The oracle fixtures are test strings, token ids and rendered prompts only. The tokenizer oracle test needs LELEKA_GPTOSS_GGUF and reports "skipped" without it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
14 lines
332 B
TOML
14 lines
332 B
TOML
[package]
|
|
name = "leleka-harmony"
|
|
version = "0.1.0"
|
|
description = "Harmony chat format for gpt-oss: prompt rendering and generated-message parsing"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[dependencies]
|
|
serde_json = { version = "1", features = ["preserve_order"] }
|
|
|
|
[lints]
|
|
workspace = true
|