View on GitHub
"```python\nfrom modal_training_gym.common.deployment import ModelDeployment\n```\n\nA deployed model endpoint.\n\nReturned by `DeploymentConfig.serve()`. Carries the live endpoint\nURL, Modal app id, and convenience methods for generation and evaluation.\n\n## Constructor\n\n```python\nModelDeployment(**data)\n```\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n\n## Attributes\n\n| Attribute | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `deployment_id` | `str` | | |\n| `deployment_config` | `DeploymentConfig` | | |\n| `modal_app_id` | `str` | | |\n| `modal_app_url` | `str` | | |\n| `url` | `str` | | |\n| `status` | `str` | | |\n\n## Methods\n\n### `chat(self, messages: 'list[dict]', ensure_ready: 'bool' = True, max_attempts: 'int' = 4, timeout: 'int' = 120, **kwargs) -> 'dict'`\n\nReturn one OpenAI-compatible chat-completion message while\n\n### `generate(self, prompt: 'str | list[dict]', ensure_ready: 'bool' = True, **kwargs) -> 'str'`\n\n### `save(self) -> 'None'`\n\n### `wait_until_ready(self, timeout: 'int' = 600) -> 'None'`\n\n## Related Tutorials\n\n- [Multi-turn number-guessing RL with custom generate and reward functions](/tutorials/rl/002_multiturn/)\n- [DAPO on math with Qwen3-4B](/tutorials/rl/005_dapo/)\n- [GUI grounding with Qwen3-VL-8B — predict click coordinates from screenshots](/tutorials/rl/008_computer_use/)\n\n**Source:** [`modal_training_gym/common/deployment.py`](https://github.com/modal-projects/training-gym/blob/main/modal_training_gym/common/deployment.py)\n"
ModelDeployment
A deployed model endpoint.
from modal_training_gym.common.deployment import ModelDeploymentA deployed model endpoint.
Returned by DeploymentConfig.serve(). Carries the live endpoint
URL, Modal app id, and convenience methods for generation and evaluation.
Constructor
Section titled “Constructor”ModelDeployment(**data)| Parameter | Type | Default | Description |
|---|
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
deployment_id | str | ||
deployment_config | DeploymentConfig | ||
modal_app_id | str | ||
modal_app_url | str | ||
url | str | ||
status | str |
Methods
Section titled “Methods”chat(self, messages: 'list[dict]', ensure_ready: 'bool' = True, max_attempts: 'int' = 4, timeout: 'int' = 120, **kwargs) -> 'dict'
Section titled “chat(self, messages: 'list[dict]', ensure_ready: 'bool' = True, max_attempts: 'int' = 4, timeout: 'int' = 120, **kwargs) -> 'dict'”Return one OpenAI-compatible chat-completion message while