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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
record 4B-vs-9B speed finding (~25x) + PLAN item to revisit training default base tier
[._.]/ Adam Eivye34b3d1022ab
diff --git a/PLAN.md b/PLAN.mdindex ae60bbc05a..f4b7cc6349 100644--- a/PLAN.md+++ b/PLAN.md@@ -20,6 +20,8 @@ independently.<!-- reference-watch proposals: slug-tagged, picked up by /claim later -->+- [ ] [lora-training-default-base-tier-too-heavy] **Reconsider the LoRA-training memory tier + default steps — unquantized 9B is ~25× slower than 4B on a 128GB box for a character LoRA.** Surfaced 2026-06-14 training Freydis (dataset `90043893`). `deriveMfluxMemoryConfig` (`server/services/loraTraining/runtimes.js`) maps ≥96GB → `{quantize:null}` (full bf16). On the M5 Max 128GB, a `flux2-klein-9b` bf16 run at 768px/600 steps **failed to complete a single real training step in 14 min** (the 32GB base materialized for the fused `value_and_grad` forward+backward hits memory/swap pressure), whereas `flux2-klein-4b` ran steady at **~3.5s/step → ~35min total** (run `d36562a0`). The base-model size dominated; `TRAINING_DEFAULTS.steps` 600→400 was minor. Proposed: (a) for single-character LoRAs default to the 4B base (or 9B-8bit) rather than unquantized 9B even when RAM allows it — speed/fidelity tradeoff strongly favors the lighter base; (b) revisit `TRAINING_DEFAULTS.steps` (600 may be 1.5-2× more than needed for 25-image faces — the checkpoint picker lets the user grab an earlier checkpoint); (c) re-measure whether `low_ram:true` is still warranted on a 128GB box once the base is lighter (the in-RAM-cache rejection was decided during the swap-thrash that coincided with the panics). Expose base-quant/low_ram as request params (currently only steps/rank/lr/resolution/checkpointEvery/sampleEvery are in `loraTrainingParamsSchema`) so a run can opt into a heavier base without a code change. Validate fidelity: confirm a 4B Freydis LoRA is acceptable before changing the default. Estimated scope: medium.+- [ ] [lora-checkpoint-picker-dedupe-and-hide-untrained-step0] **LoRA checkpoint picker: dedupe by step and don't offer the untrained step-0 checkpoint as deployable.** Surfaced 2026-06-14 from run `90043893` showing 3 checkpoint cards all at "step 0" with identical previews. Two real bugs in `server/services/loraTraining/checkpoints.js#listRunCheckpoints` (NOT caused by the segmentation PR — pre-existing): (1) mflux saves a `0000000_checkpoint.zip` from its `num_iterations==0` monitoring block (the *untrained* initial adapter, identical base-model preview every time) and `listRunCheckpoints` lists it as a deployable "Use this" option — deploying it is a no-op; filter step 0 out of the deployable list (or clearly mark it non-deployable), since the LoRA has zero training at step 0. (2) `run.artifacts.checkpoints` accumulates duplicate entries across MANUAL resume attempts — each resume is a fresh job/wrapper/watcher with an empty `seen` set, so it re-emits the already-existing checkpoint(s), and `listRunCheckpoints` does no dedup → N identical cards. Dedupe by `step` (keep the entry with a non-null loss / latest). Add field-level tests on `listRunCheckpoints` output (dedup + step-0 exclusion). Note: the new segmented-training path does NOT add duplicates (one watcher with a persistent `seen` set spans all segments), so this is purely a manual-resume + step-0 artifact. Estimated scope: small.- [ ] [ref-watch-phosphene-model-weights-integrity-repair] **Verify downloaded model weights (header/size + optional checksum) and offer one-click Repair.** From `reference-watch` review of Phosphene (commits `173d2fd5` + `80752a70`, 2026-06-12). Upstream proved that corrupt/partial safetensors (right size, *wrong bytes*) silently decode to garbled "mosaic" video output that a clean re-download fixes — a leading non-Metal cause of bad renders that hits some machines and not others, so it's cross-platform-relevant for PortOS (mac and windows). PortOS currently only sums file sizes: `server/lib/hfCache.js#inspectModelCache()` returns `{ cached, sizeBytes }` with no integrity check. Fix: add a `verifyModelCache(repoId)` to `server/lib/hfCache.js` that does a cheap structural check first (read each safetensors header length prefix and confirm the file is at least header+declared-tensor-bytes long — catches truncation without loading tensors), and an optional deep check that hashes each weight and compares against HuggingFace's published LFS sha256 (from the repo's `git lfs` pointer / `/api/models/<repo>` metadata). Surface results on `GET /api/video-gen/status` (and the imageGen status it mirrors) as a `modelIntegrity` field, add `POST /api/video-gen/models/verify` (force re-scan, threaded/on-demand) and `POST /api/video-gen/models/repair` (delete flagged files + re-download via the existing resumable HF fetch path), and show a dismissible "Repair model" banner in `client/src/pages/VideoGen.jsx` when integrity reports bad/missing files. Estimated scope: large.diff --git a/docs/research/2026-06-13-mflux-training-watchdog-panic.md b/docs/research/2026-06-13-mflux-training-watchdog-panic.mdindex dce9b03883..bf39d8f718 100644--- a/docs/research/2026-06-13-mflux-training-watchdog-panic.md+++ b/docs/research/2026-06-13-mflux-training-watchdog-panic.md@@ -207,6 +207,21 @@ doesn't lose which version was under test.| (baseline, not run) | 0.17.5 | 0.30.6 | 0.30.6 | known-bad (3 panics 06-13/14) | none captured (sudo was off) || 2026-06-14 candidate #1 | 0.17.5 | **0.31.2** | **0.31.2** | ⏳ IN FLIGHT — survived to step ~11/600 @ 13:45 (box up, no panic) | telemetry capturing (`_bisect-mlx0312/powermetrics.log`) |+**Speed finding (2026-06-14 ~14:10) — 9B bf16 is pathologically slow on this box; 4B is ~25× faster.**+The first Freydis run (`flux2-klein-9b`, bf16, 768px, 600 steps) ran **14 minutes+without completing a single real `/600` training step** — only the step-0+checkpoint. On a 128 GB box `deriveMfluxMemoryConfig(≥96)` forces `quantize:null`+(full bf16); the 32 GB base-9B transformer materialized for the fused+forward+backward (`nn.value_and_grad`) appears to hit memory/swap pressure (swap+was ~18 GB) and crawl. Restarted with **`flux2-klein-4b`** (15 GB base), 400+steps, 768px → steady **~3.5 s/step**, full run **~35 min** incl. 3 segment+cooldowns. The dominant lever was the **base-model size, not the step count**:+600→400 steps is minor; 9B-bf16 → 4B is the ~25× win for a single-character LoRA+(run `d36562a0…`). Open question for `TRAINING_DEFAULTS` / `deriveMfluxMemoryConfig`:+the ≥96 GB tier picking unquantized 9B may be the wrong default — 4B or 9B-8bit+is far faster with little fidelity loss for character LoRAs. Tracked as a PLAN+item rather than changed mid-incident.+**Pivot (2026-06-14 ~13:51):** the seg-OFF scratch bisect was stopped atstep ~10 (clean, no panic — manually terminated) and replaced with a **realFreydis training run** through the live server (run `7de50766…`, dataset