main branch.
Training a tool-using agent means giving it somewhere to act: run a command, inspect a file, observe what happened, and try again. Miles coordinates the reinforcement learning workflow, and its environment connectors link agent interactions to tasks and feedback. Novita supplies the sandboxes where the supported tasks execute.
The split is simple. The training stack handles model generation and policy updates, and the sandbox provides the task execution environment. You connect the two with the documented recipes instead of writing a provider integration of your own.
Supported paths
Prerequisites
- A Novita account and API key. Set it as
NOVITA_API_KEY, or pointNOVITA_API_KEY_FILEat a file containing the key. The default lookup path is~/.config/novita/api_key. - A working Miles installation with the model and GPU environment prepared, following the Miles installation guide. Selecting a sandbox backend is only one part of the setup. The full training command follows the Miles recipe.
- For the OpenEnv path: a Terminal-Bench-2 task checkout and the OpenEnv
tbench2_envclient. See Hugging Face OpenEnv for how OpenEnv environments run on Novita Sandbox. - For the Harbor path: the
harbor-miles-v0.20.0branch ofharbor-framework/harbor, installed with uv and theharbor[novita]extra. See Harbor Integration for the Novita side of the Harbor configuration.
Quickstart
OpenEnv
Run the following from the Miles repository. Replace the placeholder with your real key.CLI
novita extra installs novita-sandbox>=2.0.7. Setting OPENENV_SANDBOX_BACKEND=novita selects Novita as the provider.
You can build the per-task templates ahead of time so the first training episode does not wait for the image build:
CLI
Harbor
Install Harbor from theharbor-miles-v0.20.0 branch with the harbor[novita] extra, then launch with HARBOR_ENV_TYPE=novita:
CLI
Configuration
How it works
- Deterministic templates. Each task’s template name is derived from the task ID plus a digest of the build recipe (base image, build commands, resources, build user and start command). Repeated episodes reuse the template. Editing the recipe produces a new template name instead of silently serving a stale one.
- Per-episode sandboxes. Each episode starts a sandbox from the template, launches the env server as root, waits for its health endpoint on the sandbox’s public host, and kills the sandbox when the episode ends.
- TTL with keepalive. Sandboxes are created with a bounded lifetime. A keepalive thread re-arms the TTL while the creating process is alive. If the caller is hard-killed, the sandbox is reclaimed within the TTL instead of running forever.
- Concurrency and rate limits. Sandbox creation is bounded by a configurable concurrency limit, and rate-limit responses from the Novita API are retried.