[GH-ISSUE #3996] [TUI] launch looks for models/<lower-case tag> while setup.py wrote models/IQ3_S: on a case-sensitive disk a downloaded model shows as "not on this computer" #1717

Closed
opened 2026-11-04 01:53:26 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @TeemuSailynoja on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3996

Problem

strata launch looks for a model in <data>/models/<lower-cased tag> (models/iq3_s), while setup.py writes that folder with the model name's case kept (models/IQ3_S). On a case-sensitive filesystem (Linux) the lookup misses a model that is already fully downloaded, so launch reports the model as not being on this computer and offers the whole download again.

The data is never at risk — if the launch goes ahead, setup.py finds its own .done marks in models/IQ3_S and downloads nothing — but the plan, the screens and the confirm dialog all say the model must be downloaded, and a person who answers "Not now" is blocked for no reason.

Environment

  • Strata 0.2.4.2 (build 0.1.49.2, commit dfa3f40), installed by install.sh
  • Omarchy (Arch) Linux, kernel 7.2.8-9, btrfs (case-sensitive)
  • NVIDIA RTX A5000 24 GB, 125 GiB RAM
  • Model: qwen IQ3_S (Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S, 2 shards, 83.6 GB) already on disk from an earlier install, with its .done marks, the picture reader and the prepared draft layer. No run config yet (fresh Terminal install), so this is the "not installed yet" path.

Reproduce

mkdir -p /tmp/dd/models
ln -s /path/to/Strata-data/mtp /tmp/dd/mtp
ln -s /path/to/Strata-data/models/IQ3_S /tmp/dd/models/IQ3_S
strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui

Expected: the model is recognised as already on disk.
Actual: About 83.6 GB to download: the model (83.6 GB).

Same files, only the letter case of the folder changed (ln -s .../IQ3_S /tmp/dd/models/iq3_s):

$ strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui     # models/iq3_s
  download  Nothing to download: the model is already on this computer. ...

$ strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui     # models/IQ3_S
  download  About 83.6 GB to download: the model (83.6 GB). ...

Without --data-dir the same thing happens on the real data folder: strata launch --model IQ3_S --plan says 83.6 GB while the shards and their .done marks are in Strata-data/models/IQ3_S.

Root cause

  • strata_cli/launch/catalog.py:376-378 — tag_of() returns (families[family].get("tag", "") + model).lower(), i.e. the run-config tag iq3_s.
  • strata_cli/launch/modelstate.py:159 — the on-disk scan uses it as a folder name: folder = base / "models" / catalog.tag_of(family, model), so a downloaded models/IQ3_S counts as 0 GB and Part("weights", …, total) becomes the full download.
  • setup.py:8281 / setup.py:8314 — setup names the folder with the case kept: tag = fam["tag"] + model ("IQ3_S"), models_dir = models_root / tag. The .done marks (setup.py:928-930, used at 8319-8330) are keyed to that same path, which is why setup itself correctly skips the download.
  • Packs and the draft layer go the other way: setup.py:7662, 8083, 8355 use tag.lower() → packs/iq3_s. That is why the two names disagree in one data folder (models/IQ3_S + packs/iq3_s).
  • strata_cli/launch/runner.py:912 (progress_job) uses the lower-case tag as its fallback folder too, so the progress figure can count a folder that does not exist when expected_files is unavailable.

On Windows and macOS the two names resolve to the same folder, so this only shows on a case-sensitive filesystem.

Why renaming the folder is not a fix

Renaming models/IQ3_S to models/iq3_s makes launch happy but breaks setup's own check (setup.py:8314 looks for models/IQ3_S): missing becomes non-empty, models_dir.mkdir() recreates models/IQ3_S and the 83.6 GB are really downloaded a second time. The launch-side lookup has to follow setup's naming, not the other way round.

Suggested fix

A folder lookup that tries the exact tag first and then matches the tag case-insensitively among the entries of models/, used by modelstate.assess and by runner.py's progress fallback. tests/terminal/test_launch.py already builds a models/IQ3_XXS folder in its AdoptRules.files() fixture, so a regression test on a case-sensitive runner is cheap; nothing in tests/terminal covers the modelstate.assess on-disk scan today.

Workarounds that work today

  • strata launch --model-path /path/to/Strata-data/models/IQ3_S … — the files are used where they are and setup writes the run config, after which the folder name no longer matters (the config names the files by absolute path).
  • ln -s IQ3_S models/iq3_s — both names then resolve to the same files, so launch and setup agree.

Reproduction status

Reproduced locally on the unpatched Terminal 0.2.4.2 bundle (both --plan runs above, and the same comparison through modelstate.assess directly). The folder lookup is unchanged on main (7dd5cf18), so the current release and the next one behave the same way.

Originally created by @TeemuSailynoja on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3996 ## Problem `strata launch` looks for a model in `<data>/models/<lower-cased tag>` (`models/iq3_s`), while `setup.py` writes that folder with the model name's case kept (`models/IQ3_S`). On a case-sensitive filesystem (Linux) the lookup misses a model that is already fully downloaded, so launch reports the model as not being on this computer and offers the whole download again. The data is never at risk — if the launch goes ahead, `setup.py` finds its own `.done` marks in `models/IQ3_S` and downloads nothing — but the plan, the screens and the confirm dialog all say the model must be downloaded, and a person who answers "Not now" is blocked for no reason. ## Environment - Strata 0.2.4.2 (build 0.1.49.2, commit `dfa3f40`), installed by `install.sh` - Omarchy (Arch) Linux, kernel 7.2.8-9, **btrfs** (case-sensitive) - NVIDIA RTX A5000 24 GB, 125 GiB RAM - Model: qwen `IQ3_S` (Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S, 2 shards, 83.6 GB) already on disk from an earlier install, with its `.done` marks, the picture reader and the prepared draft layer. No run config yet (fresh Terminal install), so this is the "not installed yet" path. ## Reproduce ``` mkdir -p /tmp/dd/models ln -s /path/to/Strata-data/mtp /tmp/dd/mtp ln -s /path/to/Strata-data/models/IQ3_S /tmp/dd/models/IQ3_S strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui ``` Expected: the model is recognised as already on disk. Actual: `About 83.6 GB to download: the model (83.6 GB).` Same files, only the letter case of the folder changed (`ln -s .../IQ3_S /tmp/dd/models/iq3_s`): ``` $ strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui # models/iq3_s download Nothing to download: the model is already on this computer. ... $ strata launch --model IQ3_S --family qwen --data-dir /tmp/dd --plan --no-tui # models/IQ3_S download About 83.6 GB to download: the model (83.6 GB). ... ``` Without `--data-dir` the same thing happens on the real data folder: `strata launch --model IQ3_S --plan` says 83.6 GB while the shards and their `.done` marks are in `Strata-data/models/IQ3_S`. ## Root cause - `strata_cli/launch/catalog.py:376-378` — `tag_of()` returns `(families[family].get("tag", "") + model).lower()`, i.e. the run-config tag `iq3_s`. - `strata_cli/launch/modelstate.py:159` — the on-disk scan uses it as a folder name: `folder = base / "models" / catalog.tag_of(family, model)`, so a downloaded `models/IQ3_S` counts as 0 GB and `Part("weights", …, total)` becomes the full download. - `setup.py:8281` / `setup.py:8314` — setup names the folder with the case kept: `tag = fam["tag"] + model` (`"IQ3_S"`), `models_dir = models_root / tag`. The `.done` marks (`setup.py:928-930`, used at `8319-8330`) are keyed to that same path, which is why setup itself correctly skips the download. - Packs and the draft layer go the other way: `setup.py:7662`, `8083`, `8355` use `tag.lower()` → `packs/iq3_s`. That is why the two names disagree in one data folder (`models/IQ3_S` + `packs/iq3_s`). - `strata_cli/launch/runner.py:912` (`progress_job`) uses the lower-case tag as its fallback folder too, so the progress figure can count a folder that does not exist when `expected_files` is unavailable. On Windows and macOS the two names resolve to the same folder, so this only shows on a case-sensitive filesystem. ## Why renaming the folder is not a fix Renaming `models/IQ3_S` to `models/iq3_s` makes launch happy but breaks setup's own check (`setup.py:8314` looks for `models/IQ3_S`): `missing` becomes non-empty, `models_dir.mkdir()` recreates `models/IQ3_S` and the 83.6 GB are really downloaded a second time. The launch-side lookup has to follow setup's naming, not the other way round. ## Suggested fix A folder lookup that tries the exact tag first and then matches the tag case-insensitively among the entries of `models/`, used by `modelstate.assess` and by `runner.py`'s progress fallback. `tests/terminal/test_launch.py` already builds a `models/IQ3_XXS` folder in its `AdoptRules.files()` fixture, so a regression test on a case-sensitive runner is cheap; nothing in `tests/terminal` covers the `modelstate.assess` on-disk scan today. ## Workarounds that work today - `strata launch --model-path /path/to/Strata-data/models/IQ3_S …` — the files are used where they are and setup writes the run config, after which the folder name no longer matters (the config names the files by absolute path). - `ln -s IQ3_S models/iq3_s` — both names then resolve to the same files, so launch and setup agree. ## Reproduction status Reproduced locally on the unpatched Terminal 0.2.4.2 bundle (both `--plan` runs above, and the same comparison through `modelstate.assess` directly). The folder lookup is unchanged on `main` (`7dd5cf18`), so the current release and the next one behave the same way.
Author
Owner

@XiaoBinGan commented on GitHub (Oct 27, 2026):

A fix for this is in #4315: the model folder is resolved with a case-insensitive match when the exact name is absent, while the exact path still wins first, so a folder strata launch itself wrote in lower case resolves as before.

Verified on a case-sensitive filesystem (the Windows checkout cannot show it: NTFS matches models/iq3_s to models/IQ3_S). A script loads strata_cli/launch/modelstate.py with its two imported constants stubbed, builds models/IQ3_S with one 4,096-byte shard and asks the module's own resolver:

before the fix (base / 'models' / catalog.tag_of(...)):
  the lower-case path exists on this filesystem                  NO
  old lookup finds the weights                                   0.0 bytes
after the fix (modelstate._model_folder):
  resolver returns the folder as it is spelled                   'IQ3_S'
  the weights in it are counted                                  4.096e-06 GB
  a lower-case folder is still found                             'iq3_s'
RESULT: PASS
ests/terminal/test_tui2_023_plan.py also gained three cases that assert on the resolver's returned folder name, so they mean something on both kinds of filesystem.

Not run: the full strata launch --plan flow on a btrfs install as in your report. The resolver and the byte count are the same code path, but I did not repeat your end-to-end run.

<!-- gh-comment-id:6443450183 --> @XiaoBinGan commented on GitHub (Oct 27, 2026): A fix for this is in #4315: the model folder is resolved with a case-insensitive match when the exact name is absent, while the exact path still wins first, so a folder strata launch itself wrote in lower case resolves as before. Verified on a case-sensitive filesystem (the Windows checkout cannot show it: NTFS matches models/iq3_s to models/IQ3_S). A script loads strata_cli/launch/modelstate.py with its two imported constants stubbed, builds models/IQ3_S with one 4,096-byte shard and asks the module's own resolver: ```text before the fix (base / 'models' / catalog.tag_of(...)): the lower-case path exists on this filesystem NO old lookup finds the weights 0.0 bytes after the fix (modelstate._model_folder): resolver returns the folder as it is spelled 'IQ3_S' the weights in it are counted 4.096e-06 GB a lower-case folder is still found 'iq3_s' RESULT: PASS ``` ests/terminal/test_tui2_023_plan.py also gained three cases that assert on the resolver's returned folder name, so they mean something on both kinds of filesystem. Not run: the full strata launch --plan flow on a btrfs install as in your report. The resolver and the byte count are the same code path, but I did not repeat your end-to-end run.
Author
Owner

@XiaoBinGan commented on GitHub (Oct 27, 2026):

This is fixed in 0.2.7, which I missed when I posted the link to my pull request: Catalog.model_folder() now resolves the folder by trying setup's own spelling first and then a case-insensitive match, and its docstring names this issue. modelstate.assess() calls it, so the plan, the screens and the confirm dialog find a models/IQ3_S folder from the iq3_s tag.

I closed my #4315 as superseded — no need to review it.

For the record, the before-state I verified on a case-sensitive filesystem (Linux, 2026-10-27, the module loaded directly against a models/IQ3_S fixture): the lower-case path did not exist, glob("*.gguf") found nothing, and on_disk_gb was 0.0. That is what 0.2.7 changed.

<!-- gh-comment-id:6445057628 --> @XiaoBinGan commented on GitHub (Oct 27, 2026): This is fixed in **0.2.7**, which I missed when I posted the link to my pull request: Catalog.model_folder() now resolves the folder by trying setup's own spelling first and then a case-insensitive match, and its docstring names this issue. modelstate.assess() calls it, so the plan, the screens and the confirm dialog find a models/IQ3_S folder from the iq3_s tag. I closed my #4315 as superseded — no need to review it. For the record, the before-state I verified on a case-sensitive filesystem (Linux, 2026-10-27, the module loaded directly against a models/IQ3_S fixture): the lower-case path did not exist, glob("*.gguf") found nothing, and on_disk_gb was 0.0. That is what 0.2.7 changed.
Author
Owner

@Niko1221 commented on GitHub (Oct 27, 2026):

Thank you, exactly right. Fixed in 0.2.7: Launch finds the model folder whatever the letter case, so a model already on disk is not offered for download again.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

<!-- gh-comment-id:6445853382 --> @Niko1221 commented on GitHub (Oct 27, 2026): Thank you, exactly right. Fixed in 0.2.7: Launch finds the model folder whatever the letter case, so a model already on disk is not offered for download again. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7
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#1717
No description provided.