Training
Create and manage LoRA fine-tuning jobs on Lightning Rod datasets. Access via lr.training on your LightningRod client.
TrainingConfig
Configure base model, training steps, and optional LoRA parameters:
base_model
str
—
HuggingFace model ID for LoRA base (e.g. "Qwen/Qwen3-8B")
training_steps
int
—
Number of training loop iterations
batch_size
int | None
None
Rows per batch; used to slice train_rows each step
lora_rank
int | None
None
LoRA adapter rank
learning_rate
float | None
None
Step size for weight updates; higher values learn faster but may overshoot
adam_beta1
float | None
None
Exponential decay rate for first-moment estimates (moving average of gradients)
adam_beta2
float | None
None
Exponential decay rate for second-moment estimates (moving average of squared gradients)
num_rollouts
int | None
None
Samples per prompt for GRPO
max_response_length
int | None
None
Max tokens for sampling
start_idx
int | None
None
Row index to skip at start; train_rows = train_rows[start_idx:]
Methods
estimate_cost
Estimate training cost before running:
Returns EstimateTrainingCostResponse with total_cost_dollars, prefill_tokens, sample_tokens, train_tokens, effective_steps, notes, and optional warning_message.
create
Create a training job without waiting:
run
Create a job and poll until completion. In notebooks, shows a live progress display. Outside notebooks, raises on failure:
get
Fetch a single job by ID:
list
List training jobs with pagination and optional status filter:
Example
See notebooks/getting_started/05_fine_tuning.ipynb for the full workflow.
Last updated
