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

update: the test start runs the new engine with a short context and no picture reader (#3842), and an update keeps the CUDA build that runs here (#3835); launch: the summary names the engine log (#3656) and a tuned model says how to measure again (#3874); tests

Niko122177284b5e336d
diff --git a/strata_cli/launch/cmd.py b/strata_cli/launch/cmd.py
index 697e99d7c..8df981b91 100644
--- a/strata_cli/launch/cmd.py
+++ b/strata_cli/launch/cmd.py
@@ -413,6 +413,15 @@ def gpu_notices(s: S.LaunchSettings, comp) -> list[S.Notice]:
# ------------------------------------------------------------------------------------------------ plain-text run
+def _engine_log_of(config) -> str:
+ """Where this launch writes the engine's log (#3656): the config's own "log", printed so a failure can be read without a search."""
+ try:
+ from strata_cli.launch.runner import read_config
+ return str(read_config(Path(config)).get("log") or "")
+ except (OSError, ValueError, TypeError):
+ return ""
+
+
def _say(line: str = "") -> None:
sys.stdout.write(line + "\n")
sys.stdout.flush()
@@ -815,6 +824,9 @@ def run_launch(a: argparse.Namespace) -> int:
from strata_cli.launch import access
_say(f" {'API key':<14} {access.mask_key(result.key)} (show it: strata launch --show-key"
+ (f" --preset \"{s.name}\")" if (a.preset or a.save_preset) else ")"))
+ engine_log = _engine_log_of(result.config)
+ if engine_log:
+ _say(f" {'Engine log':<14} {engine_log} (follow it: strata logs --follow)")
for n in result.notices:
_say(f"[!] {n}")
local = next((u for u in result.urls if "127.0.0.1" in u), result.urls[0] if result.urls else "")
diff --git a/strata_cli/launch/runner.py b/strata_cli/launch/runner.py
index e02a20324..032e2117c 100644
--- a/strata_cli/launch/runner.py
+++ b/strata_cli/launch/runner.py
@@ -1345,12 +1345,12 @@ class Runner:
if s.tuned_preset:
try:
presets.find(s.tuned_preset)
- self.emit("tune", "This preset is already tuned for this computer.", 100)
+ self.emit("tune", "This preset is already tuned for this computer. Add --retune to measure again.", 100)
return
except presets.PresetError:
pass
elif s.tuned_at: # measured before: the standard settings were already the fastest, nothing was saved
- self.emit("tune", f"Already tuned on {s.tuned_at}: this computer runs best with the standard settings. Nothing to do.", 100)
+ self.emit("tune", f"Already tuned on {s.tuned_at}: this computer runs best with the standard settings. Nothing to do; add --retune to measure again.", 100)
return
stored = self.stored_tuning()
if stored: # the same model and choices were tuned on this computer before (a run by flags, no preset)
diff --git a/strata_control/feed.py b/strata_control/feed.py
index da2c08b30..ddbdaafe2 100644
--- a/strata_control/feed.py
+++ b/strata_control/feed.py
@@ -413,6 +413,14 @@ def select_engine(packages, hardware: dict) -> tuple[EnginePackage | None, list[
return None, reasons
best = max(fitting, key=lambda p: (version_key(p.version), ec._version_key(p.min_driver.get("nvidia", "0")),
ec.hip_preference(p.archs) if p.backend == "hip" else 1))
+ kept = str(hardware.get("installed_variant") or "")
+ if best.backend == "cuda" and kept and best.variant != kept:
+ # An update never switches the CUDA build (#3835): a model on the CUDA 12 engine (its card is one CUDA 13 has no code for) must not
+ # be given CUDA 13 because ANOTHER card in the PC fits it. The same version of the build that runs here is kept when the feed has it.
+ same = [p for p in fitting if p.backend == "cuda" and p.variant == kept and version_key(p.version) == version_key(best.version)]
+ if same:
+ reasons.append(f"the installed {kept} build is kept; {best.variant} would also fit another card in this PC")
+ best = same[0]
return best, reasons
diff --git a/strata_control/updater.py b/strata_control/updater.py
index d2a8548ad..a1f17bbb3 100644
--- a/strata_control/updater.py
+++ b/strata_control/updater.py
@@ -571,7 +571,7 @@ def _choose_engine(feed: feedmod.Feed, ctx: Context, state: State) -> tuple[dict
"download_bytes": 0, "previous": state.section("engine").get("previous"), "pinned": state.section("engine").get("pinned"),
"problem": None}, None
installed, missing_reason = installed_engine(ctx.components, ctx.hardware)
- sticky = {**ctx.hardware, "installed_variant": installed.variant if installed is not None and installed.backend == "hip" else ""}
+ sticky = {**ctx.hardware, "installed_variant": installed.variant if installed is not None and installed.backend in ("hip", "cuda") else ""}
offered, reasons = feedmod.select_engine([p for p in feed.engine], sticky)
section = state.section("engine")
report = {"installed": _engine_view(installed), "offered": offered.to_dict() if offered else None,
@@ -839,6 +839,36 @@ def _test_start_failure(component: ec.EngineComponent, started: dict, ctx: Conte
return TestStartFailed(component.version, f"it did not answer a one-token probe ({error or started.get('state')}){tail}")
+TEST_CONTEXT = 4096
+_TEST_DROP_WITH_VALUE = ("--kv-resident", "--vision-tokens")
+_TEST_DROP_FLAGS = ("--vision",)
+
+
+def light_test_args(args: list) -> list:
+ """The saved model's engine options made light for the test start (#3842): a short context, no KV kept in VRAM and no picture reader. The
+ test asks whether the NEW engine loads and answers one token, not whether this card holds the model's 262,144-token settings next to the
+ desktop and the running model; a 16 GB card refused good engines with 'out of memory' at the first weight upload."""
+ out, i = [], 0
+ values = [str(x) for x in args]
+ while i < len(values):
+ item = values[i]
+ nxt = values[i + 1] if i + 1 < len(values) else None
+ if item == "--max-context" and nxt is not None:
+ try:
+ out += [item, str(min(int(nxt), TEST_CONTEXT))]
+ except ValueError:
+ out += [item, nxt]
+ i += 2
+ elif item in _TEST_DROP_WITH_VALUE and nxt is not None:
+ i += 2
+ elif item in _TEST_DROP_FLAGS:
+ i += 2 if nxt is not None and not nxt.startswith("--") else 1
+ else:
+ out.append(item)
+ i += 1
+ return out
+
+
def default_test_start(stage_root: Path, component: ec.EngineComponent, ctx: Context) -> dict:
"""Start the staged engine through the real start path (owner runtime, `component:strata-engine`, a saved model), wait for
the one-token generation probe, and stop it. Everything runs in an isolated runtime, profile and component folder, so a
@@ -855,6 +885,8 @@ def default_test_start(stage_root: Path, component: ec.EngineComponent, ctx: Con
cfg["exe"] = ec.REFERENCE_PREFIX + ec.COMPONENT_ID
cfg["backend"] = component.backend
cfg.pop("lib_dirs", None)
+ if isinstance(cfg.get("args"), list):
+ cfg["args"] = light_test_args(cfg["args"])
cfg["host"] = "127.0.0.1"
cfg["port"] = _free_port()
cfg["log"] = str(sandbox / "engine.log")
diff --git a/tests/terminal/test_flow2_022.py b/tests/terminal/test_flow2_022.py
index fec09536a..73fabe07e 100644
--- a/tests/terminal/test_flow2_022.py
+++ b/tests/terminal/test_flow2_022.py
@@ -364,6 +364,7 @@ class StoredTuning(Base):
self.assertFalse(started)
text = seen[-1]
self.assertIn("already tuned for this computer", text)
+ self.assertIn("Add --retune to measure again", text)
self.assertIn("Q2 32K - Full speed", text)
self.assertIn("--retune", text)
self.assertEqual(r.s.tuned_preset, saved["id"])
diff --git a/tests/terminal/test_launch.py b/tests/terminal/test_launch.py
index ff217d2d6..487366cc5 100644
--- a/tests/terminal/test_launch.py
+++ b/tests/terminal/test_launch.py
@@ -952,6 +952,19 @@ class FlagsCommand(unittest.TestCase):
self.assertIn("Nothing was changed.", out)
self.assertEqual(store.list_presets(), [])
+ def test_the_summary_says_where_the_engine_log_is(self): # #3656
+ import tempfile
+ with tempfile.TemporaryDirectory() as d:
+ cfg = Path(d) / "x.json"
+ cfg.write_text(json.dumps({"log": str(Path(d) / "office.engine.log"), "args": []}), encoding="utf-8")
+ fake = Result(profile="launch-office", urls=["http://127.0.0.1:8080"], key=None, tune_word=None, notices=[], config=str(cfg))
+ with mock.patch.object(Runner, "run", return_value=fake):
+ code, out, err = run_cli(["launch", "--no-tui", "--model", "q2_0"])
+ self.assertEqual(code, 0, err)
+ self.assertIn("Engine log", out)
+ self.assertIn("office.engine.log", out)
+ self.assertIn("strata logs --follow", out)
+
def test_run_without_screens_prints_the_address_and_saves_the_preset(self):
fake = Result(profile="launch-office", urls=["http://127.0.0.1:8080", "http://192.168.1.5:8080"], key="sk-strata-abcdefghijkl",
tune_word=None, notices=[], config="/x")
diff --git a/tests/terminal/test_update_feed.py b/tests/terminal/test_update_feed.py
index d95680ad0..983177d51 100644
--- a/tests/terminal/test_update_feed.py
+++ b/tests/terminal/test_update_feed.py
@@ -175,6 +175,16 @@ class Selection(unittest.TestCase):
self.assertTrue(any("580.65" in r for r in old[1]))
self.assertIsNone(self.pick(both, nvidia_driver="500.00")[0])
+ def test_an_update_keeps_the_cuda_build_that_runs_here(self): # #3835
+ both = [entry(variant="cuda12", driver="575.51", archs=("sm_60", "sm_61", "sm_86", "compute_89")), entry(variant="cuda13")]
+ two_cards = {"cuda_archs": ["sm_61", "sm_86"], "nvidia_driver": "615.71"}
+ self.assertEqual(self.pick(both, **two_cards)[0].variant, "cuda13") # nothing installed: as before
+ kept, reasons = self.pick(both, installed_variant="cuda12", **two_cards)
+ self.assertEqual(kept.variant, "cuda12")
+ self.assertTrue(any("is kept" in r for r in reasons))
+ only13 = [entry(variant="cuda13")]
+ self.assertEqual(self.pick(only13, installed_variant="cuda12")[0].variant, "cuda13") # the feed has no 12: the best fit
+
def test_the_newest_version_wins_and_the_card_must_be_covered(self):
newer = [entry("0.1.45"), entry("0.1.46")]
self.assertEqual(self.pick(newer)[0].version, "0.1.46")
diff --git a/tests/terminal/test_updater.py b/tests/terminal/test_updater.py
index 153bdc4f4..4969a34d4 100644
--- a/tests/terminal/test_updater.py
+++ b/tests/terminal/test_updater.py
@@ -457,6 +457,17 @@ class StartPathSignature(UpdaterCase):
ec.verify_signature(ec.read_manifest(folder), {ec.ENV_REQUIRE_SIGNED: "1"})
+class LightTestStart(unittest.TestCase):
+ def test_the_test_start_drops_the_big_context_and_the_picture_reader(self): # #3842
+ args = ["--serve", "--pack", "p", "--max-context", "262144", "--kv", "int8", "--kv-resident", "32768", "--vision",
+ "--vision-tokens", "768", "--spec", "4"]
+ self.assertEqual(updater.light_test_args(args), ["--serve", "--pack", "p", "--max-context", "4096", "--kv", "int8", "--spec", "4"])
+ self.assertEqual(updater.light_test_args(["--max-context", "2048", "--vision", "cpu", "--mtp", "x"]),
+ ["--max-context", "2048", "--mtp", "x"])
+ self.assertEqual(updater.light_test_args(["--vision"]), [])
+ self.assertEqual(updater.light_test_args(["--max-context", "abc"]), ["--max-context", "abc"])
+
+
class LazyModel(UpdaterCase):
"""A server that is "ready" with its model unloaded has not generated anything yet; the test start forces the load and the probe."""