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: the Cards step uses the shared gpu_fit rule (largest card + RAM recommended, the layer split offered with plain numbers, an integrated chip ignored)

Niko1221c198c25e579d
diff --git a/strata_cli/launch/catalog.py b/strata_cli/launch/catalog.py
index cf17f0d8a..b0420919c 100644
--- a/strata_cli/launch/catalog.py
+++ b/strata_cli/launch/catalog.py
@@ -119,7 +119,14 @@ class Computer:
@property
def usable_gpus(self) -> list[dict]:
- return [g for g in self.gpus if g.get("usable", True)]
+ """The cards that count (strata_control/gpu_fit.py: an integrated chip or a tiny card is ignored), the largest first."""
+ from strata_control import gpu_fit
+ return gpu_fit.usable_cards(self.gpus)[0]
+
+ @property
+ def ignored_gpus(self) -> list[dict]:
+ from strata_control import gpu_fit
+ return gpu_fit.usable_cards(self.gpus)[1]
@property
def main_vram_gb(self) -> float:
diff --git a/strata_cli/launch/screens.py b/strata_cli/launch/screens.py
index ef87b029c..01c4a7caa 100644
--- a/strata_cli/launch/screens.py
+++ b/strata_cli/launch/screens.py
@@ -511,34 +511,63 @@ class ModelScreen(Base):
class CardsScreen(Base):
step_id = "cards"
- help_text = "Strata can use several graphics cards for one model. 'Let Strata choose' is the recommendation."
+ help_text = ("Strata tries the model on your largest graphics card plus the computer's memory first. A second card is offered as a layer "
+ "split: it adds room and reads prompts faster. The recommended choice is already selected; pick another if you prefer.")
+ hints = "↑↓ choose Enter next Esc back ? help"
def body(self) -> ComposeResult:
yield Static(Text("Which graphics cards should it use?", style=f"bold {ACCENT}"), markup=False)
- yield Menu(id="menu")
+ yield Menu([("", 0)], id="menu")
+ yield Static("", id="cardnotes", markup=False)
+
+ def model_memory(self) -> float:
+ s = self.ctx.settings
+ r = next((x for x in self.ctx.rows if (x.family, x.model) == (s.family, s.model)), None)
+ return float(r.memory_gb) if r is not None and r.memory_gb else 44.0
+
+ def choices(self) -> dict:
+ from strata_control import gpu_fit
+ return gpu_fit.options(self.model_memory(), self.ctx.computer.ram_gb, self.ctx.computer.gpus)
def on_mount(self) -> None:
- gpus = self.ctx.computer.usable_gpus
- items = [Item([f"Let Strata choose (recommended): {len(gpus)} cards"], key=None)]
- for g in gpus:
- items.append(Item([f"Only card {g.get('index')}: {g.get('name')}, {float(g.get('vram_gb') or 0):.0f} GB"], key=[g.get("index")]))
- if len(gpus) > 2:
- pass
- items.append(Item(["All of them together, as one"], key=[g.get("index") for g in gpus]))
+ self.res = self.choices()
+ items = []
sel = 0
cur = self.ctx.settings.gpus
- for i, it in enumerate(items):
- if it.key == cur:
+ for i, o in enumerate(self.res["options"]):
+ label = o["label"] + (" (recommended)" if o["recommended"] else "")
+ items.append(Item([label, Cell(o["words"], WARN if o["verdict"] in ("spills", "tight") else "")], key=o["cards"]))
+ if cur is None and o["recommended"] or (cur is not None and o["cards"] == list(cur)):
sel = i
+ self.query_one(Menu).columns = [("", 58), ("", 0)]
self.query_one(Menu).set_items(items, sel)
self.paint()
+ def refresh_body(self) -> None:
+ lines = Text()
+ cur = self.menu().current if self.menu() else None
+ opt = next((o for o in self.res["options"] if cur is not None and o["cards"] == cur.key), None)
+ for n in (opt or {}).get("notes", []):
+ lines.append(f" {n}\n", style=MUTE)
+ for g in self.res["ignored"]:
+ lines.append(f" Not used: {g.get('name')} ({g['why_ignored']}).\n", style=MUTE)
+ try:
+ self.query_one("#cardnotes", Static).update(lines)
+ except Exception: # noqa: BLE001
+ pass
+
+ def on_cursor(self) -> None:
+ self.refresh_body()
+
def explain(self) -> Text:
- return Text("This computer has several graphics cards. One card is simplest; several cards share the model so bigger "
- "models fit. Strata's own choice is a good default.", style=MUTE)
+ return Text("One card plus your RAM is the normal way and keeps things simple. Two cards share the layers: more room for the model and "
+ "prompts read about 20% faster, but a small second card can slow it down. Strata recommends one of them; the choice is yours.",
+ style=MUTE)
def commit(self) -> None:
- self.ctx.settings.gpus = self.menu().current.key
+ cur = self.menu().current
+ rec = next((o["cards"] for o in self.res["options"] if o["recommended"]), None)
+ self.ctx.settings.gpus = None if cur.key == rec else list(cur.key) # the recommended choice stays "let Strata choose" (the same rule in setup)
# ------------------------------------------------------------------------------------------------ 3 folder
diff --git a/strata_control/gpu_fit.py b/strata_control/gpu_fit.py
index 887d74c8a..dfcca9e55 100644
--- a/strata_control/gpu_fit.py
+++ b/strata_control/gpu_fit.py
@@ -92,7 +92,7 @@ def _name(c: dict) -> str:
n = str(c.get("name") or f"card {c.get('index')}")
for junk in ("NVIDIA GeForce ", "NVIDIA ", "AMD Radeon ", "AMD "):
n = n.replace(junk, "")
- return n
+ return n + (f" (card {c.get('index')})" if c.get("_dup") else "")
def _option(key: str, cards: list[dict], memory_gb: float, ram_gb: float | None) -> dict[str, Any]:
@@ -137,6 +137,8 @@ def options(memory_gb: float, ram_gb: float | None, cards: list[dict]) -> dict[s
out: dict[str, Any] = {"options": [], "recommended": None, "ignored": ignored, "cards": len(keep)}
if not keep:
return out
+ names = [str(c.get("name")) for c in keep]
+ keep = [{**c, "_dup": names.count(str(c.get("name"))) > 1} for c in keep] # two cards of one model: told apart by their number
opts = [_option("single", [keep[0]], memory_gb, ram_gb)]
share = [c for c in keep if float(c.get("vram_gb") or 0) >= SPLIT_MIN_VRAM_GB - 0.5]
if len(share) >= 2:
diff --git a/tests/terminal/test_launch_tui.py b/tests/terminal/test_launch_tui.py
index 87f336503..330350355 100644
--- a/tests/terminal/test_launch_tui.py
+++ b/tests/terminal/test_launch_tui.py
@@ -809,18 +809,47 @@ class SaveAndRun(Base):
class CardsStep(Base):
- def test_cards_step_only_with_two_cards(self):
+ def test_cards_step_defaults_to_the_largest_card_plus_ram_and_offers_the_split(self):
async def case(app, pilot, ctx):
await press(pilot, "enter", "enter")
t = text_of(app)
self.assertIn("Which graphics cards should it use?", t)
self.assertIn("Step 2 of 10", t)
- self.assertIn("Let Strata choose (recommended)", t)
- await press(pilot, "down", "enter")
- self.assertEqual(ctx.settings.gpus, [0])
+ flat = " ".join(t.split())
+ self.assertIn("+ RAM", flat) # every choice says what it uses
+ self.assertIn("(layer split)", flat) # the second card is offered as a split
+ self.assertIn("recommended", flat)
+ self.assertIn("fits: needs", flat) # plain numbers
+ cur = app.screen.menu().current
+ self.assertEqual(len(cur.key), 1) # the recommended choice is the single largest card
+ await press(pilot, "enter") # keeping it stores "let Strata choose": the same rule runs in setup
+ self.assertIsNone(ctx.settings.gpus)
self.assertIn("Where should the model files be stored?", text_of(app))
self.run_app(case, ctx=make_ctx(HW_2X16))
+ def test_choosing_the_split_stores_both_cards(self):
+ async def case(app, pilot, ctx):
+ await press(pilot, "enter", "enter", "down", "enter")
+ self.assertEqual(ctx.settings.gpus, [0, 1])
+ self.run_app(case, ctx=make_ctx(HW_2X16))
+
+ def test_a_model_too_big_for_one_card_and_ram_recommends_the_split(self):
+ async def case(app, pilot, ctx):
+ await press(pilot, "enter", "enter")
+ cur = app.screen.menu().current
+ self.assertEqual(sorted(cur.key), [0, 1])
+ hw = dict(HW_2X16)
+ hw["ram_gb"] = 24.0
+ self.run_app(case, ctx=make_ctx(hw))
+
+ def test_an_integrated_chip_beside_one_card_gives_no_cards_step(self):
+ async def case(app, pilot, ctx):
+ await press(pilot, "enter")
+ self.assertIn("Step 1 of 9", text_of(app))
+ hw = dict(HW_2X16)
+ hw["gpus"] = [dict(HW_2X16["gpus"][0]), {"index": 1, "name": "AMD Radeon Graphics", "vram_gb": 16.0, "usable": True, "integrated": True}]
+ self.run_app(case, ctx=make_ctx(hw))
+
def test_one_card_has_nine_steps(self):
async def case(app, pilot, ctx):
await press(pilot, "enter")