Documentation Index
Fetch the complete documentation index at: https://docs.arkor.ai/llms.txt
Use this file to discover all available pages before exploring further.
Trainer control
TheTrainer returned by createTrainer has three methods: start, wait, cancel. arkor start and Studio’s Run training button call start() followed by wait() for you. You only call them yourself when wiring training into your own code (a server, a script, a custom CLI).
start()submits the job and resolves once the backend accepts it.wait()opens the SSE event stream, dispatches your callbacks, and resolves when the run finishes.cancel()asks the backend to stop the run.
start / wait directly: arkor start does it. Reach for these methods when you are running outside the CLI.
Stopping a wait early
Pass anabortSignal to createTrainer if you need a way to stop your local wait() loop without waiting for the backend:
abortSignal only stops your local loop. To also stop the GPU on the backend, call await trainer.cancel() afterwards.
Reference
For the exact reject vs resolve behavior, the SSE reconnect rules (initialReconnectDelayMs, maxReconnectDelayMs, maxReconnectAttempts), the idempotency guarantee on start(), and the full two-process pattern with SIGINT handling, see the Trainer control reference.