Skip to content

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.

README

Yamz

Run 100 GB-class AI models on one desktop machine.
Open source. OpenAI API. Built on ExLlamaV3.

MIT AMD NVIDIA Apple Python Hugging Face X

Quick start · Speed · Models · Docs

GLM-5.3-Flash on Strix Halo: 32 tok/s decode, 633 tok/s prefillQwen3.8-Flash-Next on Strix Halo: 53 tok/s decode, 1,576 tok/s prefillQwen3.8-27B on RTX 3090: 75 tok/s decode, 1,621 tok/s prefillDeepSeek V4.1 Flash on Mac Studio M5 Ultra: 62 tok/s decode, 3,001 tok/s prefill

Decode and prefill tok/s at 8K (RTX: 5K), served. Measured on Kyojin 1.8.10 (Strix Halo) and 1.8.9 (RTX, Mac); the Hy4-flash numbers in the table below are 1.9.1.

Quick start

Strix Halo (AMD): install ROCm torch and build once (doc/install.md), then GLM-5.3-Flash:

git clone https://github.com/Yamz-Labs/kyojin && cd kyojin
hf download yamz-labs/GLM-5.3-Flash-EXL3-Yamz --local-dir ./glm-pack
python tools/glm/serve.py --model ./glm-pack --port 8000 -c 131072 --num-draft 2

Hy4-flash (GGUF Q3_K, 64K context, one Strix Halo machine): after the install of doc/install.md, download the publisher's GGUF, build the kernels once and run tools/hy4/serve.py (doc/hy4.md):

hf download AngelSlim/Hy4-flash-GGUF --include "Hy4-flash-Q3_K-*.gguf" --local-dir ./hy4
bash 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 65536

At this setting, on a 128 GB machine with nothing else large resident, the server peaked at 102.7 GiB of GTT and kept about 16 GiB of memory free (15 GiB during a 64K prefill); a smaller -c leaves more (doc/hy4.md). Close other GPU or memory-heavy apps first.

New in 1.9.3 (Hy4-flash)

  • Decode: seven levers on by default (five decode levers, the speculative depth gate, row-batched MLA attention). Served speculative decode at 12K on a Strix Halo box: about +7 % from the five levers, then +3.9 % from the depth gate and +11.5 % from the attention kernel in a second paired run (24.4 / 20.2 / 20.5 tok/s on 1.9.2 for code / prose / chat, 29.6 / 26.4 / 25.1 at the end). Details: changelog.
  • Each lever has a switch: HY4_<FLAG>=0 restores the 1.9.2 path (flag table). Rebuild the kernels with bash tools/hy4/install_strix.sh after the update. The gate and the attention kernel step aside with --slots > 1.
  • Fix: 22 of 42 MoE layers of the Q3_K file never took the new expert path; they do now.
  • Server: a refused request never stops the server; a request without max_tokens gets the room left in the context window. Client smoke gate: tools/hy4/client_smoke.py.

New in 1.9.1 (Hy4-flash)

  • Prefill: lazy layer residual, head-major attention operands, Q3_K gate-up kernel V2. Decode: Q8_0 output head, shared-expert branch forked inside the HIP graph, router launch tuning, absorb v2.
  • Each lever is on by default and has an environment switch: HY4_<FLAG>=0 restores the 1.9.0 behaviour (flag table, changelog). Rebuild the kernels with bash tools/hy4/install_strix.sh after the update.
  • The start-up warm-up now fits any -c.
  • Decensor preset (opt-in, off by default): a small run-time edit of the Hy4 forward that changes no weights. Switch it on with HY4_ABLIT_SPEC=on. Note: validated in no_think mode (judge NO 2-4 of 17 on the dev tree); in the default thinking mode answers can run long (2 of 17 hit the 4096-token cap in our check), a fix is in progress.

Served numbers, one Strix Halo machine, shipped settings, seeded prompts, tok/s (speculative decode is the best speculative setting, plain is no speculation, tau is accepted tokens per round):

depth prefill 1.9.0 prefill 1.9.1 decode spec 1.9.0 decode spec 1.9.1 tau 1.9.1 decode plain 1.9.0 decode plain 1.9.1
4K 785 928 22.5 23.3 2.66 14.6 15.7
16K 869 987 23.7 24.2 2.80 - -
32K 859 982 22.7 21.0 2.77 14.5 15.3
64K 842 962 23.9 24.0 2.87 - -

