Skip to content

Migration

Switch to Soup from other fine-tuning tools in one command. Soup automatically converts your existing config files.

Supported Tools

SourceConfig formatCommand
LLaMA-FactoryYAML configsoup migrate --from llamafactory config.yaml
AxolotlYAML configsoup migrate --from axolotl config.yml
UnslothJupyter notebooksoup migrate --from unsloth finetune.ipynb

Usage

bash
# 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.yaml

What 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: none explicitly and a full fine-tune source writes lora.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_size and LLaMA-Factory val_size map to data.val_split, and an absent key writes val_split: 0.0, because both tools train on every row by default.
  • LoRA rank and targets: a LLaMA-Factory config without lora_rank or lora_alpha gets LLaMA-Factory's r: 8 and alpha: 2 * r; a comma-separated lora_target becomes a list; LLaMA-Factory lora_target: all and Axolotl lora_target_linear: true become target_modules: all-linear, every linear layer, rather than auto.
  • Preference strength: LLaMA-Factory pref_beta maps to training.dpo_beta (kto_beta or orpo_beta on those tasks), or to training.ipo_tau under pref_loss: ipo; under pref_loss: simpo it has no Soup equivalent and is named in a warning, and simpo_gamma maps to training.simpo_gamma.
  • Unsloth notebooks: base comes from the training load, skipping the stock notebook's if False: reload, and gradient_accumulation_steps, warmup_ratio, weight_decay and seed are 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, a format template) migrates to data.format: auto with 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 with TypeError: 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 written soup.yaml has format: auto and passes soup 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's r: 64, and turned lora_target: all or lora_target_linear: true into auto, 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: maps dpo, ipo, kto, orpo and simpo to the task of the same name, and grpo and gdpo to task: grpo. dpo, ipo, orpo and simpo get the dpo data format, kto gets kto and grpo gets auto. 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 under stage: dpo. sigmoid gives dpo, ipo gives ipo, orpo gives orpo and simpo gives simpo. 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 than dpo the stage's own task is kept.
  • Unsloth notebooks take the task from the trainer class: SFTTrainer to sft, DPOTrainer to dpo, KTOTrainer to kto, ORPOTrainer to orpo, GRPOTrainer to grpo, PPOTrainer to ppo, RewardTrainer to reward_model, BCOTrainer to bco and OnlineDPOTrainer to online_dpo. An online DPO notebook migrates with a warning and a placeholder training.online_dpo_judge: ollama://REPLACE-ME, because TRL's judge is a Python object with no string form; replace it, or set training.reward_model. CPOTrainer migrates, to simpo, only when loss_type="simpo" is set on that trainer call or its args= config; any other CPO loss, or an args= 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_epochs into the GRPO config. Upstream names four public Qwen3 4B GRPO notebooks that used to inherit training.epochs: 2.
  • IPython magics no longer break a notebook. Lines starting with ! or % (!pip install ...) are skipped; %%capture, %%time, %%timeit and %%prun lose 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 with finetuning_type: full and an Unsloth notebook with full_finetuning=True print 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; set training.packing (or training.multipack) by hand after conversion
  • freeze training (LLaMA-Factory) — not auto-mapped; set training.freeze_layers or training.freeze_ratio by hand. Both keys are applied only by task: sft (and tts) on backend: transformers with modality: text and 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 string lora.target_modules such as the all-linear that soup migrate writes for LLaMA-Factory's default lora_target: all (#2201): Soup resolves the string to the module names peft would pick and keeps the ones in the trainable layers, printing Freeze-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 string lora.target_modules beside a freeze plan was refused when the model was built, and this page said to replace all-linear with 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 on backend: unsloth and backend: mlx too; 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 migrate is 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.