Braid is a native C++/Qt6 desktop runner, mechanistic interpretability workbench, and two-stage strand trainer for Kotodama Strands (LuxiaSL/kotodama-strands-500m), plural language models whose middle layers split into multiple selves joined by cross-self attention links and a per-token merge choke point at layer 30.
The point is to inspect and steer plurality directly rather than treating it as a prompting trick. On one consumer GPU (~1.5 GiB VRAM in BF16 for inference, ~11 GiB while growing two new selves alongside the server), Braid hot-swaps between the five published Hugging Face revisions (main, shared, private, trunk, ctrl) and any locally grown checkpoint under checkpoints/, while exposing every internal switch in real time.
THE WORKBENCH
[1] WEAVE: Fronted generation with per-tokenStrandMerge(L30) self-attribution highlighting, live fronting share bar, hovermerge_wand entropy inspection, and 1-click 4-way causal lesion compare (plain,links live,links cut,deltas off).[2] SELVES: Multi-self memory lab separating the shared trunk (tick -1) from per-self private texts and ticks (0/1/2), with planted-secret transfer presets, parallel top-k next-token distributions, and parallel continuations across every self.[3] LINKS: InteractiveK × Kstrand_hearreader-by-source hearing matrix (ALL,RING,S0 BROADCAST,MUTE S0,ISOLATE ALL),link.value_offvalue-only lesion switches, and a custom C++LinkMassCanvasrendering per-layer Link Attention Mass acrossL11, L15, L19, L23, L26, L29plus the Null SlotØ.[4] LEVERS: On-the-fly Kotodama Entropy-Gradient Steering Vector (EGV) builder projectingV7(entropy),Vrep⊥V7(anti-loop),Vmargin⊥, andVeos⊥onto theCov(h)eigenband[16, 256), with block-persistent AttnRes write rules (K/N/S),decode/uniformspan control, MLP neuron clamping, and live geometric health (RankMe, anisotropy, residual RMS).[5] LOGS: Livebraid-serveconsole and OpenAI-compatible API (/v1/completions,/v1/chat/completionson:8011) honoring Kotodama sampling laws.[6] GROW: Two-stage Strands trainer (server/braid_grow.py) with nativexdg-desktop-portalfile/folder pickers, cached PyMuPDF textbook ingestion, multi-character scene parsing, live loss curve, and 1-click hot-loading.
TWO-STAGE STRAND GROWTH
Growing new selves onto an existing checkpoint without overwriting the existing cast splits into two passes on a single GPU:
- Stage 1 — Private Identity: Freezes the trunk, cross-self links, and existing selves; trains only the newcomer
*_growprivate deltas andstrand_embed_growwithstrand_cut = Trueso each new self forms an isolated private band from its own PDFs, Markdown, TeX, JSONL, or character POV text. - Stage 2 — Join the Room: Keeps every existing self's private deltas frozen while unfreezing
strand_linksandstrand_mergeunder eithersharedorprivatememory policy, mixing in general-English replay snippets so baselineS0..S4routing stays intact. In character mode, scene scripts (Name: dialoguewith narrator blocks) parse straight onto the Strands tick clock — narrator on trunktick -1, character turns on0, 1, 2....
Finished runs write a standard Kotodama Hugging Face layout (model.safetensors, config.json, aliases.json, braid_meta.json) under checkpoints/<name>/ and appear immediately in the sidebar alongside the published revisions.
IMPLEMENTATION NOTES
Upstream checkpoints carry B200-oriented attention settings (fa4/fa2) and flex_attention block masks that trigger recompiles whenever interactive decode changes sequence length. braid_serve.py and braid_grow.py normalize attention cleanly onto RTX 4090 / 2070 SUPER compatible SDPA and route StrandLink.forward through SDPA directly — bit-equivalent math, no recompilation stalls, and uninterrupted link.last_mass telemetry. The Qt6 shell tracks live Omarchy themes and Hyprland corner rounding, binds single-key lesion toggles (L for links, D for private deltas, 1–6 for tabs), and includes an offscreen --snapshot mode to grab all six tabs cleanly.