Registry / ai-ml / swesmith

swesmith

JSON →
library0.0.9pypypi✓ verified 25d ago

SWE-smith is an open-source Python toolkit designed for generating large-scale software engineering training data. It enables users to turn any GitHub repository into a 'SWE-gym' to create unlimited task instances (e.g., file localization, program repair, SWE-bench) for training Software Engineering (SWE) agents. The current version is 0.0.9, and it appears to be actively developed, with frequent updates and an upcoming NeurIPS 2025 Datasets & Benchmarks Track spotlight. [2, 4, 6]

pip install swesmith
INSTALL
IMPORT
SIG · SWESMITH
S
swesmith
ai-mlpythonv0.0.9
Install
1.8s avg
Import
15ms
Disk
18MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 1.9s
py 3.11
✓ —
✓ 1.9s
py 3.12
✓ —
✓ 1.6s
py 3.13
✓ —
✓ 1.7s
py 3.9
✕ build_error
✕ build_error
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PACKAGE_BASE_DIR
from swesmith import PACKAGE_BASE_DIR
from swesmith import registry
Path
from swesmith import Path
from swesmith import registry
REPO_DIR
from swesmith import REPO_DIR
from swesmith import registry

This quickstart demonstrates how to load a SWE-smith dataset using the `datasets` library and retrieve the `RepoProfile` for a given task instance. It outlines the initial steps for interacting with SWE-smith generated data, typically leading to environment creation and agent training. Note that full execution, particularly `rp.get_container(task)`, requires Docker to be running. [4]

# Example: Loading a SWE-smith dataset and getting a RepoProfile # Requires 'datasets' to be installed (pip install datasets) import os from datasets import load_dataset from swesmith.profiles import registry # NOTE: This example requires Docker to be running for environment creation # and may download a large dataset. Authentication (e.g., Hugging Face token) # might be needed depending on dataset access. # Load a small sample of the SWE-smith dataset try: ds = load_dataset("SWE-bench/SWE-smith", split="train", streaming=True) print("Dataset loaded successfully. Processing first few tasks...") count = 0 for task in ds: if count >= 2: # Process only the first 2 tasks for quickstart break print(f"\n--- Processing Task {count + 1} ---") print(f"Task ID: {task.get('instance_id', 'N/A')}") # Get the RepoProfile for the task rp = registry.get_from_inst(task) print(f"Repository Profile for task: {rp.repo_name}") # Get a pointer to a Docker container with the task initialized (requires Docker) # This step will actually attempt to create/get a Docker container # Skipping actual container interaction for a simple quickstart printout. # container = rp.get_container(task) # print(f"Container ID for task: {container.id}") print("To get the Docker container, uncomment 'container = rp.get_container(task)'") count += 1 except Exception as e: print(f"An error occurred during quickstart: {e}") print("Please ensure Docker is running and 'datasets' is installed. " "If using a private dataset, ensure you are logged in (e.g., huggingface-cli login).")
Debug
Known issues
breakingSWE-smith relies heavily on Docker for creating and managing execution environments. Lack of Docker or running on unsupported OS (like Windows/MacOS directly) can lead to unexpected behavior or prevent functionality. [4]
fix
Ensure Docker is installed and running, and preferably use a Linux-based OS like Ubuntu 22.04.4 LTS for development. [4]
affects: All versions
gotchaThe primary interaction model often involves running specific modules via `python -m swesmith.module.submodule` for tasks like bug generation, validation, or environment building, rather than direct class instantiation and method calls for core workflows. [1, 10]
fix
Refer to the official documentation and quickstart guides for the correct command-line usage patterns for different SWE-smith workflows. [1, 10]
affects: All versions
gotchaWhile the core library is Python-focused, SWE-smith is expanding to support other programming languages (Go, JavaScript, Rust, C, C++, C#, Java, PHP). Be aware that full functionality and bug generation strategies might differ or be under active development for non-Python languages. [6, 8]
fix
Check the latest documentation and GitHub repository for specific language support details and available features for your target language. [6, 8]
affects: All versions
Upgrade
Version history
0.0.9latest on PyPI · released Feb 27, 2026
Audit
Dependencies
dockerrequiredRequired to create execution environments for repositories.
datasetsoptionalCommonly used for loading SWE-smith datasets, e.g., 'SWE-bench/SWE-smith'.
swebenchoptionalUsed for validation and evaluation in conjunction with SWE-smith.
Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
swesmith — pip install swesmith · libregistry