Skip to content

fix: move withdrawn presets to public repos and save presets by id; 12110:0 → 12110:1 - #47

Merged
MattDHill merged 3 commits into
masterfrom
fix/public-preset-repos
Nov 22, 2026
Merged

MattDHill merged 3 commits into
masterfrom
fix/public-preset-repos

Conversation

@MattDHill

@MattDHill MattDHill commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Closes #46.

unsloth has made four of the repos our Set Model presets use non-public; the HuggingFace API answers 401, so llama-server resolves no file and exits.

Preset Was Now
Qwen2.5 7B Instruct unsloth/Qwen2.5-7B-Instruct-GGUF (401) Qwen/Qwen2.5-7B-Instruct-GGUF
Qwen2.5 14B Instruct unsloth/Qwen2.5-14B-Instruct-GGUF (401) Qwen/Qwen2.5-14B-Instruct-GGUF
Qwen2.5 32B Instruct unsloth/Qwen2.5-32B-Instruct-GGUF (401) Qwen/Qwen2.5-32B-Instruct-GGUF
Llama 3.1 8B Instruct unsloth/Meta-Llama-3.1-8B-Instruct-GGUF (401) bartowski/Meta-Llama-3.1-8B-Instruct-GGUF (Meta publishes no GGUF)

The other five unsloth presets still answer 200 and have no publisher-official GGUF, so they stay.

Presets are now saved by id, not by repo. The first revision migrated the saved repo string, which the review showed has to be rewritten in four places (start command, per-model settings, custom entry, extra flags), matched by quant rather than repo, and repeated on restore. Rather than carry that for every future withdrawal, store.json now saves the model as {preset} or {hfRepo, hfFile} plus the remaining flags as settingsArgs, and main.ts resolves a preset against presets.ts at every start. A preset's new formerRepos keeps a cached copy from an old repo in use: the current repo wins unless only a former one has the preset's quant cached, and llama-server falls back to cached files when HuggingFace refuses the repo (common_download_get_hf_plan, b12110). Settings are keyed the same way. Replacing a preset's repo is now an edit to presets.ts, with no migration and nothing special on restore.

Migration (12110:1) is a one-time conversion of the old store: every release wrote -hf <repo> [-hff <file>] first, so the model is split off the front of serveArgs and matched to a preset (current or former repo, by the cached file or the quant), and each modelSettings entry is matched the same way.

Recurrence. UPDATING.md gains a per-bump check that every preset repo is public and carries its quant (it flags exactly these four on master), and says to fix a failure by moving the old repo into formerRepos. AGENTS.md forbids writing a preset's repo into store.json or deleting a preset id; README.md documents the resolution and the 401 for Custom models.

