Skip to content

Environment classes

Environment classes

  • Environments are what is executing the code generated by the LM/agent.
  • We offer different classes for either executing code directly on the host machine, or in a container (e.g., Docker, Singularity, etc.).

We support various environments for executing code through different backends.

If you run the mini CLI, you will run in the local environment by default.

However, particularly for evaluating on SWE-bench, you want to run in isolated environments, so we offer multiple "backends" that you can use.

You can specify the environment class with the --environment-class flag or the environment.environment_class key in the agent config file.

  • local (LocalEnvironment). Executes commands directly on the host machine using subprocess.run. No isolation. Directly works in your current python environment.

  • docker (DockerEnvironment). Executes commands with docker exec.

  • singularity (SingularityEnvironment) - Executes commands in Singularity/Apptainer containers. Good alternative to Docker in HPC environments where Docker is not available.

On top, there are a few more specialized environment classes that you can use: