Skip to content
GitHub
View on GitHub

ModelConfig

Base class for model identity and weight-download logic.

from modal_training_gym.common.models.base import ModelConfig

Base class for model identity and weight-download logic.

Subclass and set model_name (and optionally model_path and architecture) as class attributes, then override download() to materialize weights into the shared model volume.

model_path is the directory the weights load from. Launchers point it at a resumed checkpoint, so download() must leave a populated model_path as it found it.

Set response_parser to a function that converts raw model output into a :class:ParsedResponse. For example, Qwen3 models set response_parser = parse_qwen3_response.

ModelConfig(**kwargs)
ParameterTypeDefaultDescription
AttributeTypeDefaultDescription
model_namestr""
model_pathstr | NoneNone
architectureModelArchitecture | NoneNone
response_parserOptional[Callable[[str], ParsedResponse]]None

Download or materialize weights into the model volume.

parse_response(self, text: 'str') -> 'ParsedResponse'

Section titled “parse_response(self, text: 'str') -> 'ParsedResponse'”

Parse raw model output into structured content.

Source: modal_training_gym/common/models/base.py