Skip to content

sft_trainer

diapason.learning.intelligence.sft_trainer

General-purpose SFT trainer -- fine-tune any local LM on trace-derived pairs.

Delegates to :class:LoRATrainer from training/lora.py when use_lora=True. Supports train(trace_store) for end-to-end pipeline and train_on_pairs() for pre-extracted data.

SFTTrainer

General-purpose supervised fine-tuning trainer.

Parameters

config: SFTConfig controlling model, LoRA params, and training hyperparams.

target_module_list property

Parse comma-separated target_modules string into a list.

train(trace_store)

End-to-end: mine SFT pairs from traces, then train.

Parameters

trace_store: Object with list_traces() returning trace objects.

Returns

dict with at least status key.

train_on_pairs(pairs)

Train on pre-extracted SFT pairs.

Parameters

pairs: List of dicts with at least input and output keys.

Returns

dict with status, training_samples, and training metrics.