Skip to content

Build Environments

SWE-smith enables automatic conversion of code repositories into reinforcement learning environments.

We'll review the two steps of this process:

  1. SWE-agent + LM attempts to install a repository + run the testing suite.
  2. Construct an execution environment (Docker image).

For this section, we'll use the Instagram/MonkeyType repository as a running example, specifically at commit 70c3acf.

Automatically Install Repos with SWE-agent

Coming soon!

Python installation scripts

Early on in SWE-smith's development, we focused exclusively on Python repositories and wrote Python-specific scripts for automatic repo instllation. More information here

Create an Execution Environment

Run the following command to create a Docker image for the repository.

python -m swesmith.build_repo.create_images -r MonkeyType

This command will create two artifacts: 1. A mirror of the original repository at the specified commit, created under swesmith. To change the organization, you can... * Pass in an --org argument, or * (If built from source) Change ORG_NAME_GH in swesmith/constants.py 2. A Docker image (swesmith.x86_64.<repo>.<commit>) which contains the installed codebase.

create_images arguments

By default, without -r, the command will build images for all SWE-smith repositories (300+ as of 12/2025).

-r: Select specific repositories to build using fuzzy matching (e.g., -r django matches any repo containing "django").

-f: Force rebuild images even if they already exist locally.

It's good practice to check that your Docker image works as expected.

docker run -it --rm swebench/swesmith.x86_64.instagram__monkeytype.70c3acf6
Within the container, run the testing suite (e.g. pytest) to ensure that the codebase is functioning as expected.

Get existing Docker images

All repositories represented in the SWE-smith dataset are available to download. Simply run:

python -m swesmith.build_repo.download_images