Decode depends on the generated text through tau (accepted tokens per round), so one served point moves by a few tok/s between prompts. On the same prompt the decode changes of this release give +7 % speculative decode at 4K and a 5 % shorter verify round (paired A/B in one run). Rows 4K to 32K: one Strix Halo machine, the shipped defaults of the release tip (decensor preset off); 64K: a second identical machine, measured one tip earlier with the preset on (cross-check within 3 %). The 32K decode cell is lower than 1.9.0 because that prompt's tau and generated text differ; the same-prompt paired A/B above is the like-for-like measure.

RTX 3090 (NVIDIA): build for CUDA once (tools/cuda/README.md), then Qwen3.8-27B with 245K of context (the served settings, one session), with turboderp's 4.0 bpw pack:

hf download turboderp/Qwen3.8-27B-exl3 --revision SC_4.00bpw_H5_V6 --local-dir ./qwen27-pack
python tools/qwen/serve.py --model ./qwen27-pack -c 245760 --k-bits 6 --v-bits 6 --draft-policy mix

Mac Studio (Apple): follow the kyojin-mac install, then DeepSeek V4.1 Flash:

hf download yamz-labs/DeepSeek-V4.1-Flash-EXL3-Yamz --local-dir ./ds41-pack
python -m kyojin_mlx.serve.server ./ds41-pack --sessions 4 --ctx 32768 --port 8080

Every server speaks the OpenAI API. More commands: doc/models.md.

Test it

With a server running, use its port: GLM on 8000 (the command above), Hy4-flash on 8300, the Mac command above on 8080.

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Say hello in five words."}]}'

Hy4-flash thinks before it answers: the reasoning comes back in reasoning_content and the answer in content, so a small max_tokens can end inside the reasoning and leave content empty. For a direct answer add "reasoning_effort": "no_think" (or "chat_template_kwargs": {"reasoning_effort": "no_think"}), or leave room for the reasoning with a larger max_tokens. A request without max_tokens may use all the room left in the context window (--default-max-tokens 0, the default; a positive value caps it), and a max_tokens larger than that room is clipped to it, not refused:

curl http://localhost:8300/v1/chat/completions -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Say hello in five words."}], "reasoning_effort": "no_think", "max_tokens": 64}'

Tool calling

The Hy4-flash server speaks the OpenAI tool-calling API: tools (and the legacy functions), tool_choice (none, auto, required or a named function; required and a named function are forced: the reply skips the reasoning and starts with the call, the model writes only the arguments, and the name too for required), assistant messages with tool_calls, and tool messages with the result. A reply that calls a function has finish_reason "tool_calls" and message.tool_calls; streamed, the calls arrive as delta.tool_calls. The reasoning stays in reasoning_content.

