Migrate from LLaMA-Factory to Soup CLI

Switching from LLaMA-Factory to Soup CLI takes one command. Soup CLI offers a simpler YAML schema, 2–5× faster training via Unsloth, and a unified CLI for training, serving, and export.

One-line migration

bash
soup migrate --from llamafactory path/to/your/llamafactory_config.yaml

This produces a soup.yaml file equivalent to your LLaMA-Factory config, mapping:

LLaMA-FactorySoup CLI
model_name_or_pathbase (a root-level string, not base.model)
stage: sfttask: sft
finetuning_type: loratraining.lora.r (LoRA is on when r > 0)
lora_ranktraining.lora.r
lora_alphatraining.lora.alpha
per_device_train_batch_sizetraining.batch_size
cutoff_lendata.max_length (sequence length lives under data)
templatenothing: Soup auto-detects the chat template from the tokenizer. Override with data.chat_template if you need to pin one.

Side-by-side example

LLaMA-Factory config:

yaml
model_name_or_path: meta-llama/Llama-3.1-8B-Instruct
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 16
lora_alpha: 32
dataset: alpaca_en
template: llama3
cutoff_len: 2048
per_device_train_batch_size: 2
gradient_accumulation_steps: 8
learning_rate: 2.0e-4
num_train_epochs: 3

Soup CLI equivalent:

yaml
base: meta-llama/Llama-3.1-8B-Instruct
task: sft
backend: unsloth            # root-level, NOT under training

data:
  train: alpaca_en
  format: alpaca
  max_length: 2048          # sequence length lives under data

training:
  epochs: 3
  lr: 2.0e-4                # the key is lr, not learning_rate
  batch_size: 2
  gradient_accumulation_steps: 8
  lora:
    r: 16                   # LoRA turns on when r > 0; there is no enabled flag
    alpha: 32

Why migrate?

  • Faster trainingbackend: unsloth gives 2–5× speedup on Llama/Qwen/Gemma/Mistral
  • Single YAML schema validated by Pydantic v2 (no silent typos)
  • Unified CLIsoup train, soup chat, soup eval, soup serve, soup export all in one tool
  • 144 ready-made recipessoup recipes list
  • Built-in GGUF/Ollama export
  • Dry-run migration — preview the config with --dry-run before writing

Dry-run preview

bash
soup migrate --from llamafactory config.yaml --dry-run

Prints the converted config to stdout without writing.

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.