Automated reproduction generation for bug reports using LLMs
Project description
RepGen - Automated Bug Reproduction
Features • Quick Start • VS Code • Documentation • Paper
Overview
RepGen is a production-grade tool that leverages state-of-the-art Large Language Models (LLMs) to automatically reproduce bugs in software libraries. By analyzing bug reports and repository context, RepGen plans a reproduction strategy and generates executable Python scripts to replicate the issue.
Ideally suited for Deep Learning libraries, RepGen automates the tedious first step of debugging: creating a Minimum Reproducible Example (MRE).
Features
- Smart Retrieval: Uses hybrid search (BM25 + Semantic) to find relevant code snippets and training loops for context.
- Multi-Backend Support: Seamlessly switch between LLM providers:
- Ollama: Run locally with models like
qwen2.5-coder,llama3, ormistral. - OpenAI: Utilize
gpt-4oandgpt-3.5-turbofor high-precision generation. - Gemini & Claude: leverage multimodal and reasoning capabilities.
- Ollama: Run locally with models like
- Remote Input Handling:
- Direct support for GitHub Issue URLs (fetches content via API).
- Direct support for Git Repository URLs (clones automatically to temp workspace).
- Professional VS Code Extension: A fully integrated sidebar to run reproductions directly in your editor.
- Docker Ready: Full containerization for easy deployment.
Quick Start
The easiest way to run RepGen is using Docker. This ensures a consistent environment with all dependencies pre-installed.
# 1. Build the image
cd RepGen
docker build -t repgen .
# 2. Run the server (mounting the volume for development if needed)
docker run -p 8000:8000 repgen
The API will be available at http://localhost:8000.
Developer Setup
If you prefer to run locally or contribute to the core logic:
# 1. Create a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
# 2. Install RepGen in editable mode
pip install -e .
# 3. Run the CLI
repgen
VS Code Extension
RepGen includes a premium VS Code extension for a seamless workflow.
Features
- Persistent Sidebar: Stays active while you work.
- Direct Code Display: Generated reproduction scripts appear directly in the sidebar.
- "Open in Editor": One-click to open generated code in a new editor tab for review.
- Status Tracking: Real-time progress indicators.
Installation
- Navigate to
extensions/vscode. - Run
npm install&&npm run compile. - Open the folder in VS Code and press
F5to launch the Extension Development Host.
Ecosystem
REST API
The core engine runs as a FastAPI service.
- Start:
uvicorn repgen.server:app --reload --reload-dir repgen - Docs:
http://localhost:8000/docs
Web Dashboard
A modern, React-based UI to manage reproduction tasks visually.
- Location:
ui/ - Start:
cd ui && npm install && npm run dev
Browser Extension
Injects a "Reproduce" button directly into GitHub Issues.
- Location:
extensions/chrome/
Usage Examples
CLI Automation
repgen \
--bug-report https://github.com/owner/repo/issues/123 \
--repo-path https://github.com/owner/repo.git \
--backend openai \
--model gpt-4o
Configuration
Set API keys via environment variables:
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="AIza..."
Contributing
Contributions are welcome! Please check out the issues tab or submit a PR.
Issues
If you encounter any issues, please open a GitHub issue or contact Mehil Shah at shahmehil@dal.ca.
License
MIT © Mehil Shah
Future Work and Research Directions
-
Scalable Execution via Cluster Schedulers Integrate RepGen with workload managers such as SLURM to offload reproduction tasks to HPC or GPU clusters. This would enable asynchronous execution, queue-based scheduling, and automated user notifications once reproduction artifacts are ready.
-
Automated Verification in Isolated Sandboxes Extend RepGen with sandboxed execution environments that automatically validate whether a generated reproduction script successfully triggers the reported bug. This would close the loop between generation and confirmation.
-
Bug-Type–Aware Verification Strategies Develop specialized verification mechanisms tailored to different bug classes (e.g., crashes, numerical instability, performance regressions, nondeterministic failures). Each class may require distinct success criteria and instrumentation.
-
Fine-Grained Bug Localization and Understanding Move beyond reproduction toward bug comprehension, including identifying the most likely fault-inducing components, APIs, or configuration parameters involved in the failure.
-
Understanding Practitioner Adoption Barriers Read papers about why practitioners underutilize automated debugging tools, and insights from these papers can guide usability improvements and feature prioritization.
-
CI/CD and GitHub Actions Integration Integrate RepGen directly into GitHub Actions and other CI pipelines, enabling automated bug reproduction as part of issue triage, regression testing, or pull request validation workflows.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repgen_ai-0.1.0.tar.gz.
File metadata
- Download URL: repgen_ai-0.1.0.tar.gz
- Upload date:
- Size: 80.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8d96fabd899186e0ca9113eedbca16047eec8fccf89a8f1c22ee2cf5b28cb48
|
|
| MD5 |
820c11dcee952039e1d52479fdcdbf05
|
|
| BLAKE2b-256 |
5788600b9d476c815ad4d25b38066239ac7b24fe41798f391c028ab9df6a564d
|
File details
Details for the file repgen_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: repgen_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 90.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c8e379bdf088ed36144c74c8fd2ce817ca1eb75fa1f9ee917d6a20166b22f44
|
|
| MD5 |
9fcd38d285727ee5bf766378e077c8e8
|
|
| BLAKE2b-256 |
c3c210ddd7f6420ad651df3c09cc95a8c12ba50f02958a26400076782e709873
|