Skip to content
GitHub
View on GitHub

TrainConfig

Compose dataset, model, and recipe into one training entrypoint.

from modal_training_gym.common.train import TrainConfig

Compose dataset, model, and recipe into one training entrypoint.

FieldTypeDefaultDescription
datasetDatasetConfigThe training dataset. train() materializes it into the framework’s /data volume before training if it isn’t already present.
modelModelConfigThe model to train. Carries model identity (model_name) and weight-download logic; weights are downloaded into the shared HuggingFace cache volume on first use and reused across runs.
recipemodal_training_gym.train_recipes.base.BaseTrainRecipeFramework recipe (SlimeRecipe or MilesConfig). Selects the training framework and carries Modal infra settings (GPU type, node count, image) plus framework CLI flags.
checkpointmodal_training_gym.common.checkpoint.Checkpoint | NoneNoneCheckpoint to resume training from. When None, training starts from the base model weights. Default None.
merge_model_recipeboolTrueWhen True, merges the known-model preset recipe (e.g. Qwen3_4b_Recipe) onto recipe fields you left unset. Set False to run the recipe exactly as written, with no preset defaults. Default True.
detachboolTrueRun the training app detached so it keeps running on Modal even if the local client disconnects (terminal closed, laptop asleep). Set False for an attached run that stops on Ctrl-C. Default True.
group_idstr | NoneNoneShared sweep id. Set by TrainingGroup so every run in a sweep carries the same id, letting the dashboard group variants together. Not usually set by hand. Default None.
group_overridesdict[str, Any] | NoneNonePer-variant parameter overrides applied by TrainingGroup, keyed by dotted field path (e.g. {"recipe.lr": 1e-5}). Recorded in run metadata so the dashboard can label each variant. Default None.
group_axeslist[str] | NoneNoneNames of the swept parameter paths in a TrainingGroup grid. Recorded in run metadata for dashboard grouping; falls back to the keys of group_overrides when unset. Default None.

One-line summary of the effective training context length and parallelism plan.

launch(self, *, show_output: bool = True, prepare_inputs: bool = False) -> modal_training_gym.common.run.TrainingRun

Section titled “launch(self, *, show_output: bool = True, prepare_inputs: bool = False) -> modal_training_gym.common.run.TrainingRun”

Start training in a detached Modal app and return immediately.

train(self, *, show_output: bool = True) -> modal_training_gym.common.train_result.TrainResult

Section titled “train(self, *, show_output: bool = True) -> modal_training_gym.common.train_result.TrainResult”

Build the app, run training, and return the TrainResult.

Source: modal_training_gym/common/train.py