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 (claude): guard Windows LoRA drop, harden quant regex, scope hint copy, lock argparse

[._.]/ Adam Eivyabf2bea9e63c
diff --git a/client/src/lib/runnerFamilies.js b/client/src/lib/runnerFamilies.js
index 324d7e13ff..aecbd40f89 100644
--- a/client/src/lib/runnerFamilies.js
+++ b/client/src/lib/runnerFamilies.js
@@ -26,9 +26,10 @@ export const VIDEO_LORA_FAMILIES = Object.freeze({
const VIDEO_LORA_FAMILY_SET = new Set(Object.values(VIDEO_LORA_FAMILIES));
export const isVideoLoraFamily = (family) => VIDEO_LORA_FAMILY_SET.has(family);
-// A LoRA-quantization marker (`q4` / `q8`) in a model's id/repo/name, bounded
-// so it doesn't match inside unrelated tokens. Mirror of server/lib/runners.js.
-const QUANTIZED_LTX_RE = /(?:^|[-_/\s])q(?:4|8)(?:[-_./\s]|$)/i;
+// A LoRA-quantization marker (`q4` / `q8`) in a model's id/repo/name. Leading
+// boundary + trailing non-digit lookahead catches delimited (`-q4`, `q8_0`) and
+// suffixed (`q4bit`) forms while not matching `q40`. Mirror of server/lib/runners.js.
+const QUANTIZED_LTX_RE = /(?:^|[-_/\s])q(?:4|8)(?![0-9])/i;
// True when an mlx_video-runtime model is a non-quantized LTX-2.x model whose
// LoRAs PortOS can fuse offline (scripts/generate_av_lora.py merges the deltas
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsx
index 3efe3e4a11..8ab58c195a 100644
--- a/client/src/pages/VideoGen.jsx
+++ b/client/src/pages/VideoGen.jsx
@@ -752,7 +752,11 @@ export default function VideoGen() {
const installedVideoLoras = availableLoras.filter(
(l) => (l.loraCompatKey || l.runnerFamily) === VIDEO_LORA_FAMILIES.LTX_VIDEO,
);
+ // Gated on the quantized-mlx_video case specifically (runtime mlx_video +
+ // loraFamily null = a quantized LTX-2.x model) so the hint copy's "quantized
+ // runtime isn't supported yet" wording always matches what triggered it.
const showLtxLoraUnsupportedHint = !loraFamily && installedVideoLoras.length > 0
+ && currentModel?.runtime === 'mlx_video'
&& /ltx-?2/i.test(`${currentModel?.id || ''} ${currentModel?.repo || ''} ${currentModel?.name || ''}`);
// Multi-keyframe availability + validation. Keyframes are an ltx2-runtime
diff --git a/scripts/generate_av_lora.py b/scripts/generate_av_lora.py
index 8a74f8e111..93dd4086ba 100644
--- a/scripts/generate_av_lora.py
+++ b/scripts/generate_av_lora.py
@@ -137,7 +137,10 @@ def _install_lora_patches(specs: list[tuple[str, float]]):
def main() -> None:
- parser = argparse.ArgumentParser(add_help=False)
+ # allow_abbrev=False so a future generate_av flag that prefix-matches
+ # `--user-loras` (e.g. `--user-...`) can't be greedily swallowed here — only
+ # the exact token is consumed; everything else passes through verbatim.
+ parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
parser.add_argument("--user-loras", default=None)
ns, passthrough = parser.parse_known_args()
diff --git a/server/lib/runners.js b/server/lib/runners.js
index 6ab5770af9..a84d7e4b4e 100644
--- a/server/lib/runners.js
+++ b/server/lib/runners.js
@@ -46,10 +46,12 @@ export const VIDEO_LORA_FAMILIES = Object.freeze({
const VIDEO_LORA_FAMILY_SET = new Set(Object.values(VIDEO_LORA_FAMILIES));
export const isVideoLoraFamily = (family) => VIDEO_LORA_FAMILY_SET.has(family);
-// A LoRA-quantization marker (`q4` / `q8`) in a model's id/repo/name, bounded
-// so it doesn't match inside unrelated tokens. Used to scope mlx_video LoRA
-// fusion to the bf16 unified models (see isMlxVideoLtxLoraCapable).
-const QUANTIZED_LTX_RE = /(?:^|[-_/\s])q(?:4|8)(?:[-_./\s]|$)/i;
+// A LoRA-quantization marker (`q4` / `q8`) in a model's id/repo/name. Anchored
+// on a leading boundary (so it doesn't match inside `seq4uence`) and a trailing
+// non-digit lookahead, which catches both delimited (`-q4`, `q8_0`) AND suffixed
+// (`q4bit`, `q8gguf`) forms while not matching `q40`. Used to scope mlx_video
+// LoRA fusion to the bf16 unified models (see isMlxVideoLtxLoraCapable).
+const QUANTIZED_LTX_RE = /(?:^|[-_/\s])q(?:4|8)(?![0-9])/i;
// True when an mlx_video-runtime model is an LTX-2.x model whose LoRAs PortOS
// can fuse. notapalindrome's `mlx_video.generate_av` CLI has no `--lora` flag,
diff --git a/server/lib/runners.test.js b/server/lib/runners.test.js
index 94dbeca3a5..5230cb5017 100644
--- a/server/lib/runners.test.js
+++ b/server/lib/runners.test.js
@@ -77,6 +77,11 @@ describe('VIDEO_LORA_FAMILIES / videoLoraFamily', () => {
// not capable: quantized (q4/q8 marker bounded so it doesn't match mid-token)
expect(isMlxVideoLtxLoraCapable({ runtime: 'mlx_video', name: 'LTX-2.3 Distilled Q4 (~22 GB)' })).toBe(false);
expect(isMlxVideoLtxLoraCapable({ runtime: 'mlx_video', repo: 'notapalindrome/ltx23-mlx-av-q8' })).toBe(false);
+ // not capable: undelimited quant suffix (community quant naming) — q4bit/q8gguf
+ expect(isMlxVideoLtxLoraCapable({ runtime: 'mlx_video', repo: 'someone/ltx2.3-q4bit' })).toBe(false);
+ expect(isMlxVideoLtxLoraCapable({ runtime: 'mlx_video', name: 'LTX-2.3 q8gguf' })).toBe(false);
+ // still capable: a digit-suffixed non-quant token must NOT trip the q-marker (e.g. q40 is not q4)
+ expect(isMlxVideoLtxLoraCapable({ runtime: 'mlx_video', name: 'LTX-2.3 build q40' })).toBe(true);
// not capable: wrong runtime
expect(isMlxVideoLtxLoraCapable({ runtime: 'ltx2', name: 'LTX-2.3 dgrauet Q4' })).toBe(false);
// not capable: the Windows LTX-Video 0.9.5 model (no LTX-2.x marker)
diff --git a/server/services/videoGen/local.js b/server/services/videoGen/local.js
index b4d8ef796b..f768c45285 100644
--- a/server/services/videoGen/local.js
+++ b/server/services/videoGen/local.js
@@ -602,13 +602,17 @@ const buildArgs = ({ pythonPath, modelId, model, prompt, negativePrompt, width,
}
const hasLoras = Array.isArray(loras) && loras.length > 0;
// Defense-in-depth: LoRAs fuse only on ltx2 (handled above) or a non-quantized
- // LTX-2.x mlx_video model (the wrapper below). The route already rejects other
- // runtimes, but a non-route caller (test, queue replay) could reach here —
- // fail clearly rather than silently dropping the LoRAs and producing a base
- // render the user thinks is LoRA-styled.
- if (hasLoras && !isMlxVideoLtxLoraCapable(model)) {
+ // LTX-2.x mlx_video model (the wrapper below), and the wrapper path is
+ // macOS/mlx-only. The route already rejects other runtimes, but a non-route
+ // caller (test, queue replay) — or a Windows install with a hand-edited/synced
+ // mlx_video LTX-2.x entry — could reach here. Fail clearly rather than fall
+ // through to the IS_WIN generate_win.py branch below, which would silently drop
+ // the LoRAs and produce a base render the user thinks is LoRA-styled.
+ if (hasLoras && (!isMlxVideoLtxLoraCapable(model) || IS_WIN)) {
throw new ServerError(
- `LoRAs aren't supported on this model. Model "${modelId}" runs on "${model.runtime || 'mlx_video'}".`,
+ IS_WIN
+ ? `LoRA fusion runs through the macOS-only mlx_video path; model "${modelId}" can't fuse LoRAs on Windows.`
+ : `LoRAs aren't supported on this model. Model "${modelId}" runs on "${model.runtime || 'mlx_video'}".`,
{ status: 400, code: 'LORAS_REQUIRE_LTX2' },
);
}