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

model list: gpu_options per model from the shared fit rule (the app reads the choice from here)

Niko122115339326e961
diff --git a/tests/terminal/test_gpu_fit.py b/tests/terminal/test_gpu_fit.py
index b4b099581..425027a84 100644
--- a/tests/terminal/test_gpu_fit.py
+++ b/tests/terminal/test_gpu_fit.py
@@ -106,5 +106,36 @@ class GpuFitRule(unittest.TestCase):
self.assertAlmostEqual(a["ramUseGb"], b["ram_use_gb"])
+class GpuFitInTheModelList(unittest.TestCase):
+ """The app reads the options from the model list (tools/strata_mcp.py model_table): the same rule, nothing duplicated in the UI."""
+
+ def setUp(self):
+ from tests.terminal.launch_support import Home
+ self.home = Home().__enter__()
+ self.addCleanup(self.home.__exit__, None, None, None)
+
+ def sizes(self, hw):
+ from tests.terminal.launch_support import catalog
+ table = catalog(hw).strata.model_table(hw)
+ return {s["model"]: s for f in table for s in f["sizes"]}
+
+ def test_two_cards_give_options_on_every_model(self):
+ from tests.terminal.launch_support import HW_2X16
+ s = self.sizes(HW_2X16)["IQ3_XXS"]
+ res = s["gpu_options"]
+ self.assertEqual([o["key"] for o in res["options"]][:2], ["single", "split"])
+ self.assertEqual(res["recommended"], "single")
+
+ def test_one_card_has_no_choice_to_show(self):
+ from tests.terminal.launch_support import HW_12
+ self.assertIsNone(self.sizes(HW_12)["IQ3_XXS"]["gpu_options"])
+
+ def test_an_integrated_chip_beside_one_card_is_no_choice(self):
+ from tests.terminal.launch_support import HW_2X16
+ hw = dict(HW_2X16)
+ hw["gpus"] = [dict(HW_2X16["gpus"][0]), {"index": 1, "name": "AMD Radeon Graphics", "vram_gb": 16.0, "usable": False, "uma": True, "problem": "integrated graphics"}]
+ self.assertIsNone(self.sizes(hw)["IQ3_XXS"]["gpu_options"])
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/tools/strata_mcp.py b/tools/strata_mcp.py
index 93fb8f9b8..567bff43e 100644
--- a/tools/strata_mcp.py
+++ b/tools/strata_mcp.py
@@ -958,13 +958,26 @@ class Strata:
# (mem_total), for the rest the experts plus ~1 GB for the dense part (Swift IQ2_XS: 35.5 + 1 = 36.5)
"mem_total": bool(d.get("mem_total")),
"memory_gb": round(float(d["ram_gb"]) if d.get("mem_total") else float(d.get("arena_gb") or d["ram_gb"]) + 1.0, 1),
- "on_this_pc": verdict, "installed": tag in have, "id": tag})
+ "on_this_pc": verdict, "installed": tag in have, "id": tag,
+ # which graphics cards to use for it (strata_control/gpu_fit.py, the one rule app / Terminal / setup share):
+ # only with two or more cards that count; "recommended" names the pre-selected option
+ "gpu_options": self.gpu_options(d, ram, hw)})
out.append({"family": f, "title": fd["title"], "about": fd.get("about"),
"experimental": bool(fd.get("experimental")),
"images": any(x["images"] for x in sizes) if sizes else fd.get("vision", True) is not False,
"sizes": sizes})
return out
+ @staticmethod
+ def gpu_options(d: dict, ram, hw) -> dict | None:
+ try:
+ from strata_control import gpu_fit
+ mem = float(d["ram_gb"]) if d.get("mem_total") else float(d.get("arena_gb") or d["ram_gb"]) + 1.0
+ res = gpu_fit.options(round(mem, 1), ram, (hw or {}).get("gpus", []))
+ return res if len(res["options"]) >= 2 else None
+ except Exception: # noqa: BLE001 - the choice is a convenience: never break the model list
+ return None
+
# ---- the running server
def ports(self, port: int | None) -> list[int]:
if port: