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
Hy4 docs: default context 64K (measured depths), 128K as an opt-in with its memory note
YanissAmz8b7b3b5a89a0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 967ce52..ef8cf0b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,7 +11,7 @@ Hy4-flash (GGUF Q3_K) on one Strix Halo machine. Numbers: see the benchmark tabl- Decode: static-buffer graph step, MTP head from a Q5_K copy of the output head, n-gram rows on top of the drafts, Engram rows prefetched by row.- The server applies the frozen TunableOp results (`tools/hy4/tunableop_gfx1151.csv`) and a start-up warm-up request by default (`HY4_TUNABLEOP_FILE`, `HY4_WARMUP_TOKENS=0` to skip it), and picks up `head_q5_k.bin` next to the GGUF.- Generic GGUF loader (`EXL3_GGUF_GENERIC=1`, off by default) and its CPU tests.-- Context: 128K tokens. Single user (`--slots` is experimental). Greedy decoding only.+- Context: 64K tokens measured (`-c 65536` in the guide); `-c 131072` is opt-in and uses almost all of the memory of a 128 GB machine. Single user (`--slots` is experimental). Greedy decoding only.- A missing built kernel library (repository extension, MoE extension, attention libraries) stops the server with the install step; `HY4_ALLOW_SLOW=1` keeps the old slow-path start.- Decode levers on by default: head-batched MLA attention (`HY4_MLA_HB`), k_b / v_b and output-head products on `tl.dot` (`HY4_BG_DOT`, `HY4_HEAD_DOT`), fp16 router weights (`HY4_RG_F16`), fused K-row / q-rope kernels for verify rows (`HY4_KV_FUSED_MAXT`). Step tests in `tools/hy4/step/`.- The MTP draft-cache fill after prefill writes only K / V and the indexer key state (`HY4_PRIME_KVONLY`, on by default).diff --git a/README.md b/README.mdindex a4e5ef4..9363d57 100644--- a/README.md+++ b/README.md@@ -31,12 +31,12 @@ hf download yamz-labs/GLM-5.3-Flash-EXL3-Yamz --local-dir ./glm-packpython tools/glm/serve.py --model ./glm-pack --port 8000 -c 131072 --num-draft 2```-Hy4-flash (GGUF Q3_K, 128K context, one Strix Halo machine): after the install of [doc/install.md](doc/install.md), download the publisher's GGUF, build the kernels once and run `tools/hy4/serve.py` ([doc/hy4.md](doc/hy4.md)):+Hy4-flash (GGUF Q3_K, 64K context, one Strix Halo machine): after the install of [doc/install.md](doc/install.md), download the publisher's GGUF, build the kernels once and run `tools/hy4/serve.py` ([doc/hy4.md](doc/hy4.md)):```bashhf download AngelSlim/Hy4-flash-GGUF --include "Hy4-flash-Q3_K-*.gguf" --local-dir ./hy4bash tools/hy4/install_strix.sh # once: builds the Hy4 kernels, prints "install_strix: OK"-python tools/hy4/serve.py --model ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf --port 8300 -c 131072+python tools/hy4/serve.py --model ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf --port 8300 -c 65536```RTX 3090 (NVIDIA): build for CUDA once ([tools/cuda/README.md](tools/cuda/README.md)), then Qwen3.8-27B with 245K of context (the served settings, one session), with turboderp's 4.0 bpw pack:@@ -99,7 +99,7 @@ It prints a Markdown block. Paste it in a [benchmark report](https://github.com/## What is inside- Speculative decoding, on by default; it returns the same tokens as plain decoding.-- Hy4-flash (public GGUF, Q3_K) on one Strix Halo machine: sparse-attention prefill, graph decode with MTP drafts, 128K context ([doc/hy4.md](doc/hy4.md), [changelog](CHANGELOG.md)).+- Hy4-flash (public GGUF, Q3_K) on one Strix Halo machine: sparse-attention prefill, graph decode with MTP drafts, 64K context, 128K opt-in ([doc/hy4.md](doc/hy4.md), [changelog](CHANGELOG.md)).- Long context: up to 983K tokens (DeepSeek V4.1 Flash on a Mac Studio), 500K on GLM-5.3-Flash.- Image input on Qwen3.8-27B.- Optional uncensored mode: a small run-time preset on the normal packs, off by default; it edits no weights. How it works: [doc/refusal_hook.md](doc/refusal_hook.md).@@ -130,7 +130,7 @@ All packs are EXL3 on Hugging Face: ours on [yamz-labs](https://huggingface.co/y- Strix Halo needs Linux (Ubuntu/Debian tested), a gfx1151 machine with 128 GB and ROCm 7.0 or newer; ROCm 6.4 has no gfx1151 code ([install](doc/install.md)).- NVIDIA needs sm_80 or newer; tested on one RTX 3090 with 24 GB ([RTX](doc/rtx.md)).-- Hy4-flash: one request at a time, greedy decoding, 128K context ([doc/hy4.md](doc/hy4.md)).+- Hy4-flash: one request at a time, greedy decoding, 64K context measured; 128K is opt-in and uses almost all of the memory ([doc/hy4.md](doc/hy4.md)).- The first GLM launch tunes its kernels for about 10 minutes, and the port stays closed until it finishes ([install](doc/install.md)).- GLM at `-c 131072` leaves about 10 GiB free on a 128 GB machine ([install](doc/install.md)).- The 763B model on one 128 GB machine is experimental: real decode is about 5 to 11 tokens per second ([Strix Halo](doc/strix.md)).diff --git a/doc/hy4.md b/doc/hy4.mdindex de1fd7f..7d5f466 100644--- a/doc/hy4.md+++ b/doc/hy4.md@@ -41,7 +41,7 @@ The server finds `head_q5_k.bin` by itself when it sits next to the GGUF (`HY4_M## Run```bash-python tools/hy4/serve.py --model ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf --port 8300 -c 131072 --num-draft 3+python tools/hy4/serve.py --model ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf --port 8300 -c 65536 --num-draft 3curl http://127.0.0.1:8300/v1/chat/completions -H 'content-type: application/json' \-d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'```@@ -72,12 +72,14 @@ Native Engram IO: `exllamav3/loader/engram_io.c` is compiled with `gcc` at first## Supported context-128K tokens (`-c 131072`). Longer prompts are not supported in this release.+64K tokens (`-c 65536`, the command above). Speed and passkey retrieval are measured on the release build at 4K, 16K, 32K and 64K. Longer prompts are refused with a context-length error.++128K (`-c 131072`) is opt-in and not measured on the release build. Memory: the K buffers grow with `-c`, and at `-c 131072` (fp32 KV) the loaded server already reached 110.4 GiB of GTT and a minimum of 0.9 GiB of available memory on a 128 GB machine. Close other large processes first; if memory runs out, use a smaller `-c`.## Known limits- One request at a time; other requests queue. `--slots N` (several sessions in one batched step) is experimental, see [HY4_MULTI_USER.md](HY4_MULTI_USER.md).- Decoding is greedy: sampling parameters are accepted and ignored. Speculation returns the same tokens as plain greedy decoding.-- Context above 128K is not part of this release.+- Context above 64K is opt-in (128K) and not measured on the release build; above 128K is not part of this release.- The Engram tables (59 GiB) are read from disk by row, so the first requests after a start depend on storage speed.- One model and one quantization (Q3_K). Other Hy4 quantizations are not tested.