Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

setup: --draft-vocab cyrillic - the English/code subset plus the whole Cyrillic script

sergiywith79aa0bb11b92
diff --git a/data/draft_vocab_cyrillic.bin b/data/draft_vocab_cyrillic.bin
new file mode 100644
index 000000000..06e22cbf9
Binary files /dev/null and b/data/draft_vocab_cyrillic.bin differ
diff --git a/docs/DETAILS.md b/docs/DETAILS.md
index 35008e74f..8b9f75e25 100644
--- a/docs/DETAILS.md
+++ b/docs/DETAILS.md
@@ -83,7 +83,10 @@ of the vocabulary (`mtp/rt/draft_vocab.bin`). Since 0.1.27 the subset includes e
token (106,299 ids), so answers in those languages are 15-38% faster (Q2_0, RTX 5070). Its head takes ~180 MiB of
VRAM, which the expert cache leaves free for it (0.1.28). `START-HERE.bat --setup --draft-vocab en` keeps the
English/code subset from before (40,525 ids, ~110 MiB less VRAM, English answers 1-2% faster; CJK answers get
-almost no drafts). `tools/draft_vocab.py` builds and inspects subsets.
+almost no drafts). `--draft-vocab cyrillic` takes the English/code subset plus the whole Cyrillic script (58,963
+ids): the shipped subsets hold 142 of the vocabulary's 18,580 Cyrillic tokens, so Ukrainian or Russian answers got
+1.4 tokens a round; with it 2.1, and 83 -> 109 tokens/s (RTX 5090, the NVFP4 fork), English unchanged.
+`tools/draft_vocab.py` builds and inspects subsets.
**Low-RAM mode (engine 0.1.26, chosen by setup):** normally all of a model's experts are copied into RAM (23-50 GB,
pinned) and the GPU holds a copy of the most-used ones. On a PC whose RAM cannot hold them beside the system (the
diff --git a/setup.py b/setup.py
index eac1f554d..060edab47 100644
--- a/setup.py
+++ b/setup.py
@@ -1811,12 +1811,14 @@ def start(cfg_path: Path, port: int | None, gpu: int | list | None = None, open_
OLD_DRAFT_VOCABS = {"369151522226a5edaa5f12cfd1e2ae7db8f4fbdbd222f3dcf327dced9597fb25"} # to 0.1.26: 27 Han tokens
-DRAFT_VOCABS = {"cjk": "draft_vocab.bin", "en": "draft_vocab_en.bin"}
+DRAFT_VOCABS = {"cjk": "draft_vocab.bin", "en": "draft_vocab_en.bin", "cyrillic": "draft_vocab_cyrillic.bin"}
def refresh_draft_vocab(rt: Path, choice: str = "cjk") -> None:
- """The draft layer's token subset in the MTP folder: `cjk` (data/draft_vocab.bin, since 0.1.27, #137) or `en`
- (data/draft_vocab_en.bin, the English/code subset before it: ~110 MiB less VRAM, English answers 1-2% faster).
+ """The draft layer's token subset in the MTP folder: `cjk` (data/draft_vocab.bin, since 0.1.27, #137), `en`
+ (data/draft_vocab_en.bin, the English/code subset before it: ~110 MiB less VRAM, English answers 1-2% faster) or
+ `cyrillic` (data/draft_vocab_cyrillic.bin: English/code and the whole Cyrillic script, for Ukrainian, Russian,
+ Bulgarian, Serbian... answers).
Copied when missing or when a shipped subset other than the chosen one is there; a subset made by hand is kept."""
new, dst = ROOT / "data" / DRAFT_VOCABS.get(choice, "draft_vocab.bin"), rt / "draft_vocab.bin"
if not new.exists() or not rt.is_dir():
@@ -1827,8 +1829,9 @@ def refresh_draft_vocab(rt: Path, choice: str = "cjk") -> None:
for f in DRAFT_VOCABS.values() if (ROOT / "data" / f).exists()}
if old not in shipped or old == hashlib.sha256(new.read_bytes()).hexdigest():
return
- ok("draft layer: the token subset " + ("with Chinese, Japanese and Korean" if choice == "cjk" else
- "for English and code (less VRAM)"))
+ ok("draft layer: the token subset " + {"cjk": "with Chinese, Japanese and Korean",
+ "cyrillic": "with the Cyrillic script"}.get(choice,
+ "for English and code (less VRAM)"))
shutil.copyfile(new, dst)
@@ -1953,7 +1956,8 @@ def main() -> int:
help="tune the engine's settings for this PC (about 5-10 minutes), then start the model")
ap.add_argument("--draft-vocab", choices=list(DRAFT_VOCABS),
help="the draft layer's tokens: cjk = with Chinese, Japanese and Korean (default), en = English "
- "and code only (~110 MiB less VRAM, English answers 1-2%% faster)")
+ "and code only (~110 MiB less VRAM, English answers 1-2%% faster), cyrillic = English, code "
+ "and the Cyrillic script (Ukrainian, Russian... answers decode ~30%% faster)")
ap.add_argument("--low-ram", choices=["auto", "on", "off", "resident", "mmap"], default="auto",
help="read the model's experts from one file in its folder instead of copying them all into RAM "
"(for a PC with a big GPU and little RAM); auto: when the experts would not fit the RAM. In "
diff --git a/tools/draft_vocab.py b/tools/draft_vocab.py
index e04ea7b0c..77fa6b98f 100644
--- a/tools/draft_vocab.py
+++ b/tools/draft_vocab.py
@@ -8,7 +8,7 @@ Chinese drafted almost nothing (#137). This adds whole scripts to a subset:
python tools/draft_vocab.py --gguf <model>-00001-of-0000N.gguf --base data/draft_vocab.bin --add cjk \
--out data/draft_vocab.bin
---add takes han, kana, hangul, cjk_punct, or cjk (all four). The base ids keep their order; the added ones follow in
+--add takes han, kana, hangul, cjk_punct, cjk (those four) or cyrillic. The base ids keep their order; the added ones follow in
id order. --stats prints what a subset holds.
"""
from __future__ import annotations
@@ -26,6 +26,8 @@ SCRIPTS = {
"kana": [(0x3040, 0x30FF), (0x31F0, 0x31FF), (0xFF66, 0xFF9F)],
"hangul": [(0x1100, 0x11FF), (0x3130, 0x318F), (0xAC00, 0xD7AF)],
"cjk_punct": [(0x3000, 0x303F), (0xFF00, 0xFF65), (0xFFA0, 0xFFEF)],
+ # Ukrainian, Russian, Bulgarian, Serbian...: the shipped subset held 142 of the vocabulary's 18,580 Cyrillic tokens
+ "cyrillic": [(0x0400, 0x04FF), (0x0500, 0x052F), (0x1C80, 0x1C8F), (0x2DE0, 0x2DFF), (0xA640, 0xA69F)],
}
GROUPS = {"cjk": ["han", "kana", "hangul", "cjk_punct"]}
@@ -52,7 +54,7 @@ def main() -> int:
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--gguf", required=True, help="the model's (first) GGUF file: its vocabulary")
ap.add_argument("--base", help="the subset to extend (int32 ids)")
- ap.add_argument("--add", default="", help="comma list: han, kana, hangul, cjk_punct, cjk")
+ ap.add_argument("--add", default="", help="comma list: han, kana, hangul, cjk_punct, cjk, cyrillic")
ap.add_argument("--out", help="where to write the new subset")
ap.add_argument("--stats", action="store_true", help="print what the base (and the new) subset holds")
a = ap.parse_args()