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

Linux app: one real python in the bundle (the other names become launchers), GStreamer bundled in the AppImage, a driver too old for every engine gets one plain line naming the version to install

Niko12218df9e0afd0b5
diff --git a/apps/desktop/scripts/stage-control.py b/apps/desktop/scripts/stage-control.py
index 013d48e40..661d9148c 100644
--- a/apps/desktop/scripts/stage-control.py
+++ b/apps/desktop/scripts/stage-control.py
@@ -84,6 +84,41 @@ def add_installer(folder: Path) -> dict:
return pt.add_installer(folder, ROOT)
+#: What the other names of the interpreter become: Tauri copies a symlink as a full copy of its target, so `python`, `python3` and
+#: `python3.12` in a bundle would be three real files (68 MB each on Linux). Only `python3.12` stays the real one.
+LAUNCHER = """#!/bin/sh
+# Strata: this name only starts the real interpreter beside it (the bundle keeps one copy, not one per name).
+here=$(cd "$(dirname "$0")" && pwd)
+exec "$here/%s" "$@"
+"""
+
+
+def dedupe_python(folder: Path) -> list[str]:
+ """Make every other name of the interpreter in `python/bin` a small launcher of the real binary (Linux and macOS; Windows has one
+ python.exe). A symlink would not survive the bundling, and a plain copy is what costs the space. Returns the names changed."""
+ bindir = folder / "python" / "bin"
+ if not bindir.is_dir():
+ return []
+ real = bindir / f"python{pt.PYTHON_VERSION.rsplit('.', 1)[0]}"
+ if not real.exists():
+ return []
+ if real.is_symlink(): # the real file is a link itself: make the target the real one
+ target = real.resolve()
+ real.unlink()
+ shutil.move(str(target), str(real))
+ changed = []
+ for name in ("python", "python3"):
+ path = bindir / name
+ if not (path.is_symlink() or (path.is_file() and path.stat().st_size == real.stat().st_size)):
+ continue
+ path.unlink()
+ path.write_bytes((LAUNCHER % real.name).encode("utf-8"))
+ path.chmod(0o755)
+ changed.append(name)
+ return changed
+
+
+
def write_bundle_record(folder: Path, archive: Path) -> dict:
manifest_path = archive.with_name(archive.name.rsplit(".", 2 if archive.name.endswith(".tar.gz") else 1)[0] + ".manifest.json")
manifest = json.loads(manifest_path.read_text(encoding="utf-8")) if manifest_path.exists() else {}
@@ -152,6 +187,9 @@ def main() -> int:
for child in inner.iterdir():
shutil.move(str(child), str(a.out / child.name))
shutil.rmtree(inner.parent, ignore_errors=True)
+ launched = dedupe_python(a.out)
+ if launched:
+ print(f"python: {', '.join(launched)} are launchers of the one real interpreter")
print(f"staged {record['component']} {record['version']} ({record['target']}) into {a.out}")
return check(a.out)
diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json
index 18a749513..0d5c53956 100644
--- a/apps/desktop/src-tauri/tauri.conf.json
+++ b/apps/desktop/src-tauri/tauri.conf.json
@@ -38,6 +38,11 @@
"resources/control": "control",
"resources/harness": "harness"
},
+ "linux": {
+ "appimage": {
+ "bundleMediaFramework": true
+ }
+ },
"macOS": {
"minimumSystemVersion": "11.0",
"entitlements": "entitlements.plist"
diff --git a/strata_control/engine_component.py b/strata_control/engine_component.py
index 1f4caeb0d..902711277 100644
--- a/strata_control/engine_component.py
+++ b/strata_control/engine_component.py
@@ -512,6 +512,15 @@ def scan(root: Path | None = None) -> tuple[list[EngineComponent], list[dict]]:
return found, problems
+def driver_notice(have: str | None, need: str) -> str:
+ """The plain sentence for an NVIDIA driver that is too old for every engine on this PC."""
+ major = str(need).split(".")[0]
+ how = ("download it from nvidia.com/drivers" if os.name == "nt" else
+ "on Ubuntu open Software & Updates > Additional Drivers, or run: sudo ubuntu-drivers install")
+ return (f"Your NVIDIA graphics driver ({have}) is too old for Strata. Install driver {major} or newer ({how}), "
+ "restart the computer and open Strata again.")
+
+
def resolve(root: Path | None = None, *, backend: str | None = None, target: str | None = None,
full: bool = False, runtime: str | None = None) -> EngineComponent:
"""The engine to start on this machine, or `EngineMissing` / `EngineIntegrityError`. Never downloads, never creates
@@ -529,6 +538,7 @@ def resolve(root: Path | None = None, *, backend: str | None = None, target: str
# no GPU tool answered: only a CPU engine can be started
wanted = "cpu"
usable, reasons, broken = [], [], []
+ compatible, driver_blocked = 0, []
archs_here = cuda_archs_present() if wanted == "cuda" else []
driver_here = nvidia_driver_version() if wanted == "cuda" else None
hip_here = hip_archs_present() if wanted == "hip" else []
@@ -545,6 +555,7 @@ def resolve(root: Path | None = None, *, backend: str | None = None, target: str
if item.backend != wanted:
reasons.append(f"{label} is a {item.backend} engine, this PC needs {wanted} ({how})")
continue
+ compatible += 1
if item.min_runtime and have_runtime and _version_key(have_runtime) < _version_key(item.min_runtime):
reasons.append(f"{label} needs control {item.min_runtime} or newer, this is {have_runtime}")
continue
@@ -559,6 +570,7 @@ def resolve(root: Path | None = None, *, backend: str | None = None, target: str
need = item.min_driver.get("nvidia")
if need and driver_here and _version_key(driver_here) < _version_key(need):
reasons.append(f"{label} needs NVIDIA driver {need} or newer, this PC has {driver_here}")
+ driver_blocked.append(need)
continue
try:
verify_signature(item)
@@ -572,7 +584,11 @@ def resolve(root: Path | None = None, *, backend: str | None = None, target: str
everything = reasons + [p["folder"] + ": " + p["problem"] for p in problems]
if broken and len(broken) == len(reasons): # every package that fits this PC failed its integrity check
raise EngineIntegrityError("; ".join(broken), base, problems=problems)
- raise EngineMissing("; ".join(everything) or "nothing matched", base, problems=problems)
+ missing = EngineMissing("; ".join(everything) or "nothing matched", base, problems=problems)
+ if driver_blocked and len(driver_blocked) == compatible and not broken:
+ # the only thing in the way is the NVIDIA driver: one plain line that names the version to install
+ missing.driver_notice = driver_notice(driver_here, min(driver_blocked, key=_version_key))
+ raise missing
pin = pinned_folder(base)
if pin: # a manual rollback: the pinned package wins while it is usable
for item in usable:
@@ -622,5 +638,5 @@ def status(root: Path | None = None, *, backend: str | None = None, full: bool =
report["engine"] = chosen.to_dict()
report["usable"] = True
except EngineMissing as exc:
- report["notice"] = str(exc)
+ report["notice"] = getattr(exc, "driver_notice", None) or str(exc)
return report
diff --git a/tests/terminal/test_engine_component.py b/tests/terminal/test_engine_component.py
index e48e6a93b..52064a864 100644
--- a/tests/terminal/test_engine_component.py
+++ b/tests/terminal/test_engine_component.py
@@ -284,6 +284,31 @@ class NeverAcquires(unittest.TestCase):
self.assertFalse(data["ok"])
self.assertIn("never downloads an engine", data["notice"])
+ def test_a_driver_too_old_for_every_engine_gets_one_plain_line_naming_the_version(self):
+ a = make_package(self.root, version="0.1.45", backend="cuda")
+ rewrite(a, min_driver={"nvidia": "580.65"})
+ with mock.patch.object(ec, "nvidia_driver_version", return_value="550.120"):
+ with self.assertRaises(ec.EngineMissing) as caught:
+ ec.resolve(self.root, backend="cuda", runtime="1")
+ note = ec.status(self.root, backend="cuda")["notice"]
+ self.assertIn("580.65", str(caught.exception), "the technical reason stays for the log")
+ self.assertIn("(550.120)", note)
+ self.assertIn("driver 580 or newer", note)
+ self.assertNotIn("component", note)
+ # two builds: the line names the lower requirement; a driver that runs one of them is no problem
+ folder = self.root / "engine" / "0.1.45-twelve"
+ folder.mkdir(parents=True)
+ for item in a.iterdir():
+ (folder / item.name).write_bytes(item.read_bytes())
+ (folder / "strata").chmod(0o755) if not WINDOWS else None
+ rewrite(folder, min_driver={"nvidia": "575.51"})
+ with mock.patch.object(ec, "nvidia_driver_version", return_value="550.120"):
+ self.assertIn("driver 575 or newer", ec.status(self.root, backend="cuda")["notice"])
+ with mock.patch.object(ec, "nvidia_driver_version", return_value="576.02"):
+ self.assertEqual(ec.resolve(self.root, backend="cuda", runtime="1").root.name, "0.1.45-twelve")
+ with mock.patch.object(ec, "nvidia_driver_version", return_value="580.178.04"):
+ self.assertEqual(ec.resolve(self.root, backend="cuda", runtime="1").root.name, a.name, "the newer-driver build wins")
+
def test_the_component_fetcher_refuses_where_acquiring_is_forbidden(self):
store = components.ComponentStore(self.root / "store")
artifact = components.Artifact(name="engine.tar.gz", url="https://example.invalid/e.tgz",