Large & Multi-GPU Models
Scaling Lucid to 100B-1T MoE models.
Lucid is built to scale cleanly to 100B-1T MoE models using quantized llama.cpp search bases and streaming CPU baking.
Auditing and patching llama.cpp
Before burning GPU time on a new architecture, audit its llama.cpp graph file:
lucid audit-lcpp /path/to/llama.cpp/src/models/<arch>.cppThis checks two things that otherwise fail silently:
- Whether the graph names a pre-FFN residual tensor (
ffn_inp,hc_ffn_pre, orattn_residual) forllama-ablate-capture. - Whether any residual writer (
layer.wo,layer.ssm_out,layer.ffn_down,layer.ffn_routed_up) calls rawggml_mul_mat(...)instead ofbuild_lora_mm(...)orbuild_ffn(...), which causesllama-serverto silently ignore LoRA adapters on that component.
For supported architectures with known patches (qwen4exp, glm5-next, bailingmoe3, hy_v4_flash), apply them idempotently before building:
lucid patch-lcpp /path/to/llama.cpp --arch glm5-next
lucid export-cpp /path/to/llama.cpp/examples/ablate-captureIf an architecture uses a custom tensor prefix for residual capture, pass --even-prefix and --odd-prefix to lucid capture (or --capture-even-prefix / --capture-odd-prefix directly to llama-ablate-capture) without editing C++.
Pre-flight LoRA verification
lucid run automatically runs a preflight probe before search (also available via lucid preflight). It tests each component individually at high scale and checks that first-token logits actually shift. If a component produces zero KL shift, Lucid aborts immediately instead of running a broken search.
Byte-balanced multi-GPU splits
Hybrid and MoE models often have dense early layers that are much smaller than MoE layers, causing naive layer-count splits to OOM individual GPUs. Compute an optimal contiguous -ts split from GGUF headers:
lucid plan-split ./gguf_dir 8 --cap-gib 79.2Pass the resulting TS=... value to lucid run --tensor-split ... or llama-server -ts ....
Driving remote GPU boxes
Lucid includes a token-authenticated HTTP control agent (lucid agent) and client (lucid remote) for driving long-lived GPU jobs interactively over a tunnel (supporting constant-time token auth, 1 MiB streaming file transfers, and process-group PID tracking for background jobs):
# On the GPU box
AGENT_TOKEN=<secret> lucid agent --port 7777 --work-dir /work
# From your laptop (after saving url & token under ~/.config/lucid/<profile>/)
lucid remote mybox exec "nvidia-smi"
lucid remote mybox bg search "lucid search ..."
lucid remote mybox log search 50
lucid remote mybox get /work/edit.npz ./edit.npz