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

fix: complete Linux LTX runtime migration

[._.]/ Adam Eivy36e5560f3131
diff --git a/scripts/migrations/273-ltx-video-cuda-runtime.js b/scripts/migrations/273-ltx-video-cuda-runtime.js
index 6c770f1ce9..42a6f683f3 100644
--- a/scripts/migrations/273-ltx-video-cuda-runtime.js
+++ b/scripts/migrations/273-ltx-video-cuda-runtime.js
@@ -11,7 +11,7 @@ const REL_PATH = 'data/media-models.json';
const isLegacyLtx = (entry) => (
entry?.id === 'ltx_video'
- && entry.runtime === 'mlx_video'
+ && (entry.runtime === undefined || entry.runtime === 'mlx_video')
&& entry.repo === undefined
);
diff --git a/scripts/migrations/273-ltx-video-cuda-runtime.test.js b/scripts/migrations/273-ltx-video-cuda-runtime.test.js
index d84e5db751..b4c7c67087 100644
--- a/scripts/migrations/273-ltx-video-cuda-runtime.test.js
+++ b/scripts/migrations/273-ltx-video-cuda-runtime.test.js
@@ -11,6 +11,18 @@ const writeRegistry = (rootDir, video) => {
};
describe('273-ltx-video-cuda-runtime', () => {
+ it('upgrades an entry persisted before the runtime field existed', async () => {
+ const rootDir = mkdtempSync(join(tmpdir(), 'portos-migration-'));
+ try {
+ writeRegistry(rootDir, { cuda: [{ id: 'ltx_video' }] });
+ await migration.up({ rootDir });
+ const saved = JSON.parse(readFileSync(join(rootDir, 'data', 'media-models.json'), 'utf8'));
+ expect(saved.video.cuda[0].runtime).toBe('cuda_video');
+ } finally {
+ rmSync(rootDir, { recursive: true, force: true });
+ }
+ });
+
it('upgrades the uncustomized CUDA LTX entry', async () => {
const rootDir = mkdtempSync(join(tmpdir(), 'portos-migration-'));
try {
diff --git a/server/lib/mediaModels.js b/server/lib/mediaModels.js
index ee324cd3ac..668e5caada 100644
--- a/server/lib/mediaModels.js
+++ b/server/lib/mediaModels.js
@@ -903,7 +903,7 @@ const upgradeLegacyCudaLtxRuntime = (list) => {
return list.map((entry) => (
isPlainObject(entry)
&& entry.id === 'ltx_video'
- && entry.runtime === 'mlx_video'
+ && (entry.runtime === undefined || entry.runtime === 'mlx_video')
&& entry.repo === undefined
? { ...entry, runtime: 'cuda_video' }
: entry
diff --git a/server/lib/mediaModels.test.js b/server/lib/mediaModels.test.js
index cbf2f8f1d0..cca73d5ebf 100644
--- a/server/lib/mediaModels.test.js
+++ b/server/lib/mediaModels.test.js
@@ -1264,6 +1264,17 @@ describe('video bucket selection is an MLX/CUDA axis, not an OS one', () => {
expect(routesToWindowsHelper(model)).toBe(true);
});
+ it('upgrades a pre-runtime-field LTX entry in the CUDA bucket', async () => {
+ const legacyLtx = { id: 'ltx_video', name: 'Legacy LTX', steps: 25, guidance: 3.0 };
+ writeFileSync(registryFile, JSON.stringify({
+ ...CANONICAL,
+ video: { ...CANONICAL.video, cuda: [legacyLtx], defaultCuda: legacyLtx.id },
+ }));
+ asPlatform('linux');
+ const { getVideoModels } = await import('./mediaModels.js');
+ expect(getVideoModels().find((entry) => entry.id === legacyLtx.id)?.runtime).toBe('cuda_video');
+ });
+
for (const [shape, registry] of [['canonical mlx/cuda keys', CANONICAL], ['legacy macos/windows keys', LEGACY]]) {
describe(shape, () => {
it('serves the MLX list on darwin', async () => {
diff --git a/server/lib/pythonSetup.js b/server/lib/pythonSetup.js
index 1e5a8723c3..6759a80c66 100644
--- a/server/lib/pythonSetup.js
+++ b/server/lib/pythonSetup.js
@@ -20,7 +20,7 @@ export const REQUIRED_PACKAGES = IS_DARWIN
? ['mflux', 'mlx', 'mlx_vlm', 'mlx_video', 'transformers', 'safetensors', 'huggingface_hub', 'numpy', 'cv2', 'tqdm']
: IS_WIN
? ['transformers', 'safetensors', 'huggingface_hub', 'numpy', 'cv2', 'tqdm', 'torch', 'diffusers']
- : ['mflux', 'transformers', 'safetensors', 'huggingface_hub', 'numpy', 'cv2', 'tqdm'];
+ : ['mflux', 'transformers', 'safetensors', 'huggingface_hub', 'numpy', 'cv2', 'tqdm', 'torch', 'diffusers'];
// Some package identifiers in REQUIRED_PACKAGES need to be probed via a
// deeper submodule import to distinguish two PyPI packages that publish the
diff --git a/server/lib/pythonSetup.test.js b/server/lib/pythonSetup.test.js
index 2083103044..780c629d03 100644
--- a/server/lib/pythonSetup.test.js
+++ b/server/lib/pythonSetup.test.js
@@ -97,6 +97,16 @@ const resetState = () => {
mockState.uvPythonDirs = null;
};
+describe('REQUIRED_PACKAGES', () => {
+ beforeEach(resetState);
+
+ it('includes the diffusers CUDA stack on Linux', async () => {
+ mockState.platform = 'linux';
+ const { REQUIRED_PACKAGES } = await loadModule();
+ expect(REQUIRED_PACKAGES).toEqual(expect.arrayContaining(['torch', 'diffusers']));
+ });
+});
+
describe('HOST_ARCH', () => {
beforeEach(resetState);