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

Delete a model: every part of a multi-part GGUF goes with it (the run config names only the first), and a part another model names stays (#3716)

Niko1221a8755042bd7f
diff --git a/tests/desktop/test_control_install.py b/tests/desktop/test_control_install.py
index a886cd323..d306de27b 100644
--- a/tests/desktop/test_control_install.py
+++ b/tests/desktop/test_control_install.py
@@ -468,6 +468,32 @@ class DeleteModelTests(unittest.TestCase):
self.assertFalse(pack.exists())
self.assertTrue(mine.is_file(), "a file the person brought stays")
+ def test_every_part_of_a_multi_part_model_goes_with_it_and_a_part_another_model_uses_stays(self):
+ # The run config names only the first part; the others used to stay on disk (#3716).
+ folder = self.data / "models" / "IQ3_XXS"
+ parts = [self.make(folder / f"Big-0000{i}-of-00003.gguf", 5000) for i in (1, 2, 3)]
+ for part in parts:
+ self.make(part.with_name(part.name + ".done"), 1)
+ (self.root / "strata-iq3xxs.json").write_text(json.dumps({"exe": "component:strata-engine", "args": [
+ "--native", str(parts[0]), "--max-context", "32768"]}), encoding="utf-8")
+ plan = self.tools.strata_remove(model="iq3xxs")["plan"]
+ removed = {Path(x["path"]).name for x in plan["remove"]}
+ self.assertTrue({p.name for p in parts} <= removed, removed)
+ result = self.tools.strata_remove(model="iq3xxs", confirm=True)
+ self.assertEqual(result["failed"], [])
+ self.assertEqual([p.exists() for p in parts], [False, False, False])
+ self.assertFalse(folder.exists())
+
+ def test_a_part_that_another_model_names_is_kept_when_a_multi_part_model_is_deleted(self):
+ folder = self.data / "models" / "IQ3_XXS"
+ parts = [self.make(folder / f"Big-0000{i}-of-00002.gguf", 5000) for i in (1, 2)]
+ for part in parts:
+ self.make(part.with_name(part.name + ".done"), 1)
+ (self.root / "strata-iq3xxs.json").write_text(json.dumps({"exe": "component:strata-engine", "args": ["--native", str(parts[0])]}), encoding="utf-8")
+ (self.root / "strata-twin.json").write_text(json.dumps({"exe": "component:strata-engine", "args": ["--native", str(parts[0])]}), encoding="utf-8")
+ self.tools.strata_remove(model="iq3xxs", confirm=True)
+ self.assertTrue(all(p.is_file() for p in parts), "the twin config still uses every part")
+
class LocalGgufInstallTests(unittest.TestCase):
def test_a_plan_from_a_local_folder_adopts_the_files_and_needs_no_download_space(self):
diff --git a/tools/strata_mcp.py b/tools/strata_mcp.py
index 5a5eb2fef..5b5efcf54 100644
--- a/tools/strata_mcp.py
+++ b/tools/strata_mcp.py
@@ -704,6 +704,23 @@ class Strata:
once_d.append(d)
return once, once_d
+ @staticmethod
+ def with_shards(files: list) -> list:
+ """The files plus the other parts of every multi-part GGUF among them (name-00001-of-00004.gguf: the config names only the
+ first), so deleting a model takes all its parts and never leaves 100 GB behind (#3716)."""
+ out, seen = [], set()
+ for f in files:
+ names = [Path(f)]
+ m = SHARD_NAME.match(str(f))
+ if m:
+ names += [Path(f"{m.group(1)}-{i:05d}-of-{m.group(3)}.gguf") for i in range(1, int(m.group(3)) + 1)]
+ for n in names:
+ key = norm(n)
+ if key not in seen:
+ seen.add(key)
+ out.append(n)
+ return out
+
@staticmethod
def tree_bytes(path: Path) -> int:
if path.is_file():
@@ -791,11 +808,13 @@ class Strata:
(the shared MTP draft, a shared PLE shard) is kept; so is anything outside Strata's own folders."""
cfg = self.read_config(config)
files, dirs = self.model_paths(cfg)
+ files = self.with_shards(files)
used_files, used_dirs = set(), set()
for other in self.configs():
if norm(other) == norm(config):
continue
f, d = self.model_paths(self.read_config(other))
+ f = self.with_shards(f)
used_files |= {norm(x) for x in f}
used_dirs |= {norm(x) for x in d}
remove, keep = [], []