Skip to content
GitHub
View on GitHub

TrainResult

API reference for TrainResult

from modal_training_gym.common.train_result import TrainResult

One completed training run’s checkpoint handle.

TrainResult(app_name, framework, run_id, checkpoint_dir, base_model, model_class='', checkpoints_volume_name='', checkpoints_mount_path='', iteration_prefix='', wandb_project='', wandb_entity='', wandb_run_id='', extra=<factory>)
ParameterTypeDefaultDescription
app_namestrrequired
frameworkstrrequired
run_idstrrequired
checkpoint_dirstrrequired
base_modelstrrequired
model_classstr""
checkpoints_volume_namestr""
checkpoints_mount_pathstr""
iteration_prefixstr""
wandb_projectstr""
wandb_entitystr""
wandb_run_idstr""
extradict[str, Any]<factory>
AttributeTypeDefaultDescription
app_namestr
frameworkstr
run_idstr
checkpoint_dirstr
base_modelstr
model_classstr""
checkpoints_volume_namestr""
checkpoints_mount_pathstr""
iteration_prefixstr""
wandb_projectstr""
wandb_entitystr""
wandb_run_idstr""
extradict[str, Any]{}

build_serve_app(self, *, served_model_name: 'str | None' = None, checkpoint_path: 'str | None' = None, **vllm_kwargs: 'Any') -> "'App'"

Section titled “build_serve_app(self, *, served_model_name: 'str | None' = None, checkpoint_path: 'str | None' = None, **vllm_kwargs: 'Any') -> "'App'"”

Build a vLLM serving app pointing at a trained checkpoint.

URL for browsing the checkpoints volume in the Modal dashboard.

Absolute in-volume path of the latest checkpoint.

Return per-iteration checkpoint directory names under

Return all run_ids saved for app_name, sorted oldest

load(app_name: 'str', run_id: 'str | None' = None) -> "'TrainResult'"

Section titled “load(app_name: 'str', run_id: 'str | None' = None) -> "'TrainResult'"”

Load a completed run’s result from the shared store.

Persist this result to the shared :class:modal.Dict.

Return a handle to the checkpoints :class:modal.Volume.

wandb_metrics(self, keys: 'list[str] | None' = None, samples: 'int' = 500) -> 'list[dict[str, Any]]'

Section titled “wandb_metrics(self, keys: 'list[str] | None' = None, samples: 'int' = 500) -> 'list[dict[str, Any]]'”

Fetch training metrics from W&B.

Fetch the W&B run summary (final metric values).

Return the W&B run URL, or None if W&B info is not set.

Source: modal_training_gym/common/train_result.py