Skip to main content

Goal

Create a managed training run (/v1/training-runs) that:
  • dispatches rollout jobs
  • builds an iteration dataset manifest
  • runs a trainer container
  • emits metrics.json and chained checkpoints

Prerequisites

  • A service API key (hls_live_*) with training scopes.
  • Docker installed locally to build your trainer image.
  • API environment configured:

1) Build and Push Test Trainer Image

Use the reference image in this repo:
  • examples/managed_training/smoke_trainer/Dockerfile
  • examples/managed_training/smoke_trainer/train_smoke.py
Build locally:
Push to your registry (GHCR/ECR) and use that image URI in trainer_spec.image_uri.

2) Submit Training Run

Notes:
  • Managed training is GPU-only by default (trainer_spec.resources.gpu > 0 is required).
  • If gpu is omitted or 0, API returns HTTP 400.
  • Trainer fleet scaling uses active runnable tasks and includes startup recovery + ghost-running protection.
  • You can use checkpoint_init_asset_id instead of raw checkpoint URI.

3) Monitor

Use:
  • GET /v1/training-runs/{run_id}
  • GET /v1/training-runs/{run_id}/iterations
  • GET /v1/training-runs/{run_id}/checkpoints
  • GET /v1/training-runs/{run_id}/events
  • GET /v1/training-runs/{run_id}/checkpoints/{checkpoint_id}/download-url (checkpoint download link)
SDK terminal monitoring:

Expected Success Contract

Each completed iteration must produce:
  • trainer output metrics.json
  • one checkpoint (checkpoint.pt or checkpoint_out_uri.txt)
  • one checkpoint lineage entry in /checkpoints
checkpoint_init_asset_id is optional. Add it only when you want to start from an existing checkpoint asset.