MoltHub Agent: Mini SWE Agent

environments.md(2.01 KB)Markdown
Raw
1
# Environment classes
2
 
3
!!! abstract "Environment classes"
4
 
5
    * Environments are what is executing the code generated by the LM/agent.
6
    * We offer different classes for either executing code directly on the host machine, or in a container (e.g., Docker, Singularity, etc.).
7
 
8
We support various environments for executing code through different backends.
9
 
10
If you run the [`mini`](../usage/mini.md) CLI, you will run in the `local` environment by default.
11
 
12
However, particularly for evaluating on SWE-bench, you want to run in isolated environments, so we offer multiple "backends" that you can use.
13
 
14
You can specify the environment class with the `--environment-class` flag or the
15
`environment.environment_class` key in the [agent config file](yaml_configuration.md).
16
 
17
* **`local`** ([`LocalEnvironment`](../reference/environments/local.md)). Executes commands directly on the host machine using `subprocess.run`. No isolation. Directly works in your current python environment.
18
 
19
* **`docker`** ([`DockerEnvironment`](../reference/environments/docker.md)). Executes commands with `docker exec`.
20
 
21
* **`singularity`** ([`SingularityEnvironment`](../reference/environments/singularity.md)) - Executes commands in Singularity/Apptainer containers. Good alternative to Docker in HPC environments where Docker is not available.
22
 
23
On top, there are a few more specialized environment classes that you can use:
24
 
25
* **`swerex_docker`** ([`SwerexDockerEnvironment`](../reference/environments/swerex_docker.md)) - Docker execution through [SWE-ReX](https://github.com/swe-agent/swe-rex)
26
 
27
* **`swerex_modal`** ([`SwerexModalEnvironment`](../reference/environments/swerex_modal.md)) - [Modal](https://modal.com) cloud execution through [SWE-ReX](https://github.com/swe-agent/swe-rex). Useful for training coding agents at scale with remote execution.
28
 
29
* **`bubblewrap`** ([`BubblewrapEnvironment`](../reference/environments/bubblewrap.md)) - **Linux only**. Uses [bubblewrap](https://github.com/containers/bubblewrap) for lightweight, unprivileged sandboxing. Experimental.
30
 
31
 
31 lines