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: firewall line, overview GPU name and legacy width cap, install.sh accepts an archive with a top folder, tool-call check budget, plain wording for adopted files

Niko12218cc02778e4bc
diff --git a/packaging/install.sh b/packaging/install.sh
index 93447379c..2a17250f5 100644
--- a/packaging/install.sh
+++ b/packaging/install.sh
@@ -92,7 +92,14 @@ dest="$DATA_DIR/terminal/$version"
mkdir -p "$DATA_DIR/terminal" "$BIN_DIR"
rm -rf "$dest.incoming"; mkdir -p "$dest.incoming"
tar -xzf "$work/terminal.tar.gz" -C "$dest.incoming" || die "the archive could not be unpacked (is the disk full?). Nothing was installed."
-[ -x "$dest.incoming/bin/strata" ] || chmod +x "$dest.incoming/bin/strata" 2>/dev/null || true
+if [ ! -f "$dest.incoming/bin/strata" ]; then # an archive with one top folder (a terminal archive instead of the feed's control package)
+ inner=$(ls -d "$dest.incoming"/*/ 2>/dev/null | head -1)
+ if [ -n "$inner" ] && [ -f "${inner}bin/strata" ]; then
+ mv "${inner%/}" "$dest.inner" && rm -rf "$dest.incoming" && mv "$dest.inner" "$dest.incoming"
+ fi
+fi
+[ -f "$dest.incoming/bin/strata" ] || { rm -rf "$dest.incoming"; die "the archive does not look like a Strata Terminal (no bin/strata). Nothing was installed."; }
+chmod +x "$dest.incoming/bin/strata" 2>/dev/null || true
# ---- 4. the signed feed, checked with the Terminal just unpacked
if [ "${STRATA_INSTALL_TEST_TRUST:-}" = 1 ]; then
diff --git a/strata_cli/launch/access.py b/strata_cli/launch/access.py
index 9ae286ca4..759a66796 100644
--- a/strata_cli/launch/access.py
+++ b/strata_cli/launch/access.py
@@ -198,6 +198,14 @@ def urls_for(s: LaunchSettings, *, tunnel_url: str | None = None) -> list[str]:
return base
+def firewall_note(kind: str) -> str | None:
+ """Windows asks the first time a program listens for other computers: say so before it happens, in plain words."""
+ if WINDOWS and kind in ("lan", "tailscale"):
+ return ("Windows may ask whether to allow Strata (python.exe) on your network: choose Allow for private networks. "
+ "If you choose Cancel, the model still works on this computer.")
+ return None
+
+
def new_key() -> str:
import secrets
return "sk-strata-" + secrets.token_urlsafe(24)
diff --git a/strata_cli/launch/check.py b/strata_cli/launch/check.py
index 13ad9aaa2..93d462845 100644
--- a/strata_cli/launch/check.py
+++ b/strata_cli/launch/check.py
@@ -55,13 +55,13 @@ def _prompt_request(wire: str, base: str, model: str) -> tuple[str, dict]:
def _tool_request(wire: str, base: str, model: str) -> tuple[str, dict]:
if wire == "responses":
- return base + "/v1/responses", {"model": model, "input": TOOL_PROMPT, "max_output_tokens": 512, "tool_choice": "auto",
+ return base + "/v1/responses", {"model": model, "input": TOOL_PROMPT, "max_output_tokens": 1536, "tool_choice": "auto",
"tools": [{"type": "function", "name": "get_weather", "description": "Weather of a city",
"parameters": TOOL_SCHEMA}]}
if wire == "messages":
- return base + "/v1/messages", {"model": model, "max_tokens": 512, "messages": [{"role": "user", "content": TOOL_PROMPT}],
+ return base + "/v1/messages", {"model": model, "max_tokens": 1536, "messages": [{"role": "user", "content": TOOL_PROMPT}],
"tools": [{"name": "get_weather", "description": "Weather of a city", "input_schema": TOOL_SCHEMA}]}
- return base + "/v1/chat/completions", {"model": model, "max_tokens": 512, "messages": [{"role": "user", "content": TOOL_PROMPT}],
+ return base + "/v1/chat/completions", {"model": model, "max_tokens": 1536, "messages": [{"role": "user", "content": TOOL_PROMPT}],
"tools": [{"type": "function", "function": {"name": "get_weather", "description": "Weather of a city",
"parameters": TOOL_SCHEMA}}]}
diff --git a/strata_cli/launch/cmd.py b/strata_cli/launch/cmd.py
index 9a88d96b6..5dc24d8a4 100644
--- a/strata_cli/launch/cmd.py
+++ b/strata_cli/launch/cmd.py
@@ -467,6 +467,10 @@ def run_launch(a: argparse.Namespace) -> int:
for n in notes:
if not machine:
_say(f"[!] {n.line()}")
+ from strata_cli.launch import access as _access
+ fw = _access.firewall_note(s.access)
+ if fw and not machine:
+ _say(f"[!] {fw}")
if interactive and have_choices:
from strata_cli.launch import app
return app.run_tui(s, catalog=catalog, feed=a.feed, auto_run=True, save=bool(a.save_preset))
diff --git a/strata_cli/launch/runner.py b/strata_cli/launch/runner.py
index 8e4b1438d..6b172cdee 100644
--- a/strata_cli/launch/runner.py
+++ b/strata_cli/launch/runner.py
@@ -448,9 +448,9 @@ class Runner:
"Use model files that were prepared on this computer already (folder + pack), or install on a computer with an NVIDIA or AMD card.", 5)
path = cat.root / f"strata-{tag}.json"
adopt.write(path, cfg)
- self.notices.append("The installer does not support this graphics card yet, so Strata wrote the run settings itself from your prepared files "
- f"({path.name}). Nothing was downloaded.")
- self.emit("model", f"Wrote the run settings from your prepared files ({path.name}); the installer does not support this card.", 100, level="warn")
+ self.notices.append("The downloader built into this Terminal sets up NVIDIA and AMD cards only (Intel Arc cards have a separate installer), so Strata wrote the "
+ f"run settings itself from the prepared model files already on this computer ({path.name}). Nothing was downloaded.")
+ self.emit("model", f"Used your prepared model files and wrote the run settings ({path.name}); this card is not one the built-in downloader sets up.", 100, level="warn")
return path
def resolve_own_files(self) -> None:
diff --git a/strata_cli/launch/screens.py b/strata_cli/launch/screens.py
index 464f0fbc2..6886a4f12 100644
--- a/strata_cli/launch/screens.py
+++ b/strata_cli/launch/screens.py
@@ -1093,6 +1093,9 @@ class AccessScreen(Base):
missing = acc.missing_helper(cur.key)
if missing:
out.append(missing + "\n", style=WARN)
+ fw = acc.firewall_note(cur.key)
+ if fw:
+ out.append(fw + "\n", style=WARN)
if cur.key == "cloudflare":
out.append("A Cloudflare quick tunnel gives a temporary public address; anyone with it can try to use the server, so keep the API key on.", style=MUTE)
elif cur.key == "lan":
diff --git a/strata_cli/monitor.py b/strata_cli/monitor.py
index 81723a72b..7861803b0 100644
--- a/strata_cli/monitor.py
+++ b/strata_cli/monitor.py
@@ -175,7 +175,7 @@ class MonitorApp(App):
if self.view == 0 and size.width >= 78 and size.height >= 23 and self.metrics_model is not None and self.connection_state in ("connected", "stale", "telemetry_unavailable"):
from strata_cli import overview
display = overview.render(
- self.metrics_model, width=max(30, size.width - self.margin), height=max(8, size.height - 2),
+ self.metrics_model, width=max(30, min(size.width - self.margin, 100 if self.margin > 2 else 1000)), height=max(8, size.height - 2),
connection=getattr(self.endpoint, "base_url", getattr(self.endpoint, "root", "")),
connection_state=self.connection_state, frozen=self.frozen, glyphs=self.glyph_choice,
color=self.color_choice != "never", theme=self.theme_choice, connect=self.connect_enabled)
diff --git a/strata_cli/overview.py b/strata_cli/overview.py
index 0746b89c3..b8ab044a6 100644
--- a/strata_cli/overview.py
+++ b/strata_cli/overview.py
@@ -167,6 +167,16 @@ def bar(frac: float | None, width: int, glyphs: str, color: str, empty: str = GR
return t
+def short_gpu(name: str | None) -> str:
+ """The card's name without the maker prefixes that eat a tile's width ("NVIDIA GeForce RTX 5070" -> "RTX 5070")."""
+ if not name:
+ return "graphics card"
+ for prefix in ("NVIDIA GeForce ", "NVIDIA ", "AMD Radeon ", "AMD ", "Intel(R) ", "Intel "):
+ if name.startswith(prefix):
+ name = name[len(prefix):]
+ return name
+
+
def fmt(v: float | None, digits: int = 0, unit: str = "") -> str:
if v is None:
return "--"
@@ -256,7 +266,7 @@ def render(model: dict, *, width: int, height: int, connection: str, connection_
util_scale = dict(lo=0, hi=100)
tiles1 = [
_tile("Speed", f"{fmt(spd, 1)} tok/s" if spd is not None else "-- tok/s", spd_note, spark(spd_hist, inner, glyphs), tile_w, accent=accent, box_style=box_style),
- _tile("GPU load", f"{fmt(g['util'])} %", (g["name"] or "graphics card") if g["count"] in (None, 1) else f"{g['name']} +{int(g['count']) - 1}",
+ _tile("GPU load", f"{fmt(g['util'])} %", short_gpu(g["name"]) if g["count"] in (None, 1) else f"{short_gpu(g['name'])} +{int(g['count']) - 1}",
spark(g["util_hist"], inner, glyphs, **util_scale), tile_w, accent=accent, box_style=box_style),
_tile("VRAM", f"{fmt(g['vram_used'], 1)} / {fmt(g['vram_total'], 0)} GB",
(f"{int(model['experts']['slots']):,} experts cached" if model["experts"]["slots"] is not None else "graphics memory"),
diff --git a/tests/terminal/test_launch.py b/tests/terminal/test_launch.py
index 1fa649f75..d97ee994d 100644
--- a/tests/terminal/test_launch.py
+++ b/tests/terminal/test_launch.py
@@ -411,6 +411,15 @@ class AccessRules(unittest.TestCase):
self.assertEqual(access.urls_for(S.LaunchSettings(access="cloudflare", port=8080), tunnel_url="https://a.trycloudflare.com")[0],
"https://a.trycloudflare.com")
+ def test_the_windows_firewall_question_is_announced_before_it_happens(self):
+ with mock.patch.object(access, "WINDOWS", True):
+ self.assertIn("choose Allow for private networks", access.firewall_note("lan"))
+ self.assertIn("still works on this computer", access.firewall_note("tailscale"))
+ self.assertIsNone(access.firewall_note("local"))
+ self.assertIsNone(access.firewall_note("cloudflare"))
+ with mock.patch.object(access, "WINDOWS", False):
+ self.assertIsNone(access.firewall_note("lan"))
+
def test_helper_output_filter_drops_login_lines(self):
self.assertEqual(access.filter_line("Please open this URL to login: https://dash.cloudflare.com/argotunnel?token=abc"), "")
self.assertEqual(access.filter_line("Your quick Tunnel has been created: https://x.trycloudflare.com"),
diff --git a/tests/terminal/test_launch_install.py b/tests/terminal/test_launch_install.py
index 3a638d3e7..6e1e64ced 100644
--- a/tests/terminal/test_launch_install.py
+++ b/tests/terminal/test_launch_install.py
@@ -116,6 +116,18 @@ class Feed(unittest.TestCase):
self.assertTrue((home / ".local" / "bin" / "strata").exists())
v = subprocess.run([str(home / ".local" / "bin" / "strata"), "--version"], capture_output=True, text=True, env=env, timeout=60)
self.assertEqual(v.returncode, 0, v.stderr)
+ # an archive with one top folder (a terminal archive, not the feed's control package) installs too
+ data = archive.read_bytes()
+ (feed / "top.tar.gz").write_bytes(data)
+ (feed / "install-manifest.txt").write_text(f"linux-x86_64 9.9.9 top.tar.gz {hashlib.sha256(data).hexdigest()} {len(data)}
+")
+ home3 = work / "home3"
+ home3.mkdir()
+ r = subprocess.run(["sh", str(feed / "install.sh")], capture_output=True, text=True, env={**env, "HOME": str(home3)}, timeout=240)
+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
+ self.assertTrue((home3 / ".local" / "share" / "strata" / "terminal" / "9.9.9" / "bin" / "strata").exists())
+ (feed / "install-manifest.txt").write_text(" ".join(line) + "
+")
# a damaged download is refused and nothing is installed
data = (feed / line[2]).read_bytes()
(feed / line[2]).write_bytes(data[:-10] + b"x" * 10)
diff --git a/tests/terminal/test_launch_tui.py b/tests/terminal/test_launch_tui.py
index 0fa40ea59..2ff66e880 100644
--- a/tests/terminal/test_launch_tui.py
+++ b/tests/terminal/test_launch_tui.py
@@ -661,6 +661,16 @@ class AccessStep(Base):
self.assertIn("http://127.0.0.1:9090", text_of(app))
self.run_app(case)
+ def test_windows_firewall_line_shows_on_lan_only(self):
+ async def case(app, pilot, ctx):
+ with mock.patch.object(access, "WINDOWS", True):
+ await press(pilot, *self.reach())
+ self.assertNotIn("Windows may ask", flat(app))
+ await press(pilot, "down")
+ self.assertIn("Windows may ask whether to allow Strata", flat(app))
+ self.assertIn("choose Allow for private networks", flat(app))
+ self.run_app(case)
+
def test_key_toggle_and_new_key(self):
async def case(app, pilot, ctx):
await press(pilot, *self.reach(), "down")