Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (agy): treat a pinned GGUF filename as authoritative

Adam Eivyae94711875a4
diff --git a/server/lib/specDecodePresets.js b/server/lib/specDecodePresets.js
index ac366265d5..27b0b4f834 100644
--- a/server/lib/specDecodePresets.js
+++ b/server/lib/specDecodePresets.js
@@ -9,7 +9,10 @@
*
* `quant` is a HINT, not a filename: repos rename their builds
* (`…-Q4_K_M.gguf`, `…-instruct-q4_k_m.gguf`, `….Q4_K_M.gguf`) and a hard-coded
- * filename rots the moment one of them re-uploads. `file`, when present, wins.
+ * filename rots the moment one of them re-uploads — so most entries carry only
+ * the hint. `file` is the exception, and it is a PIN rather than a preference:
+ * it appears only where the quant tag cannot discriminate the target, so a pin
+ * that stops resolving is an error, not a cue to fall back to the hint.
*
* A file with no published single-file GGUF (the DSpark 8B block ships as a
* tokenizer-less checkpoint that has to be converted against its target) simply
diff --git a/server/services/specDecodeModels.js b/server/services/specDecodeModels.js
index 44920f9703..8438b4a4c1 100644
--- a/server/services/specDecodeModels.js
+++ b/server/services/specDecodeModels.js
@@ -107,6 +107,16 @@ export function pickGgufSibling(model, { file, quant, repo }) {
if (file) {
const exact = all.find((name) => name === file);
if (exact) return exact;
+ // A pin is authoritative, never a preference: a preset carries `file` only
+ // because its repo's quant tag CANNOT discriminate the target (Muse-Glimmer
+ // tags the projector and the drafter Q4_K_M too). Falling through to the
+ // quant hint there would reinstate the very ambiguity the pin removes — and
+ // land a 1.6 GB drafter in the base model's path. Fail with something the
+ // user can act on instead.
+ throw new ServerError(
+ `Hugging Face repo ${repo} no longer publishes the pinned file ${file} — pick the replacement at https://huggingface.co/${repo} and set the path by hand.`,
+ { status: 422, code: 'SPEC_FILE_MISSING' },
+ );
}
// A projector ships under the target's own quant tag
// (`mmproj-Muse-Glimmer-30B-Q4_K_M.gguf`, 1.4 GB) right beside the 17 GB target,
diff --git a/server/services/specDecodeModels.test.js b/server/services/specDecodeModels.test.js
index 5c38673cff..9423807942 100644
--- a/server/services/specDecodeModels.test.js
+++ b/server/services/specDecodeModels.test.js
@@ -32,6 +32,21 @@ describe('pickGgufSibling', () => {
expect(pickGgufSibling(model, { file: 'pinned.gguf', quant: 'Q4_K_M', repo: 'o/r' })).toBe('pinned.gguf');
});
+ // A preset pins `file` only where the quant tag can't discriminate the target,
+ // so falling back to the hint when the pin is gone reinstates the ambiguity —
+ // here it would fetch the 1.6 GB drafter into the base model's path.
+ it('refuses to fall back to the quant hint when a pinned file is gone', () => {
+ const model = siblings(
+ 'Muse-Glimmer-30B-KQuant-Dynamic-Q4_K_XL.gguf',
+ 'dflash-Muse-Glimmer-30B-Q4_K_M.gguf',
+ );
+ expect(() => pickGgufSibling(model, {
+ file: 'Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf',
+ quant: 'Q4_K_M',
+ repo: 'meta-models/Muse-Glimmer-30B-GGUF',
+ })).toThrow(/no longer publishes the pinned file/i);
+ });
+
// A lone shard on disk would satisfy the launcher's existence check and then
// fail at load — the exact confusion this module exists to remove.
it('refuses a sharded-only repo instead of fetching part one', () => {