Configuration
Soup uses a single YAML config file for all settings. Run soup init to generate one. Every key with its type, default and bounds is also listed in upstream's generated docs/config-reference.md at v0.78.0, which since v0.77.0 is rendered from the schema at each release (v0.77.1 reworded the dynamic-curriculum descriptions there; v0.77.2 rewrote the description of training.kv_cache_type, which says that neither soup train nor soup serve reads the key); this page explains the keys that need explaining, and Settings refused at load lists what the load refuses.
Reproducibility and full fine-tuning (v0.73.0)
Two training keys landed in v0.73.0. Both are config keys, not CLI flags.
training:
seed: 1234 # weight init of new params, data order, dropout
data_seed: 7 # optional: vary data order while holding init fixed
quantization: none # required with r: 0, because the default (4bit) is refused
lora:
r: 0 # 0 means no adapter: full fine-tuning, dense checkpointseed and data_seed are the first seed knobs in the project's history: before this every run trained at seed 42 with no way to change it, so "run this twice with a different seed" was impossible. Both default to unset rather than to 42, deliberately, because an unset seed has to keep reproducing two different historical defaults (the trainer's 42 and the multipack sampler's 0) and a plain 42 would have silently re-ordered every existing multipack run. A boolean is refused by name, since seed: true would otherwise become seed 1. Since v0.78.0 a boolean in a numeric field of training or training.lora stops the load, true and false alike (upstream's list names lr, batch_size and lora.r), and most fields print <field> must be a number, not a bool (an int for an integer field, for example training -> lr: lr must be a number, not a bool; soup train exits 1, soup doctor --config exits 2; #2462, by @Samearth17), YAML boolean spellings such as yes and on included; the fields that already had their own check, such as seed, grpo_beta and the yarn_* keys, print their own wording. In the fields without one, v0.77.2 read true as 1 and false as 0, so lr: true was a learning rate of 1.0 and lora.r: false together with quantization: none meant full fine-tuning (with the default 4bit it was refused at load). The guard covers training and training.lora only: data.max_length: true is still coerced to 1 and then fails its range check.
The honest scope, and it widened in v0.73.1: the seed reaches the trainer arguments in every wrapper now, applied before the model loads, so setting it on a DPO run is real. It reached one wrapper of eighteen when it shipped in v0.73.0, which is what the original note here described. On a streamed run it additionally seeds the adapter initialisation (checked when the streaming tasks were five; not re-checked for bco and ipo), which is why a streamed run is bit-reproducible from a seed while a resident 4-bit one still is not.
lora.r: 0 selects full fine-tuning on task: sft and, since v0.75.0, task: embedding: no adapter is built, and the run writes a dense checkpoint rather than a LoRA. On any other task the gate does not apply at all, and that is worth knowing before you rely on it: classifier, reranker, cross_encoder and asr gate LoRA behind their own flag and ignore the rank entirely (their default full fine-tune holds fp32 weights since v0.78.0, see Training), while the remaining tasks hand the 0 straight to PEFT, which rejects it with its own message about a positive integer rather than Soup's named one. Since v0.77.0 task: pretrain refuses lora.r: 0 at load by name, because its trainer always attaches an adapter, unless lisa_enabled: true, which attaches none (on sft and embedding the full fine-tuning gate below still refuses rank 0 with LISA); and the MLX preference tasks (dpo, orpo, simpo, kto on backend: mlx) require lora.r of 1 or more. LLaMA Pro block expansion (expand_layers) needs lora.r: 0 since v0.77.0. Rank 0 was chosen because three parts of the codebase already read it as "no adapter" and because r: 0 used to crash, so no config that worked before changes meaning. It is refused with a named message alongside a non-transformers backend (native MLX text SFT is the exception since v0.78.0: with quantization: none on an unquantized dense Llama model it trains every weight, see MLX backend; the Llama check runs after the model loads, so soup doctor --config and --dry-run do not see it, and that path is covered only by the hosted macOS MLX test job and fixtures), a non-text modality, any quantisation (the default counts: quantization is 4bit unless you set it, which is why the block above sets none), Spectrum, LISA, layer streaming, or any LoRA-shaped option, and it refuses rather than running a no-op if your freeze settings leave nothing trainable.
Config Structure
base: meta-llama/Llama-3.1-8B-Instruct # HuggingFace model ID (required)
task: sft # Training task
# backend: unsloth # Unsloth's own 2-5x claim, not measured here (pip install "soup-cli[fast]")
# modality: text # text, vision, or audio
data:
train: ./data/train.jsonl # Local file, remote URI or Hub dataset name
format: alpaca # Data format (auto-detected if omitted)
val_split: 0.1 # Validation split ratio (evaluated each epoch since v0.76.0, except on grpo, ppo and online_dpo)
max_length: 2048 # Max sequence length (64-1048576)
# image_dir: ./data/images # For vision modality
# audio_dir: ./data/audio # For audio modality
training:
epochs: 3
lr: 2e-5
batch_size: auto # auto or integer
quantization: 4bit # the default; also none, 8bit, gptq, awq, hqq:Nbit, ...
# weight_decay: 0.01 # default 0.01
# max_grad_norm: 1.0 # gradient clipping, default 1.0
# logging_steps: 10 # log metrics every N steps
# save_steps: 100 # checkpoint every N steps
# warmup_ratio: 0.03 # 0.0-0.5, default 0.03
# scheduler: cosine # LR scheduler
# quantization_aware: fp8 # fp8 or quest; true (int8 QAT) is refused since v0.76.0
# optimizer: adamw_8bit
# gradient_checkpointing: true # default false; since v0.77.0 the value reaches every trainer (see below)
# stream_layers: false # Train or align a model bigger than VRAM (v0.72, BETA)
# stream_source: auto # auto | ram | disk
# stream_buffers: 2 # 2-8
# stream_pin: false # v0.74.0: force the pageable store
# stream_read_ahead: 2 # v0.76.0, disk tier only: 1-8
lora:
r: 64
alpha: 16
dropout: 0.05
# target_modules: auto # Auto-detected per model
# use_dora: false # Weight-decomposed LoRA
output: ./outputDefaults worth knowing
These are the values a key takes when you leave it out. The quantization default is the one that surprises people: quantization is 4bit unless you set it, so a config that does not mention it trains a QLoRA. The exception is eight tasks whose trainer never quantizes the base: on those an unset value resolves to none (see Keys a task ignores).
| Key | Default | Bound or note |
|---|---|---|
epochs | 3 | at least 1 |
lr | 2e-5 | |
batch_size | auto | auto or an integer |
gradient_accumulation_steps | 4 | at least 1 |
quantization | 4bit | lora.r: 0 (full fine-tuning) refuses it, so set none. Unset resolves to none on distill, classifier, reranker, cross_encoder, prm, moe_lora_routing, unlearn and asr |
optimizer | adamw_torch | |
scheduler | cosine | a free string: the config does not check the name, it is passed to the trainer |
weight_decay | 0.01 | 0 or more |
max_grad_norm | 1.0 | greater than 0 |
warmup_ratio | 0.03 | 0.0 to 0.5 |
logging_steps | 10 | |
save_steps | 100 | |
gradient_checkpointing | false | Since v0.77.0 the value reaches the trainer. With the default false, grpo, ipo, bco, reward_model and online_dpo train with checkpointing off (TRL's own default used to apply), and on backend: unsloth false now disables Unsloth's checkpointing. Set true to keep the memory you had. distill, classifier, reranker, cross_encoder, asr and unlearn now honour true too. Since v0.77.2 ppo does as well (#2340, by @ybai08): trl's PPO trainer runs its own loop, so outside quantization: 4bit / 8bit (where the k-bit preparation already switched checkpointing on) the setting used to reach PPOConfig and nothing else, and the policy trained without checkpointing; with 4bit / 8bit and true, a PPO run stopped at the first rollout with an AttributeError through v0.77.1 (#2319) |
What batch_size: auto does
auto starts from a static estimate built from the model size, sequence length, quantization and LoRA rank. On a CUDA card the SFT trainer alone then refines it with a real probe, one forward and backward at each candidate size, starting at the estimate, halving when it runs out of memory and doubling while it fits, never above four times the estimate (training.auto_batch_size_strategy chooses auto, the default, probe or static; see OOM-probe auto batch size). The answer is cached per base model, sequence length, quantization, LoRA rank and GPU. Every other task, every CPU run and static use the static estimate unchanged. task: kto floors the estimate at 2, because a KTO config with batch_size: 1 is refused (below).
It errs high when the whole model trains. The estimate charges trainable-parameter memory as a small share of the model, at most 5% and derived from the LoRA rank, and charges none for lora.r: 0. The probe never takes an optimizer step, so it does not see the optimizer state either, which for AdamW is two extra values for every trainable parameter. With lora.r: 0 or with unfrozen_parameters (Spectrum), set batch_size explicitly, or start low and raise it. LISA (lisa_enabled) is a separate case: the probe also runs while every layer is still trainable, so its gradient figure is not LISA's either, and which way it errs was not measured. Set batch_size explicitly there as well.
Size and nesting limits (v0.76.1)
Since v0.76.1 every YAML file Soup reads goes through one loader. Nesting is limited to 100 levels, and the document's top-level mapping counts as the first, so 99 levels of brackets under a top-level key is the deepest structure that loads. Expansion is limited to one node per source byte plus 10,000 for anchors, aliases and merge keys, with merge keys chained at most 100 levels. Each reader keeps its own size cap:
| What is read | Size cap |
|---|---|
A training config (soup.yaml), and the readers that had no cap before | 1 MiB |
Recipes, soup export --quant-config files, RA-DIT configs and sweep files | 256 KiB |
| Agent specs | 5 MiB |
| Can manifests | 16 MiB |
| README front matter | 64 KiB |
The config read by soup ship | 4 MiB |
A soup.yaml that is over a limit, cannot be read or is not valid YAML stops the load with one line naming the file and the problem, for example Config file soup.yaml is larger than 1048576 bytes; refusing or Config file soup.yaml is not valid YAML: expected ',' or ']', but got '<stream end>' (line 6, column 1). soup train exits 1 and soup doctor --config exits 2. The other readers report through their own handlers: soup plan and soup apply exit 2 on a limit and, since v0.77.2 (#2323), on a syntax error or an unreadable config too, naming the config and the YAML location (through v0.77.1 a syntax error exited 1; a missing file is still 1), soup eval gate exits 3 on a suite over a limit and, since v0.77.1, on a syntax error too (it exited 1 through v0.77.0; soup train --gate exits 1 on either), and soup ship --config exits 3. How a config loads lists the messages the training-config loader prints.
These are new refusals: a config that loaded on v0.76.0 can stop loading, so run soup doctor --config soup.yaml first, as for an upgrade to v0.76.0. A hand-written config is kilobytes and nests a few levels.
Layer streaming keys
These turn on layer streaming, which trains a model larger than your VRAM by keeping the frozen base out of the card entirely. They are config keys, not CLI flags: there is deliberately no --stream-layers.
| Key | Values | Default | Notes |
|---|---|---|---|
stream_layers | true / false | false | BETA. Only enable it if the model does not fit resident; streaming trades time for memory |
stream_source | auto / ram / disk | auto | auto takes RAM when the base fits and falls back to an NVMe tier; ram refuses instead of falling back; disk forces NVMe |
stream_buffers | 2 to 8 | 2 | VRAM buffers in the pool. 2 is double-buffering; 1 cannot overlap load with compute, so it is refused |
stream_read_ahead | 1 to 8 | 2 | v0.76.0. Disk tier only: how many layers the background reader stages. One slot is always the layer in use, so N stages N-1 ahead. Each level costs one more layer of host staging memory. A non-default value beside stream_source: ram is refused, because the RAM tier reads nothing ahead. See The disk tier |
stream_vram_probe | true / false | false | v0.73.1. Decide the fit by measuring one real forward and backward at your shape, instead of predicting it. task: sft only. Costs 1 to 5 seconds, and cannot overrule a prediction more than 4x over budget |
stream_disk_kind | nvme / ssd / hdd | (unset) | v0.73.3. Override the detected media type behind the disk tier. nvme forces the tier on, ssd and hdd force it off. The override prints beside what was actually detected, and deliberately carries no measured rate, so a later refusal can never cite a reading you overrode |
stream_vram_override | bytes | (unset) | v0.73.1. Replaces the free-VRAM figure the pre-flight checks against, in either direction. It changes the yardstick, not the check: an override below real free VRAM still refuses a config that would otherwise fit |
stream_pin | true / false | (unset) | v0.74.0. Force the RAM store pageable or page-locked instead of letting Soup decide. false prints the throughput it costs rather than absorbing it silently; true refuses on a CUDA box that cannot page-lock, naming the size rather than a ceiling nobody probed: the RAM store on the RAM tier and, since v0.76.0, the background reader's host staging on the disk tier (it was announced-and-proceeds there before). With no CUDA device there is nothing to page-lock, and it is announced and the run proceeds on a pageable CPU source |
stream_ngram_source | auto / ram / disk | auto | v0.74.0. Where Qwen4-Exp's external N-gram table is read from. Read-only, and only meaningful for that family |
stream_recompute | on / off / auto | on | v0.77.0. on is the shipped checkpoint recompute; off keeps the streamed layers' activations instead of recomputing them in the backward (more VRAM); auto keeps them for as many layers as fit, on the RAM tier only. task: sft only, and refused beside activation_offloading. See Layer streaming |
stream_loss_chunk | 16 to 8192 tokens | (unset) | v0.77.0. Computes the output head and the loss in token chunks, so the logits term no longer grows with data.max_length. Upstream: it matches the unchunked step within 1e-5 of the largest value, not bit for bit. Since v0.77.2 the pre-flight charges a chunked step the larger of the loss phase and its last layer's checkpoint recompute (#2290, by @ybai08); upstream measured that once, on one model and one card (Llama-3.1-8B NF4, batch 1, one RTX 3060 Laptop 6 GB under WSL2), for separate q/k/v/o and gate/up/down projections only, and the measurement does not cover fused gate_up, Mixture-of-Experts layers or LoRA on MLP modules. No benchmarks/ record holds it, so this site prints no figure from it. task: sft only; refused with data.format: raft and beside use_cut_ce |
stream_nf4_scale_cache | true / false | false | v0.77.0. Keeps the expanded NF4 block scales on the GPU after first use instead of re-expanding them; bit-identical results, at a cost of 4 bytes of VRAM per 64-element block. Needs quantization: 4bit with double quantization |
stream_expert_layout | fused / per_expert | fused | v0.77.0. per_expert streams a DeepSeek-V3-family MoE one routed expert at a time; refused with moe_lora, and on other architectures at setup. See Streaming a Mixture-of-Experts base |
Setting any of these while stream_layers is false is refused, because the knobs would silently do nothing; the message names only the keys you set. Streaming also reads one environment variable for the disk tier, SOUP_LAYER_STREAM_STRIPE_DIRS (see Environment variables).
A key the schema does not declare is no longer silently dropped (v0.74.0). Until then none of the config models overrode the library default of ignoring undeclared keys, so a typo validated clean and was discarded:
training.quantizaton: nonetrained 4-bit,training.gradient_checkpoint: truedid no checkpointing,data.max_len: 512truncated at 2048, andsoup train --dry-runprinted "Config valid. Ready to train!" Loading a config now walks the whole model tree and reports every key it cannot place in one report, naming the field you probably meant (since v0.77.1 a key written the way Hugging Face or TRL names a Soup field says so, for exampleuse training.lrfortraining.learning_rate; see Settings refused at load). Since v0.75.0 the load is refused.soup trainexits 1 before the training stack is imported, and the API and Web UI loader raisesValueErrorwith the same text. Nothing is defaulted and nothing is substituted; the message saysRefused.rather thanNot applied., which would have read as if the run went ahead without the key, and the scan stops at 100 findings and says so. Since v0.78.0 (#1823, reported by @bernalalexis-try in #1816) a report that holds a key with no close match ends, once, with a next step:Check the spelling against the docs or asoup inittemplate; a key from a newer Soup needs an upgrade (pip install -U soup-cli).(run on the v0.78.0 binary; keys that carry a hint print as before). Two things are worth knowing. A config that must stay loadable on v0.74 as well needs the key removed, not renamed, because v0.74 warns and ignores it while v0.75 refuses it, and neither applies it. Andsoup planandsoup applyrefuse an unknown key the same way (exit 1) and, since v0.77.1, every other refusalsoup trainmakes (a staged field, a deprecated value, any schema error); through v0.77.0 they ran the unknown-key check only, sosoup planwrote a plan for a config thatsoup doctor --configrefused (see Pre-flight tooling).soup sweepis stricter, because a swept parameter that matches nothing produces a grid of identical arms and a meaningless winner: it exits 1 before the first arm.
That refusal covers keys the schema does not know. A key the schema declares and no code reads is a different case, and since v0.77.0 it falls into two groups (v0.76.0 had a third, the fields that only warned).
- Refused at load. Dozens of combinations that loaded on v0.75 were refused in v0.76.0 with a message that names the field and what to change; on v0.75 some of them were ignored and some failed later. Examples:
use_ligeroruse_flash_attnon a task that is notsftortts,rope_scaling_typeon a task that does not rescale RoPE,freeze_layersondpo,quantization_aware: true,optimizer: muonon the transformers backend. Since v0.77.0 the 31 staged fields (validated, read by nothing) stop the load when set away from their default, each with a line endingrefused as of v0.77. Delete the line.; so dodata.remove_unused_columns: trueandtraining.quantization: 4bitor8bit(orload_in_8bit: true) on one of the eight tasks below that never quantize, andsoup ab --betaexits 2. The 20 staged fields undertrainingarelong_context_grpo,vision_grpo,quantize_ref_model,grace_codebook,grace_codebook_size,grace_codebook_dim,lr_groups,early_stop_patience,citation_recall_threshold,forgetting_eval_steps,forgetting_benchmark,forgetting_stop,checkpoint_eval_steps,checkpoint_eval_metric,checkpoint_eval_tasks,checkpoint_keep_top,convergence_window,convergence_rel_tol,rl_checkpoint_include_ref_modelandrl_checkpoint_include_rollout_buffer(the last two were never warned about: an explicitfalseloads,trueis refused); the 11 underdataarevideo_dir,video_fps,video_maxlen,image_min_pixels,image_max_pixels,image_resize_algorithm,split_thinking,eval_on_each_dataset,resize_vocab,extend_conversationandskip_prepare_dataset. Upstream also lists fifteen settings that v0.76 accepted without a word and never applied. Fourteen of them are refused since v0.77.0, among themtraining.use_modon a route with no Mixture-of-Depths router,training.neftune_alphaon the tasks that never apply it andrelora_stepson a loss with a frozen reference; the fifteenth, a KTO row with a malformed label, is dropped at data load with a reason. Settings refused at load groups the refusals.soup trainexits 1 withConfig validation error:;soup doctor --configexits 2 with the error andConfig could not be loaded (see above).. Unknown keys are reported together, but a cross-field refusal prints only the first one it reaches, so fix that setting and run it again until it prints no error. Deleting the key is the fix, and for a staged field it changes no result. - Still accepted, with no release named. A few keys are inert and are not in the staged table: the four parent switches
forgetting_detection,checkpoint_intelligence,early_stop_on_regressionandconvergence_detection(soup trainprints a yellowNote:that they are set but not enforced; since v0.78.0 the Note names only these four). Upstream names no release for refusing them. The pages that document such a key say so, as "accepted by the schema, but nothing in v0.78.0 reads it". Two keys left this group in v0.78.0.training.warmup_auto: trueand atraining.forgetting_thresholdaway from0.1now load with a warning that they have no effect, and upstream says v0.79.0 refuses them (#2814):training.warmup_auto: true has no effect: no trainer reads it, and training.warmup_ratio already sets the warmup over the real optimizer steps. Remove the line. Soup v0.79.0 will refuse it.Delete the lines, settraining.warmup_ratioto change the warmup, and usesoup train --gate <suite.yaml>for regression checks (soup shipreadseval.ship.forgetting_threshold).warmup_auto: falseandforgetting_threshold: 0.1, the defaults, load without a message;soup autopilotwriteswarmup_auto: falseinto the config it generates (read from the code, not run), so that file loads silently. An unread key still takes part in the config hash thatsoup ship --configcompares, so editing one makes earlier--evidenceread as stale.
Also refused at load since v0.78.0. training.vllm_sleep_mode: true on task: grpo (GRPO never starts a vLLM server, #2773; see GRPO Plus). An enabled training.eval_gate on backend: mlx and on task: prm, unlearn and moe_lora_routing, because those paths attach no training callback and used to train without a gate (#2564); enabled: false loads. training.eval_gate.baseline: previous in any letter case, even with enabled: false (training.eval_gate.baseline: 'previous' is not implemented; use a path to a baseline results file). And a boolean in a numeric field of training or training.lora (below). A training.eval_gate.suite that cannot be loaded stops soup train and soup train --dry-run with exit 1, but soup doctor --config does not read the suite (it exits 0), so check the suite with soup train --config soup.yaml --dry-run; a baseline path that cannot be resolved is caught only when the trainer is set up. Settings refused at load has the rows.
soup doctor --config also prints a small backend-support table. At v0.78.0 it covers eleven combinations, with the counts the v0.78.0 binary printed for each: sft on backend: mlx with a text modality (8 settings) and with a vision or an audio modality (7 each), dpo, orpo, simpo and kto on backend: mlx (5 each; task: preference with one of those losses prints task=preference with that loss's count), grpo on backend: mlx (4 settings), sft on backend: unsloth (none, because its unread settings are refused at load instead), and sft on the transformers backend with a vision or an audio modality (data.mask_history, one each). A setting refused at load never reaches the table; the v0.77.1 counts for MLX were 12 and 9, v0.77.2 dropped the rows for settings the loader already refused (10 for MLX text SFT), and v0.78.0 dropped data.mask_history and data.train_on_messages_with_train_field from it, because native MLX text SFT honours both masks now. For every other task and backend it has no entry, so it prints None of the 0 setting(s) known to be unread on task=<t> backend=<b> is switched on in this config. whether or not the config has a problem. Read that line as "not reviewed", never as an all-clear. Since v0.77.0 the command no longer prints All checks passed! above a refused config.
stream_vram_probe and stream_vram_override are not interchangeable, and the difference is the point. stream_vram_probe is a measurement: it runs the step and reads the peak. stream_vram_override is an assertion you are making about how much VRAM is really available, which is what you need when the pre-flight cannot see the truth, as under a per-process memory cap in a hosted notebook.
Streaming also constrains keys you already set: quantization must be none or 4bit, batch_size must be a concrete number rather than auto, and task must be one of the seven that stream at v0.78.0: sft, dpo, orpo, simpo, kto, bco and ipo. task: preference streams with one preference_loss (dpo, orpo, simpo, bco or ipo); a preference_loss_weights blend is refused (tracked as #2766). grpo and ppo are refused, and that refusal names no release. Streaming also refuses use_liger, use_flash_attn, quantization_aware, fp8_attention, nvfp4, rope_scaling_type, freeze_layers, freeze_ratio and relora_steps, and since v0.77.0 use_cut_ce, a non-default moe_aux_loss_coeff and use_mod. A LoRA target on lm_head or embed_tokens is no longer a config-load refusal, and since v0.77.1 (#2159) it is not refused when the streamed model is built either: it trains, saves and resumes on both tied and untied checkpoints (upstream's checks for the untied case ran on CPU; see Layer streaming). The full table is on Layer streaming. (kto needs batch_size of 2 or more; since v0.76.0 that holds for every KTO run, not only streamed ones.) Scaling a streaming run covers sizing, the VRAM pre-flight and the disk tier; Preference losses over streaming covers the alignment tasks.
Keys a task ignores
Eight tasks load the base unquantized because their trainers never quantize it: distill, classifier, reranker, cross_encoder, prm, moe_lora_routing, unlearn and asr. On them:
- An unset
training.quantizationresolves tonone(it is4biteverywhere else). - An explicit
4bitor8bit(orload_in_8bit: true) is refused at load since v0.77.0:training.quantization: 4bit has no effect on task='distill': its trainer never quantises the base, so no run can honour it. Delete the line or set quantization: none. Refused as of Soup v0.77.(v0.76 loaded it with a warning and treated it asnone.) - Any Quant Menu value such as
gptq, andbnb_4bit_quant_storage, is refused at load. task: prmalso refuses a non-defaulttraining.lorablock, because it fine-tunes every base parameter (lora.r: 0loads).
expand_layers is refused unless the resolved quantization is none, on any task but sft and pretrain (since v0.76.0), and since v0.77.0 also with a LoRA rank (set lora.r: 0) and on task: pretrain. See Optimizer zoo.
How target_modules: auto is resolved
lora.target_modules: auto (the default) resolves in this order:
- Architectures that PEFT maps itself (
llama,mistral,qwen2and so on) use PEFT's own default. - Architectures in Soup's table: the Qwen3.5 family and a set of Mixture-of-Experts models (
qwen3_moe,deepseek_v3,deepseek_v4,glm4_moe,glm_moe_dsa,granitemoehybrid,kimi_k2,kimi_k25,gpt_oss,minimax_m2,minimax_m3_vl,mistral3). These target the attention projections; MiniMax-M3 andmistral3use language-tower patterns, so the vision tower and projector stay unadapted. On the multi-head latent attention basesdeepseek_v3andkimi_k2, since v0.77.0 the query projections follow the checkpoint'sq_lora_rank: an integer givesq_a_projandq_b_proj, whileq_lora_rank: null(Moonlight-16B-A3B, for example) gives a singleq_proj, which is now targeted. - Anything else is refused with
training.lora.target_modules='auto' has no mapping for model_type=..., which asks for an explicittraining.lora.target_moduleslist or, for a Mixture-of-Experts model,training.moe_lora: true.training.lora.target_parametersalone also suffices.
On granitemoehybrid only a few layers carry attention (4 of 40 on granite-4.0-h-tiny-base), so training prints a yellow Partial LoRA coverage: line. The notice ends by telling you to set training.lora.target_modules explicitly to include the other layers; Soup has not measured whether adapting a state-space projection trains well.
Templates
Soup includes 21 built-in templates:
soup init --template chat # Conversational fine-tune
soup init --template code # Code generation
soup init --template medical # Domain expert
soup init --template reasoning # GRPO reasoning (DeepSeek-R1 style)
soup init --template vision # Vision/multimodal fine-tune
soup init --template audio # Audio/speech fine-tune
soup init --template kto # KTO unpaired preference
soup init --template orpo # ORPO (no reference model)
soup init --template simpo # SimPO length-normalized preference
soup init --template ipo # IPO regularized preference
soup init --template bco # BCO binary classifier preference (v0.40)
soup init --template rlhf # Full RLHF pipeline (SFT -> RM -> PPO)
soup init --template pretrain # Continued pre-training on raw text
soup init --template moe # MoE fine-tuning (ScatterMoE LoRA)
soup init --template longcontext # 128k+ context fine-tuning
soup init --template embedding # Sentence embedding fine-tuning
soup init --template tool-calling # Function / tool-calling fine-tune (v0.25)longcontext is an 8B model at 131072 tokens. Since v0.77.1 its header says what the VRAM pre-flight does with it: the full logits over that sequence are priced, the run is outside the range the estimate was fitted on, so the figure is printed as a warning and the run launches, unless the weights and training state alone do not fit the card. The header also says use_liger can be uncommented (pip install "soup-cli[liger]") to avoid building the full logits, and that the pre-flight still warns, because it cannot know the fused loss applies.
Four more are regulation-shaped (compliance pack, v0.71.35). Each is a valid training config on a license-clean Apache-2.0 base plus header comments naming that regime's exact commands, because Soup's compliance controls are CLI flags and commands rather than config keys:
soup init --template hipaa # Protected Health Information
soup init --template soc2 # SOC 2 Trust Services Criteria
soup init --template eu-ai-act # EU AI Act Annex XI/XII
soup init --template sr-11-7 # SR 11-7 Model Risk ManagementTask-Specific Config Keys
| Key | Tasks | Description |
|---|---|---|
dpo_beta | DPO | DPO beta parameter |
kto_beta | KTO | KTO beta parameter |
orpo_beta | ORPO | ORPO beta parameter |
simpo_gamma | SimPO | SimPO gamma parameter |
cpo_alpha | SimPO | CPO alpha parameter |
ipo_tau | IPO | IPO tau parameter |
grpo_beta | GRPO and its variants | KL coefficient, default 0.1. Since v0.76.0 gspo, dapo, dr_grpo, bnpo, two_sided and rft apply it too. 0 turns the KL penalty off (KL-free recipes) and is refused together with reward_hack_mitigation kl_control or pid_lagrangian |
num_generations | GRPO | Number of generations per prompt |
reward_fn | GRPO, PPO | Reward function: accuracy, format, a path to a .py file, or a comma-separated ensemble. Since v0.77.0 judge_rank (GRPO only, not with modality: vision) scores each prompt's completions with an LLM judge; it needs grpo_judge (a judge URL, ollama://model, https://host/model or http://localhost:port/model, checked at load) and grpo_judge_max_calls, which has no default, and a run that could make more judge calls than that is refused after the data loads and before the model does. Prompts and completions are sent to the judge host you configure, and a retried request can mean up to three requests per counted call. No quality claim is made for it. See GRPO Plus |
reward_model | PPO | Path to reward model |
ppo_epochs | PPO | PPO training epochs |
ppo_clip_ratio | PPO | PPO clip ratio |
ppo_kl_penalty | PPO | PPO KL penalty |
loraplus_lr_ratio | Every LoRA task | LoRA+ learning rate ratio. Applied since v0.76.0 on sft, pretrain, embedding, dpo, kto, orpo, simpo, ipo, bco, grpo, ppo, online_dpo, reward_model, distill, and on classifier, reranker, cross_encoder and asr with their LoRA flag; through v0.75.2 only the first three read it. Refused on prm, moe_lora_routing, unlearn, backend: mlx, lora.use_vera, use_lorafa, use_galore and optimizer apollo_adamw, lomo, adalomo |
use_galore | SFT, TTS, Pretrain | Enable GaLore optimizer (tts_family: sesame_csm refuses it at setup) |
moe_lora | Every LoRA task but a few | Target MoE expert layers. Read by sft, tts, pretrain, dpo, kto, orpo, simpo, ipo, bco, grpo, ppo, online_dpo, reward_model, embedding, distill, unlearn and, with classifier_lora: true, the classifier family. Refused on asr, prm, moe_lora_routing, SFT with vision or audio, and backend: unsloth. See Backends |
moe_aux_loss_coeff | SFT (text), TTS, Pretrain | Router load-balancing loss. A non-default value is refused on every other task, on SFT with vision or audio, and since v0.77.0 on backend: unsloth and with stream_layers |
use_liger | SFT, TTS | Liger Kernel fused ops. Refused at load on any other task, and since v0.77.2 on task: sft with backend: unsloth, modality: vision or modality: audio (a value of false loads; on backend: mlx the loader accepts it, but soup train stops on it before the MLX trainer starts (a CUDA-only check, exit 1, --dry-run included); see the four settings on five paths). Since v0.77.0, on a model type Liger has no kernels for, it says so and trains without Liger instead of reporting it enabled |
use_flash_attn | SFT, TTS | FlashAttention v2/v3. Refused at load on any other task, and since v0.77.2 on task: sft with backend: unsloth, modality: vision or modality: audio (a value of false loads; on backend: mlx the loader accepts it, but soup train stops on it before the MLX trainer starts (a CUDA-only check, exit 1, --dry-run included)) |
use_ring_attention | none | Ring FlashAttention. Accepted, and checked before training (CUDA, two or more GPUs, ring-flash-attn installed, max_length of 8192 or more), but nothing in v0.78.0 applies it to the model |
rope_scaling_type | SFT, TTS, Pretrain | RoPE scaling (linear, dynamic, yarn, llama3; longrope is refused). Applied before the model is built, on backend: transformers only (on SFT, the text path without stream_layers); refused at load on every other task, backend or path. See Long context |
neftune_alpha | SFT, TTS, DPO, IPO, KTO, ORPO, SimPO, BCO, Preference | NEFTune noisy embeddings (0-50). Since v0.77.0 any value, 0.0 included, is refused at load on every other task (it was accepted and ignored) |
packing | SFT, Pretrain | Sample packing for efficiency |
curriculum | SFT | Sort the training rows from short to long and train them in that order. Since v0.78.0 (#2924) the SFT trainer keeps the sorted order for text, vision, audio and RAFT rows on the transformers and unsloth backends; a pre-tokenised dataset, packing: true, multipack: true and backend: mlx keep the shuffled order, and nothing is refused. Through v0.77.2 the Trainer's default random sampler shuffled the sorted list, so the order never reached the model. The loss curve of a curriculum: true SFT run changes with it |
curriculum_metric | SFT; 13 tasks with curriculum_dynamic | Sort metric. The static sort always uses length: perplexity and loss are accepted, print a notice and fall back to length, and only the curriculum_dynamic callback reads them |
curriculum_buckets | SFT; 13 tasks with curriculum_dynamic | Number of difficulty buckets (1-20, default 4). The static sort only prints it; the curriculum_dynamic callback reads it |
loss_watchdog | Every trainer that attaches the live callback, and MLX text SFT (since v0.77.0) | Enable loss watchdog. Refused at load on prm, unlearn and moe_lora_routing, and on backend: mlx for every task but text sft |
loss_watchdog_threshold | Same as loss_watchdog | Loss spike threshold (≤100) |
loss_watchdog_patience | Same as loss_watchdog | Patience before stopping (≤1000) |
freeze_layers | SFT, TTS (text, transformers, no streaming) | Freeze bottom N layers (≤1000). Refused at load elsewhere. With LoRA, since v0.77.0 a frozen layer gets no adapter (through v0.76.1 the freeze did nothing on a LoRA run); since v0.78.0 (#2201) it works with a list lora.target_modules and with a string one (all-linear, a regular expression, or what auto resolves to): Soup resolves the string to the module names peft would pick and drops those outside the trainable layers. A string that reaches no trainable layer, a list that names only a module outside the decoder layers, target_parameters, use_vera and a plan that freezes every layer are refused when the model is built |
freeze_ratio | SFT, TTS (text, transformers, no streaming) | Freeze ratio of layers. Refused at load elsewhere. Same LoRA rule as freeze_layers |
auto_mixed_precision | SFT, TTS | Pick bf16 or fp16 from the model and GPU. Setting it to true is refused at load on any other task. Since v0.78.0 a run that picks fp16 on a card that also has bf16 loads its unquantized frozen base in fp16, so it is not bit-comparable with v0.77.2 (see Training stability) |
embedding_loss | Embedding | Loss function |
embedding_pooling | Embedding | Pooling strategy |
Since v0.76.0 a key set on a task, backend or path that never reads it is, for many keys, refused when the config loads rather than ignored. The refusal names the key, the task or backend, and what to do (Use task: sft, or remove the key); soup train, soup train --dry-run, soup sweep and soup doctor --config all refuse it, and deleting the key is the fix. For most of these keys a run that finished on v0.75 ignored the key and trained as if it were not there, and some of the rest stopped after the model had loaded. Three are different: for use_longlora, ebft_variant and quantization_aware: true the key was applied, wrongly, so a run that finished on v0.75 did not do what its config said (see Re-run this). The rows above say which keys: use_liger, use_flash_attn, auto_mixed_precision, freeze_layers, freeze_ratio, rope_scaling_type, moe_aux_loss_coeff, loss_watchdog and its two siblings, loraplus_lr_ratio, moe_lora, plus data.chat_template (below), expand_layers, backend: unsloth on the ten tasks with no unsloth setup, and data.add_new_tokens / new_special_tokens outside the eleven tasks that add tokens. v0.77.0 adds use_mod, neftune_alpha, relora_steps on a loss with a frozen reference, reasoning_effort and train_on_eot outside sft, tts and distill, citation_faithful on pretrain, moe_aux_loss_coeff on Unsloth or with streaming, quantization: 8bit on Unsloth, and lora.rank_pattern / alpha_pattern on MLX or Unsloth; v0.77.2 adds four settings on task: sft paths that never read them (reasoning_effort, train_on_eot, use_flash_attn and use_liger, by path: the table); soup sweep also refuses a --param that sets a staged field away from its default. A key not named there is still accepted and ignored by a task that does not read it, so check this column. use_ring_attention and use_galore still go through their pre-flight check first, on any task. That check can refuse a machine that lacks the package or, for use_galore, a config with quantization: 4bit or 8bit (the default is 4bit) or backend: unsloth, so use_galore: true on a DPO run with the default quantization stops the run before it starts. The curriculum_metric and curriculum_buckets rows are the other exception: with curriculum_dynamic: true (which requires curriculum: true) the dynamic-curriculum callback reads them on the 13 tasks that allow it (sft, pretrain, dpo, grpo, kto, orpo, simpo, ipo, bco, reward_model, embedding, ppo, preference). Check this column before assuming a key took effect on a DPO or GRPO run.
data.chat_template is applied since v0.76.0 by SFT and by the DPO, ORPO, SimPO, KTO, BCO, IPO, PPO, reward-model, GRPO and Online DPO trainers, for conversational data; through v0.75.2 only SFT applied it, so on the others the tokenizer's own template rendered the prompts. Tasks that never render chat (pretrain, embedding, classifier, reranker, cross_encoder, prm, asr, moe_lora_routing, unlearn) refuse the key at load, and since v0.77.0 so does backend: mlx, whose trainers render the model's shipped template only (#2051).
More keys, and where each is documented
These keys are all read by the code, and the defaults and refusals in this table are what the config loader does, checked against the schema at v0.78.0 (no training, data or lora field, default or bound differs from v0.77.2; eval.ship gained a reward_fn field and a reward value of task_mode, see Soup ship; what changed are validators: the boolean guard on numeric training and lora fields, the vllm_sleep_mode, eval-gate and deprecation rules above, and the staged-field and value checks of v0.77.x). A wrong-typed value in one of 38 training fields (upstream's count, not recounted here), for example minillm_enabled: 0 or fp8_attention: "false", is now a config validation error that names training -> <field> (exit 1 from soup train and soup plan, #2382); it used to escape the schema as a bare TypeError. Upstream's generated docs/config-reference.md at v0.78.0 lists every key.
| Key | Default | What it does |
|---|---|---|
training.gptq_disable_exllama | true | Load a GPTQ base without the exllama kernel, which silently breaks adapter training. Read only with quantization: gptq, so leave it on. See Quant menu |
training.fp8_recipe | tensorwise | torchao scaling recipe for FP8 training: tensorwise, rowwise or rowwise_with_gw_hp. Refused unless quantization_aware: fp8. See Speed and memory |
training.reward_hack_halt | false | Stop a GRPO run on a HACK verdict from the reward-hack detector. Needs reward_hack_detector, which task: ppo refuses when the trainer is built. The config form of --reward-hack-halt |
training.echo_trap_tokenizer_aware | false | Score echo traps on tokenizer ids instead of whitespace tokens. Needs echo_trap_enabled: true. The config form of --echo-trap-tokenizer-aware |
training.minillm_on_policy | false | Use the on-policy MiniLLM rollout instead of the offline blend. Needs task: distill and minillm_enabled: true. The config form of --minillm-on-policy |
training.reward_hack_* | see the page | Twenty-two tunables for the mitigation controller, each refused while reward_hack_mitigation is off. Defaults and bounds: Reward-hack mitigation |
training.curriculum_dynamic_recompute_steps, _floor, _temperature | 50, 0.05, 1.0 | Tune the dynamic-curriculum policy. See Data mixing |
training.eval_steps | unset | Evaluate the validation split every N optimizer steps; unset evaluates at the end of each epoch. Refused on the MLX preference tasks (dpo, orpo, simpo, kto), on ppo, online_dpo and unlearn, and when there is no validation split; MLX SFT honours it since v0.77.0, counted in optimizer updates. See Training methods |
training.rewind_log | true | Write <output>/rewind.jsonl, the per-row loss record soup rewind reads. SFT only. See soup rewind |
training.use_lorafa | false | LoRA-FA: freeze the LoRA A matrices and train B. See LoRA quality |
training.fast_lora | false | v0.77.0. Runs the LoRA projections through Soup's own Fast-LoRA kernels instead of peft's modules. Needs task: sft, backend: transformers, text, quantization none or 4bit, and lora.dropout: 0 (the default 0.05 is refused: training.fast_lora needs lora.dropout: 0; got 0.05). Upstream: the correctness checks were run on CPU (float32 and float64 against peft), the correctness half is still listed as open (#792), and no speedup and no end-to-end result is claimed; two kernel changes in v0.78.0 (#2383, #2546) make a run not bit-comparable with v0.77.2, and the CUDA readings that exist (one pass on a laptop card, one Tesla T4 block) disagree on direction. See Speed and memory and LoRA quality |
training.grpo_judge, grpo_judge_max_calls, grpo_judge_rubric, grpo_judge_max_tokens, grpo_judge_max_failure_rate | unset | v0.77.0. The judge for reward_fn: judge_rank (see the reward_fn row above); the first two are required with it, and any of them without judge_rank is refused at load |
training.distill_chunk_size, training.distill_checkpoint | unset, false | Chunked and checkpointed evaluation of the distillation divergence, to lower peak memory. task: distill only. See Modality II |
data.raft_epoch_shuffle | false | Re-permute RAFT golden and distractor documents every epoch. See RAG and RAFT |
data.replay, data.replay_ratio, data.replay_seed | unset, 0.1, unset | Continual-learning rehearsal on sft and pretrain. See Running training |
Two declared settings are the opposite case. data.remove_unused_columns defaults to false; an explicit true is refused at load since v0.77.0 (data.remove_unused_columns: true never had an effect ...; v0.76 loaded it with a warning and ignored it). The advise: block is accepted by the schema, but nothing in v0.78.0 reads it: its three keys goal, probe and record are used by nothing (soup advise takes them as flags only, see soup advise).
Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.