Skip to content
SurogateSurogateDocs
↑↓ to move↵ to openesc to close

Configuration

Every Surogate run is described by one YAML config file: the model, the data, how to train and where to write the results. You pass the file to a command such as surogate sft, and anything you leave out takes its default. This page shows what a config looks like; the config reference lists every option.

The quickest start is to copy an example and edit it:

  • SFT examples live in examples/sft/
  • Pretraining examples live in examples/pt/
  • Knowledge-distillation examples live in examples/distillation/

Run it with the CLI:

bash
surogate sft path/to/config.yaml
# or
surogate pt path/to/config.yaml

To distill a larger teacher into the student during SFT, add a distillation: block and run surogate distill-capture before surogate sft. See Knowledge Distillation.

This is examples/sft/qwen3/qwen3-lora-bf16.yaml, a LoRA fine-tune of a small Qwen3 model, with comments on what each group of keys does:

yaml
# Model and output: what to train and where checkpoints go
model: Qwen/Qwen3-0.6B
output_dir: ./outputs/sft/qwen3/qwen3-lora-bf16
resume_from_checkpoint: false
# Batch size: effective batch = per_device_train_batch_size × gradient_accumulation_steps × gpus
per_device_train_batch_size: 2
gradient_accumulation_steps: 4
# Sequences: pack several samples into each sequence_len-token window
sample_packing: true
sequence_len: 2048
# Training length and evaluation interval (in optimizer steps)
max_steps: 100
eval_steps: 25
# Optimizer and schedule
learning_rate: 2e-4
warmup_ratio: 0.15
# Precision recipe; train_vision: false trains on text only
recipe: bf16
train_vision: false
# LoRA adapters: which layers get one, and their size
lora: true
lora_rank: 16
lora_alpha: 32
lora_dropout: 0
lora_target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
# Data: where it comes from and in which format
dataloader_num_workers: 4
datasets:
- path: "OpenLLM-Ro/ro_gsm8k"
type: auto

Each group maps to a section of the config reference:

Other features add their own keys on top: gpus and zero_level for multi-GPU training, a distributed: block for multi-node training, qlora_* keys for QLoRA.

For most runs you’ll edit:

  • model
  • output_dir
  • datasets
  • per_device_train_batch_size, gradient_accumulation_steps, sequence_len
  • learning_rate
  • (optional) lora, lora_rank / QLoRA options

If the run doesn’t fit in GPU memory, Memory lists what to change, in order.