Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.
Python amdapple-siliconcudadeepseekexl3exllamav3glminferencellmllm-inferencelocal-llmnvidiaopenai-apiquantizationqwenrocmstrix-halo
Document memory vs speed for the Flash-Next n-gram table (disk ~1480 tok/s at 8K, RAM ~1580 for +22 GiB), re-baseline the README Flash-Next 8K to the disk number, add serve.py --ngram-ram (sets EXL3_NGRAM_STREAM=0)
YanissAmzff16f5e809d6
diff --git a/README.md b/README.mdindex 955f6e7..ccc8533 100644--- a/README.md+++ b/README.md@@ -13,14 +13,14 @@ Open source. Our own quantised builds of GLM and Qwen. Built on <a href="https:/<table align="center"><tr><th align="left">Model</th><th>Pack</th><th>Prefill</th><th>Speculative decode</th></tr>-<tr><td><b>Qwen3.8-Flash-Next</b></td><td align="right">95 GB</td><td align="right">1621 at 8K</td><td align="right"><b>47.5 to 73.2</b></td></tr>+<tr><td><b>Qwen3.8-Flash-Next</b></td><td align="right">95 GB</td><td align="right">1480 at 8K<sup>1</sup></td><td align="right"><b>47.5 to 73.2</b></td></tr><tr><td><b>GLM-5.3-Flash</b></td><td align="right">99.73 GB</td><td align="right">652 at 8K</td><td align="right"><b>27.4 to 36.8</b></td></tr><tr><td>MiMo-V2.6-Flash <sub>(1.5)</sub></td><td align="right">105.8 GB</td><td align="right">760 at 8K</td><td align="right">28.9 to 37.0</td></tr><tr><td>DeepSeek-V4.1-Flash <sub>(experimental, SSD tier)</sub></td><td align="right">185 GB</td><td align="right">187 to 257 at 8K</td><td align="right">5 to 11 <sub>(plain)</sub></td></tr></table>-<p align="center"><sub>Tokens per second on one Ryzen AI Max+ 395 with 128 GB. Prefill at the context shown in each cell, speculative decode across chat, prose and code prompts. DeepSeek-V4.1-Flash is larger than memory: most experts are read from the NVMe (about 3 GB/s), so its prefill is warm/cold and its decode is plain decoding on real sessions; a tool turn of about 2K tokens waits 21 to 35 s for the first token. Details: <a href="doc/DS41.md#speed">doc/DS41.md</a>. Method, sources and full tables: <a href="doc/benchmarks.md">doc/benchmarks.md</a>.</sub></p>+<p align="center"><sub>Tokens per second on one Ryzen AI Max+ 395 with 128 GB. Prefill at the context shown in each cell, speculative decode across chat, prose and code prompts. DeepSeek-V4.1-Flash is larger than memory: most experts are read from the NVMe (about 3 GB/s), so its prefill is warm/cold and its decode is plain decoding on real sessions; a tool turn of about 2K tokens waits 21 to 35 s for the first token. Details: <a href="doc/DS41.md#speed">doc/DS41.md</a>. Method, sources and full tables: <a href="doc/benchmarks.md">doc/benchmarks.md</a>.<br><sup>1</sup> Flash-Next prefill is measured with its 24.4 GiB n-gram table streamed from disk (the default since 1.7.0, saves ~22 GiB of RAM). RAM placement (<code>EXL3_NGRAM_STREAM=0</code>) gives about 1580 and costs those 22 GiB; releases up to 1.6 placed it in RAM automatically, which is where the earlier 1621 came from.</sub></p><p align="center"><img src="doc/img/prefill.svg" alt="Prefill speed against context length" width="49%">@@ -128,6 +128,8 @@ python tools/qwen/serve.py --model ./qwen-pack --port 8000 -c 131072The server speaks the OpenAI API on port 8000. GLM and MiMo commands: [doc/models.md](doc/models.md).+**Memory vs speed (Qwen3.8-Flash-Next).** The 24.4 GiB n-gram table is streamed from disk by default: about 1480 tok/s prefill at 8K and 22 GiB of RAM left free. Add `--ngram-ram` (or set `EXL3_NGRAM_STREAM=0`) to load it into RAM: about 1580 tok/s at 8K, 22 GiB more RAM used. Same switch for any PLE model; results are identical.+## Read more- [Install and first launch](doc/install.md): requirements, build, per-shell setup, first-launch tuning, [system settings for full speed](doc/install.md#system-settings-for-full-speed)diff --git a/doc/models.md b/doc/models.mdindex 6c22af5..ac28d86 100644--- a/doc/models.md+++ b/doc/models.md@@ -6,6 +6,8 @@ Weights: [Yamz on Hugging Face](https://huggingface.co/yamz-labs). Serve command`hf download yamz-labs/Qwen3.8-Flash-Next-EXL3-Yamz --local-dir ./qwen-pack`, then `python tools/qwen/serve.py --model ./qwen-pack --port 8000 -c 131072`. Speculative decoding is on by default and returns the same tokens as plain decoding. The pack needs about 113 GiB of the 128 GB; start to ready takes about 90 s once the pack is in the page cache; the very first start reads 95 GB from disk and can take 7 to 8 minutes. Details: `tools/qwen/SERVE.md`.+**Memory vs speed.** The 24.4 GiB n-gram table is streamed from disk by default (about 1480 tok/s prefill at 8K, 22 GiB of RAM left free). `--ngram-ram` or `EXL3_NGRAM_STREAM=0` loads it into RAM instead: about 1580 tok/s at 8K, 22 GiB more RAM used, identical output.+## GLM-5.3-FlashArchitecture: `glm_moe_dsa` (MLA attention, sparse indexer, MTP). Pack: `yamz-labs/GLM-5.3-Flash-EXL3-Yamz`.diff --git a/tools/qwen/serve.py b/tools/qwen/serve.pyindex eed7b5b..56ff3d4 100644--- a/tools/qwen/serve.py+++ b/tools/qwen/serve.py@@ -2441,6 +2441,7 @@ def main() -> None:"off = always the fixed block. EXL3_DFLASH_ADAPT in the environment wins")parser.add_argument("--no-vision", action="store_true", help="do not load the vision tower (saves memory)")parser.add_argument("--no-uncensor", action="store_true", help="ignore a bundled uncensor_spec.json in the model directory (same as EXL3_ABLIT_RUNTIME=off)")+ parser.add_argument("--ngram-ram", action="store_true", help="load the 24.4 GiB n-gram table into RAM instead of streaming it from disk (same as EXL3_NGRAM_STREAM=0): ~1580 vs ~1480 tok/s prefill at 8K, +22 GiB RAM")parser.add_argument("--default-temperature", type=float, default=None, help="when a request omits it (default: generation_config.json)")parser.add_argument("--default-top-p", type=float, default=None)parser.add_argument("--default-top-k", type=int, default=None)@@ -2459,6 +2460,8 @@ def main() -> None:"pages for its prompt + reply budget when it starts, so a request that does not fit waits. A reply longer than ""its share of the context (-c / sessions) is requeued, not reserved up front")args = parser.parse_args()+ if args.ngram_ram:+ os.environ["EXL3_NGRAM_STREAM"] = "0"if args.draft_policy == "dflash" and not args.dflash_dir:parser.error("--draft-policy dflash needs --dflash-dir")if args.draft_policy == "dflash":