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: Unsloth defaults (owner): STRATA_MMQ_KQ=1 for UD-Q5/Q6, STRATA_HC_Q8=1 on CUDA for the UD-* files, STRATA_ROUTE_TAIL_SKIP=0 where every expert is in RAM; golden configs re-recorded, tests
Niko1221107f9b62b303
diff --git a/setup.py b/setup.pyindex 4fe246b4f..daa5e0612 100644--- a/setup.py+++ b/setup.py@@ -2256,6 +2256,24 @@ def size_tag(family: str, m: str) -> str:return " (recommended)" if m in RECOMMENDED_SIZES.get(family, ()) else ""+def unsloth_default_env(family: str, model: str, hip: bool, in_budget: bool) -> dict:+ """0.1.44 (owner, review-quants.md section 5): the run-config "env" setup writes for Unsloth's files.+ STRATA_MMQ_KQ=1 (the K-quant MMQ prompt kernels) for UD-Q5_K_XL and UD-Q6_K_XL, where its prompt-path KL is equal+ or better than the FP16 path's; UD-Q4_K_XL keeps it opt-in. STRATA_HC_Q8=1 on CUDA for the UD-* files (the+ GGUF's own Q8_0 hyper-connection projections, closer to the file and faster; the GSQ-RCO packs are untouched).+ STRATA_ROUTE_TAIL_SKIP=0 where every expert is in RAM (the skip costs KL there); the RAM-budget mode keeps it."""+ env = {}+ if family != "unsloth":+ return env+ if model in ("UD-Q5_K_XL", "UD-Q6_K_XL"):+ env["STRATA_MMQ_KQ"] = "1"+ if not hip and model.startswith("UD-"):+ env["STRATA_HC_Q8"] = "1"+ if not in_budget:+ env["STRATA_ROUTE_TAIL_SKIP"] = "0"+ return env++def menu_families(hip: bool) -> list:"""The families the model menu lists, in menu order. The NVFP4 packs run on NVIDIA cards only (the AMD and Intelengines have no NVFP4 kernels), so on those the menu does not offer them; `--family nvfp4` still says why not."""@@ -4383,7 +4401,8 @@ def write_config(path: Path, cfg: dict):# "sampling" or "mcp_servers" block, "allowed_hosts", "cors_origins", "open_browser" - and is kept when setup runs againSETUP_KEYS = frozenset({"exe", "args", "cwd", "tokenizer", "model_name", "log", "lib_dirs", "port", "backend", "env","gpu", "gpus_asked", "layer_split", "host", "api_key", "draft_vocab", "vision"})-SETUP_ENV = frozenset({"STRATA_HIPBLASLT_TUNING", "STRATA_RESIDENT_PIN", "STRATA_NO_ARENA_THP"}) # the "env" entries setup writes+SETUP_ENV = frozenset({"STRATA_HIPBLASLT_TUNING", "STRATA_RESIDENT_PIN", "STRATA_NO_ARENA_THP", "STRATA_MMQ_KQ", "STRATA_HC_Q8",+ "STRATA_ROUTE_TAIL_SKIP"}) # the "env" entries setup writesSETUP_VISION = frozenset({"exe", "mmproj", "model", "gpu", "max_tokens", "threads"})@@ -6592,6 +6611,8 @@ def main() -> int:"lib_dirs": lib_dirs, "port": port}if cuda_tk == 12: # the experimental CUDA 12 engine (engine-cuda12/)cfg["cuda"] = 12+ if (uenv := unsloth_default_env(family, model, hip, in_budget)):+ cfg["env"] = uenvif hip:cfg["backend"] = "hip"# the dense prompt GEMMs through hipBLASLt with kernels measured on this GPU generation (tools/hip; +40-60%diff --git a/tools/test_setup_golden.json b/tools/test_setup_golden.jsonindex bab48f50e..81fd9fa48 100644--- a/tools/test_setup_golden.json+++ b/tools/test_setup_golden.json@@ -198,6 +198,10 @@"700"],"cwd": "<T>",+ "env": {+ "STRATA_HC_Q8": "1",+ "STRATA_ROUTE_TAIL_SKIP": "0"+ },"exe": "<T>/engine/<EXE>","gpu": 0,"gpus_asked": true,@@ -428,6 +432,9 @@"700"],"cwd": "<T>",+ "env": {+ "STRATA_HC_Q8": "1"+ },"exe": "<T>/engine/<EXE>","gpu": 0,"gpus_asked": true,@@ -656,6 +663,9 @@"700"],"cwd": "<T>",+ "env": {+ "STRATA_HC_Q8": "1"+ },"exe": "<T>/engine/<EXE>","gpu": 0,"gpus_asked": true,@@ -870,6 +880,9 @@"700"],"cwd": "<T>",+ "env": {+ "STRATA_HC_Q8": "1"+ },"exe": "<T>/engine/<EXE>","gpu": 0,"gpus_asked": true,@@ -1088,6 +1101,10 @@"700"],"cwd": "<T>",+ "env": {+ "STRATA_HC_Q8": "1",+ "STRATA_ROUTE_TAIL_SKIP": "0"+ },"exe": "<T>/engine/<EXE>","gpu": 0,"gpus_asked": true,diff --git a/tools/test_setup_menu.py b/tools/test_setup_menu.pyindex 6bcc1d294..524bc8838 100644--- a/tools/test_setup_menu.py+++ b/tools/test_setup_menu.py@@ -104,6 +104,33 @@ class RecommendedSizes(unittest.TestCase):self.assertEqual(setup.recommended_size("coder", n, 64.0), n[0])+class UnslothDefaultEnv(unittest.TestCase):+ """0.1.44 (owner): the env setup writes for Unsloth's files (review-quants.md section 5)."""++ def test_q5_and_q6_turn_the_k_quant_prompt_kernels_on_q4_does_not(self):+ f = setup.unsloth_default_env+ self.assertEqual(f("unsloth", "UD-Q5_K_XL", False, False)["STRATA_MMQ_KQ"], "1")+ self.assertEqual(f("unsloth", "UD-Q6_K_XL", True, True)["STRATA_MMQ_KQ"], "1")+ for m in ("UD-Q4_K_XL", "UD-IQ4_XS", "Q8_0"):+ self.assertNotIn("STRATA_MMQ_KQ", f("unsloth", m, False, False), m)++ def test_hc_q8_on_cuda_for_the_ud_files_only(self):+ f = setup.unsloth_default_env+ for m in ("UD-IQ4_XS", "UD-Q4_K_XL", "UD-Q5_K_XL", "UD-Q6_K_XL"):+ self.assertEqual(f("unsloth", m, False, True)["STRATA_HC_Q8"], "1", m)+ self.assertNotIn("STRATA_HC_Q8", f("unsloth", m, True, True), m) # not on AMD+ self.assertNotIn("STRATA_HC_Q8", f("unsloth", "Q8_0", False, True))++ def test_tail_skip_off_only_when_every_expert_is_in_ram(self):+ f = setup.unsloth_default_env+ self.assertEqual(f("unsloth", "UD-Q4_K_XL", False, False)["STRATA_ROUTE_TAIL_SKIP"], "0")+ self.assertNotIn("STRATA_ROUTE_TAIL_SKIP", f("unsloth", "UD-Q4_K_XL", False, True)) # budget mode keeps the skip++ def test_other_families_are_untouched(self):+ for fam, m in (("qwen", "IQ3_S"), ("swift", "Q2_0"), ("coder", "IQ1_M"), ("nvfp4", "NVFP4")):+ self.assertEqual(setup.unsloth_default_env(fam, m, False, False), {}, fam)++class EnginePlaceholders(unittest.TestCase):def test_every_engine_minimum_is_this_release(self):self.assertEqual(setup.NVFP4_ENGINE, (0, 1, 44))