Skip to content

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++

launch config never keeps --mtp beside "mtp": false; one line says where the pack and draft layer are read from (B10, C08 note)

Niko122181a72601949e
diff --git a/strata_cli/launch/runner.py b/strata_cli/launch/runner.py
index 8e6a7dc9f..0d2f500cc 100644
--- a/strata_cli/launch/runner.py
+++ b/strata_cli/launch/runner.py
@@ -396,6 +396,8 @@ def derive_config(base: dict, s: S.LaunchSettings, *, bool_flags: frozenset[str]
cfg["args"] = tune_knobs.apply_to_argv([str(x) for x in cfg.get("args") or []], a_changes)
if e_changes:
cfg["env"] = tune_knobs.apply_to_env(dict(cfg.get("env") or {}), e_changes)
+ from strata_control import draft_layer
+ draft_layer.apply(cfg) # "mtp": false (from the installed config too) never sits beside --mtp in the saved args (B10)
return cfg
@@ -1000,9 +1002,37 @@ class Runner:
raise LaunchError("Setup finished but no run config was written for this model.",
"Run `strata launch` again; if it repeats, the setup output above says why.", 6)
self.emit("model", f"{title} is ready.", 100)
+ self.say_reused_data(path)
self.check_pictures(path)
return path
+ def say_reused_data(self, path: Path) -> None:
+ """C08 note: your own model files are used where they are, and when the prepared pack or the draft layer are read from another data folder
+ than the one given, one line says where from."""
+ s = self.s
+ if not (s.model_path and s.data_dir):
+ return
+ try:
+ args = [str(a) for a in read_config(path).get("args") or []]
+ want = Path(s.data_dir).expanduser().resolve()
+ elsewhere = []
+ for flag, label in (("--pack", "the prepared pack"), ("--mtp", "the draft layer")):
+ if flag in args and args.index(flag) + 1 < len(args):
+ value = args[args.index(flag) + 1]
+ if value.isdigit():
+ continue
+ place = Path(value).expanduser().resolve()
+ if not _inside(place, want):
+ elsewhere.append((label, place))
+ if elsewhere:
+ folders = sorted({str(pl.parent.parent if pl.parent.name in ("packs", "mtp") else pl.parent) for _l, pl in elsewhere})
+ text = (f"{' and '.join(l for l, _p in elsewhere).capitalize()} {'is' if len(elsewhere) == 1 else 'are'} read from "
+ f"{', '.join(folders)}, not from {want}; nothing was copied.")
+ self.notices.append(text)
+ self.emit("model", text, 100)
+ except (OSError, ValueError):
+ pass
+
def keep_setup_output(self, lines: list[str]) -> str | None:
"""The last lines setup.py printed, kept next to the launch's other logs so a failed install can be read afterwards (the message
shows one line; a traceback needs the rest). Best effort: None when it cannot be written."""
diff --git a/tests/terminal/test_tui3.py b/tests/terminal/test_tui3.py
index c228883b9..7858e3404 100644
--- a/tests/terminal/test_tui3.py
+++ b/tests/terminal/test_tui3.py
@@ -221,5 +221,76 @@ class SaveWaitsForRestartAnswer(unittest.TestCase):
self.assertEqual(after, ["IQ3_S 32K"]) # saved once the run went on
+class DraftingOffConfig(unittest.TestCase):
+ """B10: the saved launch config has no --mtp in args when "mtp" is false, whatever made it false."""
+
+ BASE = {"args": ["--model", "m.gguf", "--mtp", "C:/x/mtp", "--spec-min-p", "0.5", "--batch-mtp", "--max-context", "32768"], "exe": "x"}
+
+ def derive(self, base, **kw):
+ from strata_control import tune_knobs
+ s = S.LaunchSettings(family="gyro", model="Gyro-S", context=32768, **kw)
+ return R.derive_config(base, s, bool_flags=tune_knobs.BOOL_FLAGS)
+
+ def test_drafting_off_and_mtp_off(self):
+ for kw in ({"drafting": "off"}, {"mtp": "off"}, {"drafting": "off", "extra": {"prefill": "4096"}}):
+ with self.subTest(kw=kw):
+ cfg = self.derive(self.BASE, **kw)
+ self.assertIs(cfg["mtp"], False)
+ self.assertNotIn("--mtp", cfg["args"])
+ self.assertIn("--max-context", cfg["args"])
+
+ def test_an_installed_config_that_already_says_mtp_false(self):
+ cfg = self.derive({**self.BASE, "mtp": False})
+ self.assertIs(cfg["mtp"], False)
+ self.assertNotIn("--mtp", cfg["args"])
+ self.assertNotIn("--spec-min-p", cfg["args"])
+
+ def test_mtp_stays_when_it_is_on(self):
+ cfg = self.derive(self.BASE)
+ self.assertIn("--mtp", cfg["args"])
+
+
+class ReusedDataLine(unittest.TestCase):
+ """C08 note: one line says where the pack and the draft layer are read from."""
+
+ def setUp(self):
+ self.home = Home().__enter__()
+ self.addCleanup(self.home.__exit__, None, None, None)
+ p = mock.patch.object(Catalog, "hardware", lambda self, fresh=False: dict(HW_12, disk_free_gb=500.0))
+ p.start()
+ self.addCleanup(p.stop)
+ self.tmp = tempfile.TemporaryDirectory()
+ self.addCleanup(self.tmp.cleanup)
+ self.base = Path(self.tmp.name)
+
+ def runner(self, cfg_args, **fields):
+ cfg = self.base / "strata-x.json"
+ cfg.write_text(json.dumps({"args": cfg_args}))
+ s = S.LaunchSettings(family="qwen", model="Q2_0", context=32768, **fields)
+ r = Runner(s, catalog=catalog())
+ r.said = []
+ r.emit_cb = lambda e: r.said.append(e.text)
+ return r, cfg
+
+ def test_pack_and_draft_layer_from_the_old_folder_are_named(self):
+ old = self.base / "dl-data"
+ r, cfg = self.runner(["--pack", str(old / "packs" / "x"), "--mtp", str(old / "mtp" / "rt")],
+ model_path=str(self.base / "docs"), data_dir=str(self.base / "c08-data"))
+ r.say_reused_data(cfg)
+ self.assertEqual(len(r.said), 1)
+ self.assertIn("the prepared pack and the draft layer are read from", r.said[0].lower())
+ self.assertIn("dl-data", r.said[0])
+ self.assertIn("nothing was copied", r.said[0])
+
+ def test_no_line_when_they_are_in_the_given_folder_or_nothing_was_given(self):
+ new = self.base / "c08-data"
+ r, cfg = self.runner(["--pack", str(new / "packs" / "x")], model_path=str(self.base / "docs"), data_dir=str(new))
+ r.say_reused_data(cfg)
+ self.assertEqual(r.said, [])
+ r, cfg = self.runner(["--pack", str(self.base / "o" / "packs" / "x")], model_path=str(self.base / "docs"))
+ r.say_reused_data(cfg)
+ self.assertEqual(r.said, [])
+
+
if __name__ == "__main__":
unittest.main()