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

feat: offer a model's draft decoder as a scoped download target beside its own weights (#5423)

[._.]/ Adam Eivy7e877225f1ca
diff --git a/server/lib/apiRouteCatalog.generated.json b/server/lib/apiRouteCatalog.generated.json
index fc4118bab9..0a179f9ed1 100644
--- a/server/lib/apiRouteCatalog.generated.json
+++ b/server/lib/apiRouteCatalog.generated.json
@@ -21985,7 +21985,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 920
+ "line": 932
}
]
},
@@ -21996,7 +21996,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1307
+ "line": 1319
}
]
},
@@ -22007,7 +22007,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1283
+ "line": 1295
}
]
},
@@ -22018,7 +22018,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1312
+ "line": 1324
}
]
},
@@ -22029,7 +22029,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1341
+ "line": 1353
}
]
},
@@ -22040,7 +22040,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1389
+ "line": 1401
}
]
},
@@ -22051,7 +22051,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1361
+ "line": 1373
}
]
},
@@ -22062,7 +22062,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1397
+ "line": 1409
}
]
},
@@ -22073,7 +22073,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1393
+ "line": 1405
}
]
},
@@ -22084,7 +22084,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 799
+ "line": 811
}
]
},
@@ -22095,7 +22095,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 818
+ "line": 830
}
]
},
@@ -22106,7 +22106,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1414
+ "line": 1426
}
]
},
@@ -22150,7 +22150,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 765
+ "line": 777
}
]
},
@@ -22161,7 +22161,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 750
+ "line": 762
}
]
},
@@ -22172,7 +22172,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 653
+ "line": 665
}
]
},
@@ -22183,7 +22183,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 733
+ "line": 745
}
]
},
@@ -22238,7 +22238,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1431
+ "line": 1443
}
]
},
@@ -22249,7 +22249,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 907
+ "line": 919
}
]
},
@@ -22260,7 +22260,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 893
+ "line": 905
}
]
},
@@ -22271,7 +22271,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 863
+ "line": 875
}
]
},
@@ -22282,7 +22282,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 873
+ "line": 885
}
]
},
@@ -22293,7 +22293,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1382
+ "line": 1394
}
]
},
@@ -22304,7 +22304,7 @@
"sources": [
{
"source": "server/routes/videoGen.js",
- "line": 1420
+ "line": 1432
}
]
},
diff --git a/server/routes/videoGen.js b/server/routes/videoGen.js
index eeb3694832..e1c02c1375 100644
--- a/server/routes/videoGen.js
+++ b/server/routes/videoGen.js
@@ -53,7 +53,7 @@ import {
isStockTextEncoder,
} from '../lib/videoTextEncoders.js';
import { isDefaultSpeedProfile } from '../lib/videoSpeedProfiles.js';
-import { DRAFT_DECODE_IDS, isFullDecode } from '../lib/videoDraftDecoders.js';
+import { DRAFT_DECODE_IDS, isFullDecode, downloadableVideoDraftDecoders } from '../lib/videoDraftDecoders.js';
import {
inspectModelCache, verifyModelCache, repairModelCache, repairCachedFile,
verifyCachedRepoFiles, repairCachedRepoFiles, summarizeVerify, aggregateVerifies,
@@ -567,6 +567,18 @@ const modelDownloadTargets = (model) => {
const only = safeOnlyList(videoModelLabel(model), dep.files, 'required-weight');
if (only.length > 0) targets.push({ repo: dep.repo, revision: dep.revision || null, only });
}
+ // The model's preview-fidelity decoder (#5423), when it declares one. Scoped
+ // to its pinned file for the same reason every other entry here is — and
+ // listed under the MODEL rather than as a standalone target, because it is
+ // useless without the checkpoint it decodes for, so the download badge that
+ // offers it belongs beside that model's own.
+ for (const decoder of downloadableVideoDraftDecoders([model])) {
+ targets.push({
+ repo: decoder.repo,
+ revision: decoder.revision || null,
+ only: safeOnlyList(`Draft decoder "${decoder.id}"`, decoder.files, 'weight-file'),
+ });
+ }
return targets;
};
diff --git a/server/routes/videoGen.test.js b/server/routes/videoGen.test.js
index 257f71360a..abcdb664bf 100644
--- a/server/routes/videoGen.test.js
+++ b/server/routes/videoGen.test.js
@@ -804,11 +804,12 @@ describe('videoGen routes', () => {
// A closed enum, unlike textEncoderId/speedProfileId — there is at most one
// draft decoder per model, so an unknown value is a client bug, not a
// per-model option the route can't enumerate.
- it('rejects an unknown draftDecode value', async () => {
- const r = await request(app).post('/api/video-gen/').send({ prompt: 'a fox', draftDecode: 'turbo' });
+ it.each(['turbo', 'DRAFT', ''])('rejects the draftDecode value %p', async (draftDecode) => {
+ const r = await request(app).post('/api/video-gen/').send({ prompt: 'a fox', draftDecode });
expect(r.status).toBe(400);
});
+
it('keeps textEncoderId on the local path under a grok pin, without persisting the stock value', async () => {
const { getSettings } = await import('../services/settings.js');
getSettings.mockResolvedValueOnce({ imageGen: grokReady, videoGen: { mode: 'grok' } });