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 = 5120

You can generate a starter config directly from any local GGUF or safetensors directory:

lucid inspect ./MyModel --write-config lucid.toml

Built-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.

PresetArchitectureComponentsNotable defaults
llamaLlama 2/3, Qwen2/2.5, Yi, SmolLM3, Seed-OSS, Baichuanattn, mlpStandard HF self_attn.o_proj + mlp.down_proj (dense, MoE, VLM)
llama4Meta Llama 4 Scout / Maverickattn, mlpfeed_forward.shared_expert.down_proj / feed_forward.down_proj + VLM wrapper
qwen3Qwen3 dense / Qwen3-VL / QwQattn, mlpenable_thinking chat/think modes, </think>
qwen3-moeQwen3-MoE / Qwen3-VL-MoE (30B-A3B / 235B-A22B)attn, expRouted-only MoE (per-expert or fused 3D experts.down_proj), enable_thinking
qwen35Qwen3.5 / Qwen3.8-27B hybrid denseattn, mlpIncludes .ssm_out.weight and linear_attn.out_proj
qwen38-maxQwen3.8-Max / Qwen3.5-MoE / Qwen3-Nextattn, mlpHybrid linear/full-attn MoE with enable_thinking modes
qwen4expQwen3.8-Flash-Next hybrid MoEattn, mlpIncludes .ssm_out.weight + hyper-connection capture
gemmaGoogle Gemma 2 / Gemma 3 / Gemma 3n / Gemma 4 / PaliGemmaattn, mlp, expSandwich post-norm gain correction (use_post_norm_gains = true), VLM + MoE
deepseekDeepSeek-V2 / V3 / R1 / Kimi-K2 / ERNIE-4.5-MoEattn, mlpMLA self_attn.o_proj, shared_experts.down_proj, FP8 _scale_inv
deepseek-v4DeepSeek-V4 MoEattn, mlpUE8M0 FP8 .scale layout (attn.wo_b, shared_experts.w2)
gpt-ossOpenAI gpt-oss-20B / 120Battn, expRouted-only MoE, Harmony <|channel|>final<|message|>, reasoning_effort
glm4GLM-4 / GLM-4.5 / GLM-4.7 / GLM-5attn, mlpDense & MoE (self_attn.o_proj, shared_experts.down_proj, ChatGLM layout)
glm5-nextGLM-5.3-Flash KDA/DSA hybrid MoEattn, mlpHyper-connection capture, reasoning_effort = "low" for chat mode
mistralMistral dense & multimodal (7B/Small-3/Devstral/Pixtral)attn, mlpSupports HF, VLM language_model.model.layers, and consolidated wo/w2
mixtralMixtral sparse MoE (8x7B / 8x22B) / Phi-3.5-MoEattn, expTargets block_sparse_moe.experts.*.w2 and GGUF .ffn_down_exps
mistral-large4Consolidated FP8 MoEattn, mlpconsolidated.safetensors.index.json, .qscale_weight, [/THINK]
phiMicrosoft Phi-2 / Phi-3 / Phi-3.5 / Phi-4 / Phi-4-reasoningattn, mlpSupports both o_proj/down_proj and Phi-2 self_attn.dense/mlp.fc2
cohereCohere Command R / Command R+ / Command A / Ayaattn, mlpParallel residual block, multimodal language_model.model.layers
olmo2AllenAI OLMo 2 / OLMo 3attn, mlpPost-norm gain correction (use_post_norm_gains = true)
olmoeAllenAI OLMoE / Step-3.5 / Grok / Solar-Openattn, expRouted-only MoE (mlp.experts.*.down_proj, no shared expert)
minimaxMiniMax-M1 / M2 / M2.1 / M2.5 / Text-01attn, expLightning self_attn.out_proj + full o_proj, block_sparse_moe.experts.*.w2
internlmInternLM2 / InternLM2.5 / InternLM3 / InternVLattn, mlpattention.wo + feed_forward.w2 under model.layers and VLM wrappers
graniteIBM Granite 3.x / 4.0 (Dense, MoE, Hybrid Mamba-2)attn, mlp, expmamba.out_proj, shared_mlp.output_linear, block_sparse_moe.output_linear
nemotron-hNVIDIA Nemotron-H / Nemotron-3-Nano / SuperattnBlock-alternating backbone.layers.*.mixer.* (Mamba-2, attention, MLP/MoE)
jambaAI21 Jamba 1.5 / Falcon-H1 / Bamba / Zamba2attn, mlp, expHybrid self_attn.o_proj + mamba.out_proj / .ssm_out.weight
lfm2Liquid AI LFM2 / LFM2-MoEattn, mlp, expHybrid self_attn.out_proj + conv.out_proj / .shortconv.out_proj.weight
falconTII Falcon 1 / Falcon 2attn, mlptransformer.h.*.self_attention.dense + mlp.dense_4h_to_h
exaoneLG EXAONE 3.0 / 3.5 / 4.0 / EXAONE-Deepattn, mlptransformer.h.*.attn.attention.out_proj + mlp.c_proj, EXAONE 4 post-norms
gpt-neoxEleutherAI GPT-NeoX / Pythiaattn, mlpgpt_neox.layers.*.attention.dense + mlp.dense_4h_to_h
starcoder2BigCode StarCoder2attn, mlpself_attn.o_proj + mlp.c_proj
alice-aiYandex AliceAI MoE (80B-A3B)attn, mlp, expHybrid KDA linear_attn.o_proj + self_attn.o_proj, Block AttnRes, fused 3D mlp.experts.down_proj
gigachat4GigaChat 4 37B-A4B / 708B-A41Battn, mlp, expHybrid MLA/DSA + GatedDeltaNet MoE, gated post-norm gains, MTP strip, Russian markers
k2-horizonIFM K2-Horizon / Jais-3 MoVAattn, mlpDense, MoE, and MoVA attention (self_attn.o_proj, shared_experts.down_proj, </ifm|think>, reasoning_effort)
bailingmoe3KDA/MLA hybrid MoEattn, mlp, expSupports 512 routed experts (down_proj)
inkling2_loopLooped MoE (NVFP4/MXFP8)attn, exp<|content_text|> delimiter, special tokens, generation tails
hy_v4_flashSandwich-norm MoEattn, mlp, rupPost-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

Edit this page on GitHub