Migration
Switch to Soup from other fine-tuning tools in one command. Soup automatically converts your existing config files.
Supported Tools
| Source | Config format | Command |
|---|---|---|
| LLaMA-Factory | YAML config | soup migrate --from llamafactory config.yaml |
| Axolotl | YAML config | soup migrate --from axolotl config.yml |
| Unsloth | Jupyter notebook | soup migrate --from unsloth finetune.ipynb |
Usage
# Convert LLaMA-Factory config to soup.yaml
soup migrate --from llamafactory llama3_lora_sft.yaml
# Convert Axolotl config
soup migrate --from axolotl axolotl_config.yml
# Convert Unsloth notebook (AST-only, no code execution)
soup migrate --from unsloth finetune.ipynb
# Preview without writing (dry-run)
soup migrate --from llamafactory config.yaml --dry-run
# Custom output path
soup migrate --from axolotl config.yml --output my-soup.yamlWhat Gets Mapped
Soup maps all major config fields automatically:
- Model:
model_name_or_path/base_model->base - Task:
stage/rl->task(pt->pretrain, rm->reward_model, sft/dpo/kto/ppo/grpo), with the refinements below - LoRA: rank, alpha, dropout, target modules, DoRA
- Training: epochs, lr, batch size, optimizer, scheduler, warmup, quantization
- Quantization and full fine-tuning: since v0.76.0 an unquantized source writes
quantization: noneexplicitly and a full fine-tune source writeslora.r: 0. HQQ and EETQ sources are supported - Data: dataset path, format, max length
- Output: output directory
What the source trained, not Soup's defaults (v0.77.0). Since v0.77.0 soup migrate writes the source tool's own defaults where the source leaves a key out (#1901):
- Validation split: Axolotl
val_set_sizeand LLaMA-Factoryval_sizemap todata.val_split, and an absent key writesval_split: 0.0, because both tools train on every row by default. - LoRA rank and targets: a LLaMA-Factory config without
lora_rankorlora_alphagets LLaMA-Factory'sr: 8andalpha: 2 * r; a comma-separatedlora_targetbecomes a list; LLaMA-Factorylora_target: alland Axolotllora_target_linear: truebecometarget_modules: all-linear, every linear layer, rather thanauto. - Preference strength: LLaMA-Factory
pref_betamaps totraining.dpo_beta(kto_betaororpo_betaon those tasks), or totraining.ipo_tauunderpref_loss: ipo; underpref_loss: simpoit has no Soup equivalent and is named in a warning, andsimpo_gammamaps totraining.simpo_gamma. - Unsloth notebooks:
basecomes from the training load, skipping the stock notebook'sif False:reload, andgradient_accumulation_steps,warmup_ratio,weight_decayandseedare read from the final trainer's config. - A custom Axolotl prompt format (v0.78.0). A dataset
type:written as a mapping (field_instruction,field_output, aformattemplate) migrates todata.format: autowith one warning that names the mapping's keys:datasets[0].type is an axolotl custom prompt format (field_instruction, field_output, format). Soup has no equivalent: the template is not carried over and data.format is auto.The template is not carried over, so check that your rows load, and rename the columns to a layout Soup reads if they do not. Through v0.77.2 such a config stopped withTypeError: unhashable type: 'dict'and wrote nothing, so nothing was migrated wrongly (#2755, #2817, by @abdumutalipabay0). Run on the v0.78.0 binary: exit 0, the writtensoup.yamlhasformat: autoand passessoup doctor --config. - Everything else is named. Every source key or trainer keyword the migrator does not map is listed in one warning, for example
1 LLaMA-Factory key(s) not migrated (no Soup equivalent, or not read by soup migrate): do_train.
On a LLaMA-Factory DPO config with lora_target: all, pref_beta: 0.2 and no rank, v0.77.0 writes val_split: 0.0, r: 8, alpha: 16, target_modules: all-linear and dpo_beta: 0.2.
Warning:Re-run this (v0.77.0). In upstream's words,
soup migrate"now writes what the source trained instead of Soup's defaults". A config generated by v0.76.x or earlier held out Soup's 0.1 validation split where both tools train on every row, gave a LLaMA-Factory config without a rank Soup'sr: 64, and turnedlora_target: allorlora_target_linear: trueintoauto, which is two of seven projections on Llama (#1807, #1901). Generate such a config again and compare it with the one you trained on.
When the task is not a plain SFT or DPO (v0.76.0)
An Axolotl rl:, a LLaMA-Factory pref_loss: or an Unsloth CPOTrainer loss with no Soup task now stops the migration with exit 1, naming the value, instead of writing a task: sft config. No file is written. (An unrecognised LLaMA-Factory stage: still falls back to sft.)
- Axolotl
rl:mapsdpo,ipo,kto,orpoandsimpoto the task of the same name, andgrpoandgdpototask: grpo.dpo,ipo,orpoandsimpoget thedpodata format,ktogetsktoandgrpogetsauto. Any other value is refused:Migration failed: No Soup task matches axolotl rl: ebft. Supported rl values are dpo, gdpo, grpo, ipo, kto, orpo, simpo. - LLaMA-Factory
pref_loss:is read only understage: dpo.sigmoidgivesdpo,ipogivesipo,orpogivesorpoandsimpogivessimpo.hinge,kto_pair, any other value, or a value that is not a string is refused:No Soup task matches LLaMA-Factory pref_loss: hinge. Supported pref_loss values are ipo, orpo, sigmoid, simpo.Under a stage other thandpothe stage's own task is kept. - Unsloth notebooks take the task from the trainer class:
SFTTrainertosft,DPOTrainertodpo,KTOTrainertokto,ORPOTrainertoorpo,GRPOTrainertogrpo,PPOTrainertoppo,RewardTrainertoreward_model,BCOTrainertobcoandOnlineDPOTrainertoonline_dpo. An online DPO notebook migrates with a warning and a placeholdertraining.online_dpo_judge: ollama://REPLACE-ME, because TRL's judge is a Python object with no string form; replace it, or settraining.reward_model.CPOTrainermigrates, tosimpo, only whenloss_type="simpo"is set on that trainer call or itsargs=config; any other CPO loss, or anargs=that cannot be read statically, stops the migration. - The last trainer decides. When a notebook builds several trainers, the task, output directory and hyperparameters come from the config passed to the last one, inline, named or positional, so an SFT warm-up before a GRPO stage no longer leaks its
num_train_epochsinto the GRPO config. Upstream names four public Qwen3 4B GRPO notebooks that used to inherittraining.epochs: 2. - IPython magics no longer break a notebook. Lines starting with
!or%(!pip install ...) are skipped;%%capture,%%time,%%timeitand%%prunlose only their header line and their body is still read; any other cell magic (%%bash,%%writefile) is skipped whole. A real syntax error is now reported with its code cell and line. - The output is validated with the config loader before it is written, and an Axolotl source with no adapter prints
No adapter specified for task 'sft' - full fine-tuning will be used (lora.r: 0); a LLaMA-Factory source withfinetuning_type: fulland an Unsloth notebook withfull_finetuning=Trueprint their own full-fine-tuning warning. A full fine-tune of a task other than SFT or embedding (DPO, pretraining, reward model) is refused. - Since v0.76.1 an Axolotl or LLaMA-Factory source config is read under the same YAML limits as a
soup.yaml: a file larger than 1 MiB, nested more than 100 levels deep or expanding past its alias allowance stops the migration with exit 1 and one line naming the file (see Size and nesting limits).
If you migrated before v0.76.0, check the generated soup.yaml. Upstream's changelog lists what changed in the result: an unquantized source had no quantization line, so Soup loaded it as 4-bit QLoRA, and a full fine-tune source got LoRA r=64; Axolotl rl: orpo, ipo and simpo became task: sft with no warning; LLaMA-Factory pref_loss: ipo became task: dpo; an Unsloth CPO, reward-model, BCO or online DPO notebook became task: sft; and a warm-up trainer's epochs could leak into the final stage. If your source was bf16 or a full fine-tune, or used any of those trainers or losses, the run you got may not have been the run you meant. Regenerate and diff.
Unsupported Features
Soup will warn about features that don't have a direct equivalent:
- sample_packing (Axolotl) — not auto-mapped by
soup migrate; settraining.packing(ortraining.multipack) by hand after conversion - freeze training (LLaMA-Factory) — not auto-mapped; set
training.freeze_layersortraining.freeze_ratioby hand. Both keys are applied only bytask: sft(andtts) onbackend: transformerswithmodality: textand no layer streaming; any other combination is refused at config load (#1497, #1581). Since v0.77.0, with LoRA, a frozen layer gets no adapter (#2145). Since v0.78.0 that also works with a stringlora.target_modulessuch as theall-linearthatsoup migratewrites for LLaMA-Factory's defaultlora_target: all(#2201): Soup resolves the string to the module names peft would pick and keeps the ones in the trainable layers, printingFreeze-scoped targets: N module(s) resolved from target_modules='all-linear' inside layers C..T-1. A string that reaches no trainable layer is refused when the model is built, naming the range. (Since closed in v0.78.0: through v0.77.2 a stringlora.target_modulesbeside a freeze plan was refused when the model was built, and this page said to replaceall-linearwith an explicit list. An explicit list still works.) - use_rslora (Unsloth) — supported, but the key is nested:
training.lora.use_rslora. Since v0.77.0 it is applied onbackend: unslothandbackend: mlxtoo; through v0.76.1 those backends loaded it and trained at the plain-LoRA scale (#1899) - max_steps — Soup uses epochs; max_steps emitted as comment
- DeepSpeed / W&B — emitted as CLI flag comments
Security
- Input files are validated to be within the current working directory
- Unsloth notebooks are parsed via AST only — no code is executed
- Output paths are confined to the current directory
- Since v0.77.2,
soup migrateis one of the commands that print paths, names and messages as typed: brackets and:name:text are kept and terminal control characters are removed from the display only (more than 50 pull requests changed this across the CLI; upstream's Known Limitations list what is left, #2489, #2533 and #2536, and say:name:codes still expand in many other modules)
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.