Upload an environment¶
Give Arena an environment so a model can learn by acting in it over one or more turns, for example playing a game or working through a support ticket.
Arena drives environments through reset and step with the OpenEnv API. A gym-style environment works too: Arena converts it. Multi-turn algorithms such as LLMPPO train against environments.
If each training example is one question with an answer you can check in code, you don’t need an environment. Upload a reasoning dataset and write a reward function instead: see Upload a dataset and Write prompts and reward functions.
Upload your own code¶
Upload Python code as a file, a folder or an archive, in the web app or with arena env validate.
To follow along, download the Guess The Number example: guess_the_number.tar.gz.
Click Environments in the sidebar, then New environment. The New Environment panel has three steps: Setup, Configuration and Finalization.
On Setup, enter a Name and an optional Description. Under Upload environment files, click Browse files for single files or Choose folder for a folder. Click Next.
Setup, with the environment file uploaded.¶
On Configuration, list extra Python packages under Requirements, one per line in
requirements.txtformat. Arena fills this in from arequirements.txtin your upload. Under Configuration, add YAML arguments for your environment class’s constructor, such asdifficulty: hard. Both are optional. Click Next.On Finalization, check the Version Name (
v1by default) and pick the Entrypoint: the module and class Arena builds, such asguess_the_number:GuessTheNumberEnv. Arena scans your files and lists the classes it finds; click Refresh to scan again. Click Finish.
Finalization.¶
Arena opens the environment’s page and starts validating the first version. Environment names must be unique in your organization.
Upload and validate the code in one step, then list the entrypoints Arena found:
arena env validate guess-the-number --version v1 --source ./guess_the_number.tar.gz
arena env entrypoints guess-the-number --version v1
--source takes a folder or a .tar.gz archive. A requirements.txt and an env_config.yaml at the top level are picked up. Entrypoints are module paths from the top of the upload, so archive the files rather than their folder:
tar -czf guess_the_number.tar.gz -C guess_the_number .
A folder inside the archive becomes part of the module path (guess_the_number.guess_the_number:GuessTheNumberEnv).
Then print a manifest that trains on it:
arena manifest template LLMPPO --model Qwen/Qwen3.5-4B --env guess-the-number --env-version v1 > llmppo.yaml
Flags are in the command reference.
A version must pass validation before you can train on it. See Validate and profile an environment.