[PR #4901] [Engine] Download and prepare: the disk check looks for a ready-made pack where setup writes it (Fix #4892) #5240

Open
opened 2026-11-07 16:33:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4901
Author: @XiaoBinGan
Created: 11/1/2026
Status: 🔄 Open

Base: main ← Head: fix/prepare-check-ready-made-pack-folder


📝 Commits (1)

  • 0e8707f Fix #4892: the prepare check looks for a ready-made pack where setup writes it

📊 Changes

2 files changed (+55 additions, -1 deletions)

View changed files

📝 tools/strata_mcp.py (+8 -1)
📝 tools/test_strata_mcp.py (+47 -0)

📄 Description

Problem and result

Asking to prepare an NVFP4 pack that is already fully on disk was refused for lack of disk space:

not enough free disk space for NVFP4: about 137 GB needed at D:\Strata-data, 122 GB free

tools/strata_mcp.py install_plan() decided "is this model partly on disk?" from models/<family tag><model>
(models/nvfp4-NVFP4). A ready-made pack is written by setup under models/<owner>--<repo> (setup.py
ready_where(), prepared_dir()), so for this pack the probe looked at a folder setup never creates and
partly_downloaded was always False (#4892).

Reproduced on main (c62d5e3a) with a temporary data folder holding the real pack layout and six *.gguf files,
from a pure-Python call (no GPU, model or network):

before: partly_downloaded=False  model_folder=<data>/models/nvfp4-NVFP4  disk_needed_gb=136  disk_short=<set>
after:  partly_downloaded=True   model_folder=<data>/models/Maximilian228--Qwen3.8-Flash-Next-NVFP4-GPTQ-Strata
                                 disk_needed_gb=8  disk_short=None

#4892 — the report, with the real folder layout and the same code path. A focused fix to an existing check, not a
new feature, so no separate scope agreement was asked for.

Approach

  • The folder shown in the plan, and the folder scan, now follow MODELS[model]["repo"] when setup.py names one:
    models/<owner>--<repo>.
  • "Partly downloaded" is decided from setup.py's own expected-file list for this install (expected_files()), whose
    ready-pack branch already resolves each file through ready_where(). Nothing is duplicated: the same function the
    progress view uses decides it.
  • The models/<tag> folder scan stays as the fallback when setup.py cannot be imported (the built-in table has no
    repo) and for the regular downloads, which really are written under the tag folder.
  • The vision entry of the expected list is not counted: the picture reader lives beside the model folders, so its
    presence alone does not mean the model is downloaded.

Validation

Passed: the new regression test on the branch, python -m pytest tools/test_strata_mcp.py -q -k ReadyMadePack
(Python 3.11.16, Windows 11): 2 passed, 52 deselected. One is the NVFP4 pack in its repository folder; the other
pins that a regular download is still found in models/<tag>.

Passed: the module's full suite on the branch, python -m pytest tools/test_strata_mcp.py -q: 1 failed, 53
passed
— the one failure is MacCatalog::test_deepseek_on_a_mac_offers_the_two_sets_that_were_run_with_the_mac_words,
which already fails on unmodified main in this checkout (it predates UD-IQ1_S/M being offered on a Mac) and is
unrelated to this change.

Failed: the same new test on unmodified main (fix removed, test kept):
AssertionError: False is not true : the pack's files are on this disk at tools/test_strata_mcp.py:475. That is the
A/B: the test pins the change.

Not run: a real strata install / "Download and prepare" of an NVFP4 pack on this machine (it needs the 120 GB
pack and a model install). The test drives install_plan() with the real setup.py tables and the real directory
layout, which is the decision that changes.

Limits

  • The plan still reports the 8 GB headroom as disk_needed_gb for a model that is already fully on disk (the
    existing meaning of partly_downloaded: a repair needs the headroom, not a second download). The report's expected
    disk_needed_gb of 9 for vision on the same pack follows from that existing rule.
  • Only the model files' presence is checked, not their hashes: a corrupted shard still counts as downloaded, as it
    did before. The install's own verification is what catches that.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4901 **Author:** [@XiaoBinGan](https://github.com/XiaoBinGan) **Created:** 11/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/prepare-check-ready-made-pack-folder` --- ### 📝 Commits (1) - [`0e8707f`](https://github.com/Niko1221/Strata/commit/0e8707f371bf7b0a125afe9c3482e6e0b3973826) Fix #4892: the prepare check looks for a ready-made pack where setup writes it ### 📊 Changes **2 files changed** (+55 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/strata_mcp.py` (+8 -1) 📝 `tools/test_strata_mcp.py` (+47 -0) </details> ### 📄 Description ## Problem and result Asking to prepare an NVFP4 pack that is already fully on disk was refused for lack of disk space: ```text not enough free disk space for NVFP4: about 137 GB needed at D:\Strata-data, 122 GB free ``` `tools/strata_mcp.py` `install_plan()` decided "is this model partly on disk?" from `models/<family tag><model>` (`models/nvfp4-NVFP4`). A ready-made pack is written by setup under `models/<owner>--<repo>` (`setup.py` `ready_where()`, `prepared_dir()`), so for this pack the probe looked at a folder setup never creates and `partly_downloaded` was always `False` (#4892). Reproduced on `main` (c62d5e3a) with a temporary data folder holding the real pack layout and six `*.gguf` files, from a pure-Python call (no GPU, model or network): ```text before: partly_downloaded=False model_folder=<data>/models/nvfp4-NVFP4 disk_needed_gb=136 disk_short=<set> after: partly_downloaded=True model_folder=<data>/models/Maximilian228--Qwen3.8-Flash-Next-NVFP4-GPTQ-Strata disk_needed_gb=8 disk_short=None ``` ## Related discussion #4892 — the report, with the real folder layout and the same code path. A focused fix to an existing check, not a new feature, so no separate scope agreement was asked for. ## Approach - The folder shown in the plan, and the folder scan, now follow `MODELS[model]["repo"]` when setup.py names one: `models/<owner>--<repo>`. - "Partly downloaded" is decided from setup.py's own expected-file list for this install (`expected_files()`), whose ready-pack branch already resolves each file through `ready_where()`. Nothing is duplicated: the same function the progress view uses decides it. - The `models/<tag>` folder scan stays as the fallback when setup.py cannot be imported (the built-in table has no `repo`) and for the regular downloads, which really are written under the tag folder. - The `vision` entry of the expected list is not counted: the picture reader lives beside the model folders, so its presence alone does not mean the model is downloaded. ## Validation **Passed:** the new regression test on the branch, `python -m pytest tools/test_strata_mcp.py -q -k ReadyMadePack` (Python 3.11.16, Windows 11): **2 passed, 52 deselected**. One is the NVFP4 pack in its repository folder; the other pins that a regular download is still found in `models/<tag>`. **Passed:** the module's full suite on the branch, `python -m pytest tools/test_strata_mcp.py -q`: **1 failed, 53 passed** — the one failure is `MacCatalog::test_deepseek_on_a_mac_offers_the_two_sets_that_were_run_with_the_mac_words`, which already fails on unmodified `main` in this checkout (it predates UD-IQ1_S/M being offered on a Mac) and is unrelated to this change. **Failed:** the same new test on unmodified `main` (fix removed, test kept): `AssertionError: False is not true : the pack's files are on this disk` at `tools/test_strata_mcp.py:475`. That is the A/B: the test pins the change. **Not run:** a real `strata install` / "Download and prepare" of an NVFP4 pack on this machine (it needs the 120 GB pack and a model install). The test drives `install_plan()` with the real `setup.py` tables and the real directory layout, which is the decision that changes. ## Limits - The plan still reports the 8 GB headroom as `disk_needed_gb` for a model that is already fully on disk (the existing meaning of `partly_downloaded`: a repair needs the headroom, not a second download). The report's expected `disk_needed_gb` of 9 for vision on the same pack follows from that existing rule. - Only the model files' presence is checked, not their hashes: a corrupted shard still counts as downloaded, as it did before. The install's own verification is what catches that. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5240
No description provided.