You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Backend-First Training API (Phase 1)
BREAKING CHANGE: Training is now initiated through backend.train() instead of model.train()
## Migration Guide
### Before (deprecated):
```python
await model.train(trajectory_groups, config=art.TrainConfig(learning_rate=5e-6))
```
### After (recommended):
```python
await model.log(trajectory_groups, split='train') # Log trajectories
result = await backend.train(model, trajectory_groups, learning_rate=5e-6)
await model.log(metrics=result.metrics, step=result.step, split='train') # Log training metrics
```
## Key Changes
- **New API**: `backend.train(model, trajectory_groups, **kwargs)` with explicit, type-safe parameters
- **Explicit logging**: `backend.train()` does NOT automatically log trajectories or metrics
- **Extended model.log()**: Now accepts `metrics` and `step` kwargs for logging training metrics directly
- **Structured returns**: `LocalTrainResult` and `ServerlessTrainResult` with step, metrics, and backend-specific fields
- **Fixed get_inference_name()**: Now correctly returns `model.name@step` for LocalBackend
- **Deprecation warning**: `model.train()` emits a warning with migration instructions
## Phase 2 (Future)
In a future release, we will:
- Remove `model.train()` method entirely
- Remove `art.TrainConfig` and `art.dev.TrainConfig` classes
Closes#519
* refactor: simplify examples to single model.log() after training
Combined trajectory and metrics logging into a single call:
result = await backend.train(model, groups, ...)
await model.log(groups, metrics=result.metrics, step=result.step, split='train')
Removed redundant comments and pre-training log calls.
---------
Co-authored-by: Cursor Bot <bot@cursor.com>
0 commit comments