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: files Strata downloaded and packs it made go with it even in another models folder; the person's own files stay (#3716)

Niko122147ccec7c6ab0
diff --git a/tests/desktop/test_control_install.py b/tests/desktop/test_control_install.py
index 765f3f84b..a886cd323 100644
--- a/tests/desktop/test_control_install.py
+++ b/tests/desktop/test_control_install.py
@@ -451,6 +451,23 @@ class DeleteModelTests(unittest.TestCase):
described = self.s.describe_config(self.root / "strata-iq3_s.json")
self.assertGreater(described["disk_bytes"], 10000)
+ def test_files_strata_downloaded_into_another_models_folder_are_deleted_too(self):
+ # The app installs into its own Models folder while settings.json names another data folder (#3716).
+ other = Path(self.tmp.name) / "Documents" / "Strata"
+ shard = self.make(other / "Models" / "IQ3" / "m-00001.gguf", 5000)
+ self.make(shard.with_name(shard.name + ".done"), 1)
+ pack = other / "packs" / "iq3"
+ self.make(pack / "dense.bin", 300)
+ self.make(pack / "conversions.json", 2)
+ mine = self.make(Path(self.tmp.name) / "mine" / "own.gguf", 99)
+ (self.root / "strata-iq3x.json").write_text(json.dumps({"exe": "component:strata-engine", "args": [
+ "--pack", str(pack), "--native", str(shard), "--ple-gguf", str(mine)]}), encoding="utf-8")
+ result = self.tools.strata_remove(model="iq3x", confirm=True)
+ self.assertEqual(result["failed"], [])
+ self.assertFalse(shard.exists())
+ self.assertFalse(pack.exists())
+ self.assertTrue(mine.is_file(), "a file the person brought stays")
+
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 cc284ae1e..33d26d973 100644
--- a/tools/strata_mcp.py
+++ b/tools/strata_mcp.py
@@ -766,6 +766,17 @@ class Strata:
return {"models": models, "shared_bytes": shared_bytes, "shared_gb": round(shared_bytes / 1e9, 2),
"total_bytes": total, "total_gb": round(total / 1e9, 2)}
+ @staticmethod
+ def made_by_strata(p: Path, is_dir: bool) -> bool:
+ """A download or pack Strata wrote itself, even in a models folder the person picked or the app chose: a finished GGUF has its
+ .done mark beside it, a prepared pack has its conversion record. The person's own GGUF files have neither (#3716)."""
+ try:
+ if is_dir:
+ return any((p / n).is_file() for n in ("conversions.json", "experts.bin.src.json"))
+ return p.with_name(p.name + ".done").is_file()
+ except OSError:
+ return False
+
def removal_plan(self, config: Path) -> dict:
"""What deleting this model removes and what it keeps. A file or folder another installed model's config still names
(the shared MTP draft, a shared PLE shard) is kept; so is anything outside Strata's own folders."""
@@ -789,7 +800,7 @@ class Strata:
for p, is_dir in [(x, False) for x in files] + [(x, True) for x in dirs]:
if not p.exists():
continue
- if not self.allowed(p):
+ if not self.allowed(p) and not self.made_by_strata(p, is_dir):
keep.append({"path": str(p), "reason": "outside Strata's folders"})
elif shared(p, is_dir):
keep.append({"path": str(p), "reason": "another installed model still uses it"})