Configuration & Presets
TOML configs, architecture presets, and override sections.
You don't need a config file to use lucid run. When you do want repeatable settings or custom overrides, Lucid loads .toml, .json, or .yaml configs and fills in defaults automatically.
Minimal config
[model]
name = "MyModel-32B"
preset = "llama"
n_layer = 64
n_embd = 5120You can generate a starter config directly from any local GGUF or safetensors directory:
lucid inspect ./MyModel --write-config lucid.tomlBuilt-in architecture presets
Presets supply writer tensor patterns (GGUF and safetensors), post-norm gain rules, and prompt mode defaults. Explicit fields in your config always override the preset.
| Preset | Architecture | Components | Notable defaults |
|---|---|---|---|
llama | Llama 2/3, Qwen2/2.5, Yi, SmolLM3, Seed-OSS, Baichuan | attn, mlp | Standard HF self_attn.o_proj + mlp.down_proj (dense, MoE, VLM) |
llama4 | Meta Llama 4 Scout / Maverick | attn, mlp | feed_forward.shared_expert.down_proj / feed_forward.down_proj + VLM wrapper |
qwen3 | Qwen3 dense / Qwen3-VL / QwQ | attn, mlp | enable_thinking chat/think modes, </think> |
qwen3-moe | Qwen3-MoE / Qwen3-VL-MoE (30B-A3B / 235B-A22B) | attn, exp | Routed-only MoE (per-expert or fused 3D experts.down_proj), enable_thinking |
qwen35 | Qwen3.5 / Qwen3.8-27B hybrid dense | attn, mlp | Includes .ssm_out.weight and linear_attn.out_proj |
qwen38-max | Qwen3.8-Max / Qwen3.5-MoE / Qwen3-Next | attn, mlp | Hybrid linear/full-attn MoE with enable_thinking modes |
qwen4exp | Qwen3.8-Flash-Next hybrid MoE | attn, mlp | Includes .ssm_out.weight + hyper-connection capture |
gemma | Google Gemma 2 / Gemma 3 / Gemma 3n / Gemma 4 / PaliGemma | attn, mlp, exp | Sandwich post-norm gain correction (use_post_norm_gains = true), VLM + MoE |
deepseek | DeepSeek-V2 / V3 / R1 / Kimi-K2 / ERNIE-4.5-MoE | attn, mlp | MLA self_attn.o_proj, shared_experts.down_proj, FP8 _scale_inv |
deepseek-v4 | DeepSeek-V4 MoE | attn, mlp | UE8M0 FP8 .scale layout (attn.wo_b, shared_experts.w2) |
gpt-oss | OpenAI gpt-oss-20B / 120B | attn, exp | Routed-only MoE, Harmony <|channel|>final<|message|>, reasoning_effort |
glm4 | GLM-4 / GLM-4.5 / GLM-4.7 / GLM-5 | attn, mlp | Dense & MoE (self_attn.o_proj, shared_experts.down_proj, ChatGLM layout) |
glm5-next | GLM-5.3-Flash KDA/DSA hybrid MoE | attn, mlp | Hyper-connection capture, reasoning_effort = "low" for chat mode |
mistral | Mistral dense & multimodal (7B/Small-3/Devstral/Pixtral) | attn, mlp | Supports HF, VLM language_model.model.layers, and consolidated wo/w2 |
mixtral | Mixtral sparse MoE (8x7B / 8x22B) / Phi-3.5-MoE | attn, exp | Targets block_sparse_moe.experts.*.w2 and GGUF .ffn_down_exps |
mistral-large4 | Consolidated FP8 MoE | attn, mlp | consolidated.safetensors.index.json, .qscale_weight, [/THINK] |
phi | Microsoft Phi-2 / Phi-3 / Phi-3.5 / Phi-4 / Phi-4-reasoning | attn, mlp | Supports both o_proj/down_proj and Phi-2 self_attn.dense/mlp.fc2 |
cohere | Cohere Command R / Command R+ / Command A / Aya | attn, mlp | Parallel residual block, multimodal language_model.model.layers |
olmo2 | AllenAI OLMo 2 / OLMo 3 | attn, mlp | Post-norm gain correction (use_post_norm_gains = true) |
olmoe | AllenAI OLMoE / Step-3.5 / Grok / Solar-Open | attn, exp | Routed-only MoE (mlp.experts.*.down_proj, no shared expert) |
minimax | MiniMax-M1 / M2 / M2.1 / M2.5 / Text-01 | attn, exp | Lightning self_attn.out_proj + full o_proj, block_sparse_moe.experts.*.w2 |
internlm | InternLM2 / InternLM2.5 / InternLM3 / InternVL | attn, mlp | attention.wo + feed_forward.w2 under model.layers and VLM wrappers |
granite | IBM Granite 3.x / 4.0 (Dense, MoE, Hybrid Mamba-2) | attn, mlp, exp | mamba.out_proj, shared_mlp.output_linear, block_sparse_moe.output_linear |
nemotron-h | NVIDIA Nemotron-H / Nemotron-3-Nano / Super | attn | Block-alternating backbone.layers.*.mixer.* (Mamba-2, attention, MLP/MoE) |
jamba | AI21 Jamba 1.5 / Falcon-H1 / Bamba / Zamba2 | attn, mlp, exp | Hybrid self_attn.o_proj + mamba.out_proj / .ssm_out.weight |
lfm2 | Liquid AI LFM2 / LFM2-MoE | attn, mlp, exp | Hybrid self_attn.out_proj + conv.out_proj / .shortconv.out_proj.weight |
falcon | TII Falcon 1 / Falcon 2 | attn, mlp | transformer.h.*.self_attention.dense + mlp.dense_4h_to_h |
exaone | LG EXAONE 3.0 / 3.5 / 4.0 / EXAONE-Deep | attn, mlp | transformer.h.*.attn.attention.out_proj + mlp.c_proj, EXAONE 4 post-norms |
gpt-neox | EleutherAI GPT-NeoX / Pythia | attn, mlp | gpt_neox.layers.*.attention.dense + mlp.dense_4h_to_h |
starcoder2 | BigCode StarCoder2 | attn, mlp | self_attn.o_proj + mlp.c_proj |
alice-ai | Yandex AliceAI MoE (80B-A3B) | attn, mlp, exp | Hybrid KDA linear_attn.o_proj + self_attn.o_proj, Block AttnRes, fused 3D mlp.experts.down_proj |
gigachat4 | GigaChat 4 37B-A4B / 708B-A41B | attn, mlp, exp | Hybrid MLA/DSA + GatedDeltaNet MoE, gated post-norm gains, MTP strip, Russian markers |
k2-horizon | IFM K2-Horizon / Jais-3 MoVA | attn, mlp | Dense, MoE, and MoVA attention (self_attn.o_proj, shared_experts.down_proj, </ifm|think>, reasoning_effort) |
bailingmoe3 | KDA/MLA hybrid MoE | attn, mlp, exp | Supports 512 routed experts (down_proj) |
inkling2_loop | Looped MoE (NVFP4/MXFP8) | attn, exp | <|content_text|> delimiter, special tokens, generation tails |
hy_v4_flash | Sandwich-norm MoE | attn, mlp, rup | Post-norm gain correction (use_post_norm_gains = true) |
Optional override sections
Only include the sections you want to customize:
[prompts]
dataset = "mrfakename/harm"
arms = ["en", "cn"]
[directions]
method = "diff_means" # diff_means | trimmed_mean | whitened | pca
basis_spec = "auto" # or e.g. "svd:4:34-83:chat,think" or "svd:auto(0.85):34-83"
winsorization_quantile = 0.001 # clip massive-activation outlier spikes (0.0 disables)
[judge]
kind = "marker" # marker | composite | regex | llm
enable_reframe = false
[search]
kernel = "triangular" # triangular | trapezoid | gaussian | cosine | constant
sampler = "tpe" # tpe | nsgaii | simple
n_trials = 45
kl_budget = 0.15
allow_negative_scales = false
[bake]
rounding = "diffuse" # diffuse | stochastic | rtn
diffuse_lambda = 100.0