Verified on demo.local (generic, x86_64):

  • On 12110:0: ran Llama 3.2 1B, then selected Qwen2.5 7B with ctx 2048 --temp 0.5 and reproduced Model presets fail to download: unsloth/*-GGUF repos return HTTP 401 #46 (GET failed (401), exiting due to model loading error).
  • Updated to this build: the store converted to {preset: 'qwen25-7b'} / {preset: 'llama-32-1b'} entries with every setting intact and serveArgs gone. Qwen2.5 7B downloaded from Qwen's split repo and served; Set Model reopened on it with its settings, and each preset kept its own.
  • With the weights moved under models--unsloth--Qwen2.5-7B-Instruct-GGUF: it served -hf unsloth/Qwen2.5-7B-Instruct-GGUF:Q4_K_M, logged the 401, and loaded the cached copy; Delete Model Cache kept that folder in use and no duplicate cached entry appeared.
  • Custom, preset and switching back wrote clean refs (no mixed preset/hfRepo keys), and resubmitting the running model unchanged did not restart.
  • Not run: a backup/restore round trip. A restored {preset} resolves like the migrated store did with no cache, but I didn't exercise it.

Second review (adopted proposal). A legacy store whose selection is a preset keeps that id through the migration even when its explicit -hff can't be matched without the cache (guarded to stores whose saved repo is one of that preset's); Custom saves the submitted target and a preset its id, with only a downloaded-cache selection keeping the running raw ref; Delete Model Cache protects every cached repo of the selected preset; the UPDATING.md check rejects private and gated repos and runs under POSIX sh. Verified on demo.local: the check flags google/gemma-3-1b-it-qat-q4_0-gguf as gated under dash; Custom Qwen/...:Q4_K_M while the preset ran from unsloth weights saved that raw ref, and reselecting the preset saved {preset}; with both repos cached, both were protected and the delete refused; a fresh 12110:0 with a hand-written cache-free legacy store migrated to {preset: 'qwen25-7b'} with its settings and started -hf Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M -c 2048.

Also: start-sdk 4.0.0 → 4.1.0; the Set Model help-text example (with its translations and instructions.md) names a public repo.

review effort: 'xhigh'

🤖 Generated with Claude Code

…t-sdk to 4.1.0; 12110:0 → 12110:1

unsloth made its Qwen2.5 7B/14B/32B and Meta-Llama-3.1-8B GGUF repos
non-public (the HF API returns 401), so llama-server can't resolve a
file for those presets and exits. The presets now point at Qwen's own
GGUF repos and bartowski's Llama 3.1 8B (Meta publishes no GGUF).

The migration rewrites a saved -hf selection of a withdrawn repo only
when none of its weights are cached: llama-server falls back to
hf_cache::get_cached_files when the repo lookup fails
(common_download_get_hf_plan at b12110), so a cached copy still loads
and moving it would force a needless re-download.

UPDATING.md gains a per-bump check that every preset repo is public
and carries its quant; README documents the failure for support.

Closes #46

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on the migration in startos/versions/current.ts:

  1. Match the cached target, not just its repo. The early return accepts any cached GGUF from the old repo. A user can have Q8_0 cached and select the Q4_K_M preset before updating; the migration then retains the withdrawn repo even though the requested weights are absent. In b12110 common_download_get_hf_plan, the cache fallback still calls find_best_model with the requested quant, so startup still fails. The proposal shares Set Model's existing target parsing/quant matching with the migration and checks the selected file/quant before preserving the old repo.

  2. Migrate the remembered settings alongside the repo. Only serveArgs is rewritten. modelSettings and modelSelection.custom still identify the unsloth repo, while settingsFor requires the repo to match. After an uncached Qwen preset with non-default context/GPU layers/extra flags is migrated, reopening Set Model shows defaults, and submitting replaces the retained daemon settings with those defaults. Inactive affected presets also lose their remembered settings. The proposal rewrites the corresponding saved targets without changing their inference settings, including withdrawn repo overrides in saved extra arguments.

  3. Repair cache-free restores too. When the selected old model is cached, the migration deliberately keeps its withdrawn repo in serveArgs. A backup taken afterward retains those arguments but excludes models/. Restoring that backup at 12110:1 does not cross this version edge, so the new migration does not run and the restored service attempts the withdrawn repo with no fallback weights. The proposal calls the same repair operation from restore init and records the cached-selection/settings/restore guarantees at that shared owner.

The proposal also locates the effective repo argument by its option position rather than lastIndexOf of its value, avoiding replacement of an unrelated later argument containing the same text.

Proposed changes: c3dc982...proposal/47

The reviewed head merges cleanly with master. Independently confirmed all four replacement HuggingFace repos are public, ungated, and list Q4_K_M weights. CI matrix discovery passed; all four variant builds are still running. No builds, tests, typechecks, or runtime checks were run for this review or the proposal; the implementing author must verify adopted changes.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

A preset selection used to be saved as a copy of its repo in serveArgs,
modelSettings, modelSelection.custom and the extra flags, so a withdrawn
upstream repo meant a data migration over all of them, plus a restore
hook, since a cache-free restore never crosses the version edge.

store.json now saves the model as {preset} or {hfRepo, hfFile} and the
remaining server flags as settingsArgs. main.ts resolves a preset against
presets.ts at every start: its hfRepo, unless only a repo in its new
formerRepos has the weights cached, matched by the preset's quant rather
than by repo. Settings are keyed the same way, and a repo entry that is a
preset's quant counts as that preset. Replacing a preset's repo is now an
edit to presets.ts; UPDATING.md and AGENTS.md say so.

The 12110:1 migration is now a one-time conversion of the old store:
every release wrote `-hf <repo> [-hff <file>]` first, so the model is
split off the front of serveArgs and matched to a preset, and each
modelSettings entry is matched the same way.

Verified on demo.local (generic x86_64): installed 12110:0, ran Llama 3.2
1B, then selected Qwen2.5 7B and reproduced #46 (401, model loading
error). Updated to this build: the store converted to {preset} entries
with ctx and extra flags intact, Qwen2.5 7B downloaded from Qwen's split
repo and served, and Set Model reopened on it with its settings. With the
weights moved under the unsloth cache folder, the server ran
-hf unsloth/...:Q4_K_M, got the 401, loaded the cached copy, and Delete
Model Cache kept that folder in use. Custom, preset and unchanged-resubmit
paths wrote clean refs, and the unchanged resubmit did not restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill MattDHill changed the title fix: move withdrawn unsloth presets to public repos; 12110:0 → 12110:1 fix: move withdrawn presets to public repos and save presets by id; 12110:0 → 12110:1 Nov 22, 2026
helix-white added a commit that referenced this pull request Nov 22, 2026
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preset-id approach addresses the earlier findings at their source: quant-specific cache resolution is shared, settings can retain a stable identity, and a restored preset resolves without cached weights. I reviewed the replacement approach on its merits rather than requiring the previous proposal. Four remaining issues need changes:

  1. Preserve the saved preset id when migrating a cache-free legacy backup (startos/versions/current.ts, toRef). Before this PR, a Custom model with an explicit -hff could subsequently be selected as its matching preset; Set Model preserved the running repo/file arguments and saved the preset id in modelSelection.selection. Backups omit the cache. Restore such a backup at the old version and update: matchingPreset cannot match the explicit file to the quant without cached files, so the migration writes a raw withdrawn repo despite having the selected preset id available. The preset still fails with 401. The proposal uses that recorded id for the active model and its matching settings entry, retaining the file-based inference fallback for other entries.

  2. Do not replace a Custom submission with the running preset (startos/actions/setModel.ts, the sameRef preservation shortcut). With qwen25-7b running from cached former Unsloth weights, submit Custom pointing at Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M. sameRef deliberately treats both publishers as equivalent to the preset, so the submitted raw target is discarded and the service keeps using Unsloth; the submitted Custom fields are also not saved because the retained preset has no hfRepo. Conversely, choosing a preset while an equivalent raw Custom ref is running retains the raw ref instead of saving the selected preset id. The proposal limits preservation of an existing raw reference to downloaded-cache selections: Custom honors its submitted target and explicit preset selections remain ids.

  3. Cache-deletion protection must survive changes in resolution after startup (startos/actions/deleteModelCache.ts, inUseEntries). Start a preset with only its former repo cached and configure its current repo as the speculative draft. The main starts from the former repo; downloading the draft then populates the current repo. Delete Model Cache recomputes serveArgsOf against the new cache and protects only the current repo, allowing deletion of the former weights still held by the main process. The proposal conservatively protects all cached candidate repos of the selected preset, using the same candidate owner as resolution. It documents that extra reservation in both user docs; tracking the actual startup target would also satisfy the invariant.

  4. The new per-bump check must inspect gating, not just metadata availability (UPDATING.md). Gated HuggingFace repos can return HTTP 200 and list GGUF files. For example, I read the API metadata for google/gemma-3-1b-it-qat-q4_0-gguf: it lists gemma-3-1b-it-q4_0.gguf while reporting gated: "manual". The supplied checker would report that repo/quant as OK even though anonymous downloads are gated. The proposal requires private: false and gated: false before checking filenames, and keeps the snippet compatible with its sh code fence.

Proposed changes: c5767f0...proposal/47

Reviewed head c5767f0 merges cleanly with master. Current CI has successful matrix discovery, generic and Vulkan builds; NVIDIA and ROCm builds remain running (the retarget-build check is skipped). No builds, tests, typechecks, lint, or runtime execution were performed for this review or proposal. Please verify any adopted changes, especially the legacy-backup migration and selection/cache transitions above.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

…reset repo

Adopts helix-white's proposal on #47, with the saved-id migration
guarded to presets whose current or former repo is the saved one.

- Migration: a legacy store whose modelSelection is a preset keeps that
  id even when its explicit -hff can't be matched to the quant without
  the cache (backups exclude it), and so does its settings entry.
- Set Model: Custom saves the submitted target and a preset saves its
  id; only a downloaded-cache selection keeps the running raw ref.
- Delete Model Cache protects every cached repo of the selected preset,
  since a later download can change which one a start would choose.
- UPDATING.md's check requires private == false and gated == false and
  runs under POSIX sh.

Verified on demo.local: the check passes the nine presets under dash and
flags google/gemma-3-1b-it-qat-q4_0-gguf as gated. With qwen25-7b
running from cached unsloth weights, Custom Qwen/...:Q4_K_M saved that
raw ref and its Custom fields, and selecting the preset again saved
{preset}. With both repos cached, Delete Model Cache disabled both and
refused the unsloth one. A fresh 12110:0 with a hand-written legacy
store (preset selected, unsloth repo with explicit -hff, empty cache)
migrated to {preset: qwen25-7b} with its settings and started with
-hf Qwen/Qwen2.5-7B-Instruct-GGUF:Q4_K_M -c 2048.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 93e47b7.

All four follow-up findings are addressed: legacy cache-free migrations retain the recorded preset id with the repo-membership guard and carry its settings forward; Custom submissions retain their requested target while preset selections save ids; deletion protects cached current/former preset candidates despite cache changes; and the POSIX update checker rejects gated/private repos.

Reviewed the changes since c5767f0 and the surrounding resolution, selection and migration paths. The head merges cleanly with master. Matrix discovery passed; all four variant builds were still running when inspected. No builds, tests, typechecks, lint or runtime execution were performed for this review.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@MattDHill
MattDHill merged commit 13c6c86 into master Nov 22, 2026
6 checks passed
@MattDHill
MattDHill deleted the fix/public-preset-repos branch November 22, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model presets fail to download: unsloth/*-GGUF repos return HTTP 401

2 participants