View on GitHub
"```python\nfrom modal_training_gym.common.models.base import ModelConfig\n```\n\nBase class for model identity and weight-download logic.\n\nSubclass and set `model_name` (and optionally `model_path` and\n`architecture`) as class attributes, then override `download()`\nto materialize weights into the shared model volume.\n\n`model_path` is the directory the weights load from. Launchers point it\nat a resumed checkpoint, so `download()` must leave a populated\n`model_path` as it found it.\n\nSet `response_parser` to a function that converts raw model output\ninto a :class:`ParsedResponse`. For example, Qwen3 models set\n`response_parser = parse_qwen3_response`.\n\n## Constructor\n\n```python\nModelConfig(**kwargs)\n```\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n\n## Attributes\n\n| Attribute | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `model_name` | `str` | `\"\"` | |\n| `model_path` | `str \\| None` | `None` | |\n| `architecture` | `ModelArchitecture \\| None` | `None` | |\n| `response_parser` | `Optional[Callable[[str], ParsedResponse]]` | `None` | |\n\n## Methods\n\n### `download(self) -> 'None'`\n\nDownload or materialize weights into the model volume.\n\n### `parse_response(self, text: 'str') -> 'ParsedResponse'`\n\nParse raw model output into structured content.\n\n**Source:** [`modal_training_gym/common/models/base.py`](https://github.com/modal-projects/training-gym/blob/main/modal_training_gym/common/models/base.py)\n"
ModelConfig
Base class for model identity and weight-download logic.
from modal_training_gym.common.models.base import ModelConfigBase 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.
Constructor
Section titled “Constructor”ModelConfig(**kwargs)| Parameter | Type | Default | Description |
|---|
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
model_name | str | "" | |
model_path | str | None | None | |
architecture | ModelArchitecture | None | None | |
response_parser | Optional[Callable[[str], ParsedResponse]] | None |
Methods
Section titled “Methods”download(self) -> 'None'
Section titled “download(self) -> '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.