curl http://localhost:8300/v1/chat/completions -H "Content-Type: application/json" -d '{
  "messages": [{"role": "user", "content": "What is the weather in Paris?"}],
  "tools": [{"type": "function", "function": {"name": "get_weather", "description": "Current weather of a city.",
    "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}],
  "reasoning_effort": "low", "max_tokens": 1024}'

Send the result back with the call: add the assistant message with its tool_calls and a {"role": "tool", "tool_call_id": "<id of the call>", "content": "<result>"} message, and the model answers in text. python tools/hy4/tool_smoke.py --base http://localhost:8300 checks a running server end to end (tool call, stream, round trip, a client that closes the stream). python tools/hy4/client_smoke.py --base http://localhost:8300 --ctx 16384 is the client smoke gate every public release must pass on the real model: SDK chat and completions (stream and not), tool calls (auto / required / named, multi-turn), image / audio / file parts, a dropped stream, no max_tokens on a long prompt, oversized max_tokens, 4 concurrent requests, replayed requests of three agent clients, and a normal request after every case; it prints one PASS / FAIL table (start the server with -c 16384). response_format json_object / json_schema is not supported yet (a 400); several system messages are merged into one, and a last assistant message is continued (prefill).

Speed by context

Tokens per second against context length (log scale), served through the real server with real text. Each chart says its machine, Kyojin version and date. Higher is better.

Strix Halo (AMD), GLM-5.3-Flash and Qwen3.8-Flash-Next

Decode tok/s against context on Strix Halo, GLM-5.3-Flash and Qwen3.8-Flash-NextPrefill tok/s against context on Strix Halo, GLM-5.3-Flash and Qwen3.8-Flash-Next

RTX 3090 (NVIDIA), Qwen3.8-27B

Decode tok/s against context, Qwen3.8-27B on RTX 3090Prefill tok/s against context, Qwen3.8-27B on RTX 3090

Mac Studio (Apple), DeepSeek V4.1 Flash

Decode tok/s against context, DeepSeek V4.1 Flash on Mac StudioPrefill tok/s against context, DeepSeek V4.1 Flash on Mac Studio

Benchmark it yourself

With a server running:

tools/bench.sh --base http://localhost:8000/v1 --reps 3

It prints a Markdown block. Paste it in a benchmark report to share your results (how the figures are measured).

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, 64K context, 128K opt-in (doc/hy4.md, changelog).
  • 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. Hy4-flash ships a small run-time uncensor preset, off by default; it edits no weights (presets/hy4-uncensor). Switch it on with HY4_ABLIT_SPEC=on.

Made with our models

One prompt each, written by the model running on Kyojin and published as it came out. Open the gallery.

Voxel pagoda, GLM-5.3-Flash
Voxel pagoda
GLM-5.3-Flash
Voxel pagoda, Qwen3.8-Flash-Next
Voxel pagoda
Qwen3.8-Flash-Next
Voxel pagoda, MiMo-V2.6-Flash
Voxel pagoda
MiMo-V2.6-Flash

Models

All packs are EXL3 on Hugging Face: ours on yamz-labs, Qwen3.8-27B from turboderp. Serve commands: doc/models.md.

Pack Machine Size
GLM-5.3-Flash Strix Halo 100.1 GB
Qwen3.8-Flash-Next Strix Halo 95.4 GB
Qwen3.8-27B-exl3 (turboderp) RTX 3090 15 GiB
DeepSeek V4.1 Flash Mac Studio, Strix Halo (SSD tier) 184.7 GB
MiMo-V2.6-Flash-MOPD Strix Halo 105.0 GB
Flint-40B-A2.5B RTX 3090 17.9 GB
Nanbeige4.3-33B RTX 3090 18.7 GB

Known limits

  • 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).
  • NVIDIA needs sm_80 or newer; tested on one RTX 3090 with 24 GB (RTX).
  • Hy4-flash: one request at a time, greedy decoding, 64K context measured, with about 15 GiB of memory free at -c 65536 on a 128 GB machine; 128K is opt-in and not measured under a 128K prefill (110.4 GiB of GTT and 7.8 GiB free at load) (doc/hy4.md).
  • The first GLM launch tunes its kernels for about 10 minutes, and the port stays closed until it finishes (install).
  • GLM at -c 131072 leaves about 10 GiB free on a 128 GB machine (install).
  • The 763B model on one 128 GB machine is experimental: real decode is about 5 to 11 tokens per second (Strix Halo).

Contributors

Thank you to everyone who tests Kyojin on their own machine, writes precise reports and sends pull requests. Full list: doc/credits.md.

  • @resynth: the gfx1201 (RDNA4) bring-up and its native GEMV, the RDNA dense GEMV path on gfx1151, skinny hgemm fixes and tests, the GEMV harness, device-aware HIP JIT for GDN, and --cache-bits 8 for GLM.
  • @MangetsuC: the GLM image path (an opt-in GEMM for the spatial-merge convolution, an image cache that keeps the head of a prompt, a disk image cache).
  • @twstagg: the Nix flake (dev shell, package, OCI image) and its serve fixes.
  • @felladrin: --sessions in the Qwen server, the GPU target lookup without rocminfo, the bench tool and its tests, the troubleshooting page and the server environment variable docs.
  • @razethion: opt-in K6 and K8 fused MoE, dense K8 decode and wide launches.
  • @thebigen01: the prefix-disk restore fix for unreachable checkpoints.
  • @zaxbysauce: opt-in CK sparse prefill for MiMo on gfx1151.
  • @nobert: the llama.cpp-compatible Prometheus /metrics endpoint.
  • @mostlygeek: the container build on each release.
  • @Idriss091: the whole test suite without a GPU, and clearer qualify errors.
  • @JoaoFay: escaping reserved image markers in Qwen prompts.
  • Reports and benchmarks: @ilikenwf, @kamjin3086, @OleksKon, @spawnax, @alanoo81, @dturini12, @ChrisC381, @morrisfamily, @xXm-mXx.

New releases thank the authors of their pull requests in the release notes (doc/releasing.md).

Read more

Reports and pull requests are welcome: see CONTRIBUTING.md. Kernel notes: doc/strix-halo.md. Upstream guide: doc/upstream.md.

MIT licence. Built on ExLlamaV3 by turboderp, with the first AMD ports by vcruz305 and sdougbrown: full credits. News: @YamzLabs on X.