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.

Container: warn when the GLM pack has no mtp_eh_proj.st (slower speculative decode)

YanissAmz07564584f587
diff --git a/docker/kyojin_args.py b/docker/kyojin_args.py
index 3b37319..cbb80fd 100644
--- a/docker/kyojin_args.py
+++ b/docker/kyojin_args.py
@@ -53,6 +53,7 @@ TRUE = {"1", "true", "yes", "on"}
FALSE = {"0", "false", "no", "off"}
# Weight files of a pack are listed in this index when the pack is sharded
INDEX = "model.safetensors.index.json"
+GLM_EH_SIDECAR = "mtp_eh_proj.st" # optional file of the GLM pack, read by tools/glm/serve.py
class ConfigError(Exception):
@@ -258,6 +259,9 @@ def build(env, hub=None) -> tuple:
pack = resolve_pack(model_dir, family, env, hub)
argv = [SERVERS[family], "--model", str(pack), "--host", bare("HOST", env, "0.0.0.0"), "--port", port, "-c", ctx]
argv += options + flags + shlex.split(env.get("KYOJIN_EXTRA_ARGS", ""))
+ if family == "glm" and not (pack / GLM_EH_SIDECAR).is_file() and "EXL3_MTP_EH_FP16" not in env:
+ notes.append(f"WARNING: {pack} has no {GLM_EH_SIDECAR}: speculative decode is about 15 % slower without it; "
+ "download the pack again to get the file")
return argv, notes + [f"family={family} pack={pack} context={ctx}"]
diff --git a/docker/test_kyojin_args.py b/docker/test_kyojin_args.py
index 86cf619..aa24151 100644
--- a/docker/test_kyojin_args.py
+++ b/docker/test_kyojin_args.py
@@ -69,6 +69,17 @@ def test_glm_mimo_defaults(tmp_path, family):
assert "--default-top-k" not in argv and "--default-min-p" not in argv
+def test_glm_pack_without_draft_sidecar_is_reported(tmp_path):
+ p = pack(tmp_path, TYPES["glm"])
+ warned = lambda env: any("mtp_eh_proj.st" in n and "WARNING" in n for n in ka.build(env)[1])
+ assert warned(env_for(tmp_path, "glm"))
+ assert not warned({**env_for(tmp_path, "glm"), "EXL3_MTP_EH_FP16": "0"}) # an explicit choice is not second-guessed
+ (p / ka.GLM_EH_SIDECAR).write_text("w")
+ assert not warned(env_for(tmp_path, "glm"))
+ pack(tmp_path / "q", TYPES["qwen"])
+ assert not any("WARNING" in n for n in ka.build(env_for(tmp_path / "q", "qwen"))[1])
+
+
@pytest.mark.parametrize("family", ka.SERVERS)
def test_profile_complete_and_flags_exist_in_servers(family):
"""Each flag emitted for a family, from the profile or from an option, must be an add_argument of that server."""