mini-swe-agent 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mini_swe_agent-1.1.0/LICENSE.md +21 -0
- mini_swe_agent-1.1.0/PKG-INFO +288 -0
- mini_swe_agent-1.1.0/README.md +220 -0
- mini_swe_agent-1.1.0/pyproject.toml +262 -0
- mini_swe_agent-1.1.0/setup.cfg +4 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/PKG-INFO +288 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/SOURCES.txt +50 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/dependency_links.txt +1 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/entry_points.txt +5 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/requires.txt +29 -0
- mini_swe_agent-1.1.0/src/mini_swe_agent.egg-info/top_level.txt +1 -0
- mini_swe_agent-1.1.0/src/minisweagent/__init__.py +67 -0
- mini_swe_agent-1.1.0/src/minisweagent/__main__.py +7 -0
- mini_swe_agent-1.1.0/src/minisweagent/agents/__init__.py +1 -0
- mini_swe_agent-1.1.0/src/minisweagent/agents/default.py +129 -0
- mini_swe_agent-1.1.0/src/minisweagent/agents/interactive.py +148 -0
- mini_swe_agent-1.1.0/src/minisweagent/agents/interactive_textual.py +324 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/README.md +9 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/__init__.py +24 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/__pycache__/__init__.cpython-313.pyc +0 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/default.yaml +143 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/extra/__init__.py +1 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/extra/swebench.yaml +229 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/github_issue.yaml +146 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/local.yaml +154 -0
- mini_swe_agent-1.1.0/src/minisweagent/config/local2.tcss +128 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/__init__.py +1 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/docker.py +98 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/extra/__init__.py +0 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/extra/swerex_docker.py +39 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/local.py +33 -0
- mini_swe_agent-1.1.0/src/minisweagent/environments/singularity.py +52 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/__init__.py +81 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/anthropic.py +19 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/litellm_model.py +64 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/test_models.py +38 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/utils/cache_control.py +42 -0
- mini_swe_agent-1.1.0/src/minisweagent/models/utils/key_per_thread.py +18 -0
- mini_swe_agent-1.1.0/src/minisweagent/py.typed +0 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/__init__.py +1 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/extra/__init__.py +0 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/extra/config.py +100 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/extra/swebench.py +235 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/extra/swebench_single.py +53 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/extra/utils/batch_progress.py +164 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/github_issue.py +80 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/hello_world.py +36 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/inspector.py +212 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/mini.py +118 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/mini_extra.py +44 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/utils/__init__.py +0 -0
- mini_swe_agent-1.1.0/src/minisweagent/run/utils/save.py +35 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kilian A. Lieret and Carlos E. Jimenez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mini-swe-agent
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Nano SWE Agent - A simple AI software engineering agent
|
|
5
|
+
Author-email: Kilian Lieret <kilian.lieret@posteo.de>, "Carlos E. Jimenez" <carlosej@princeton.edu>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Kilian A. Lieret and Carlos E. Jimenez
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Project-URL: Documentation, https://mini-swe-agent.com/latest/
|
|
28
|
+
Project-URL: Repository, https://github.com/SWE-agent/mini-SWE-agent
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/SWE-agent/mini-SWE-agent/issues
|
|
30
|
+
Keywords: nlp,agents,code
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: Operating System :: OS Independent
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
36
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
37
|
+
Requires-Python: >=3.11
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE.md
|
|
40
|
+
Requires-Dist: pyyaml
|
|
41
|
+
Requires-Dist: requests
|
|
42
|
+
Requires-Dist: jinja2
|
|
43
|
+
Requires-Dist: litellm
|
|
44
|
+
Requires-Dist: tenacity
|
|
45
|
+
Requires-Dist: rich
|
|
46
|
+
Requires-Dist: python-dotenv
|
|
47
|
+
Requires-Dist: typer
|
|
48
|
+
Requires-Dist: platformdirs
|
|
49
|
+
Requires-Dist: textual
|
|
50
|
+
Requires-Dist: prompt_toolkit
|
|
51
|
+
Provides-Extra: full
|
|
52
|
+
Requires-Dist: mini-swe-agent[dev]; extra == "full"
|
|
53
|
+
Requires-Dist: swe-rex; extra == "full"
|
|
54
|
+
Provides-Extra: dev
|
|
55
|
+
Requires-Dist: datasets; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest; extra == "dev"
|
|
57
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
58
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
59
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
|
60
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
61
|
+
Requires-Dist: ruff; extra == "dev"
|
|
62
|
+
Requires-Dist: mkdocs-include-markdown-plugin; extra == "dev"
|
|
63
|
+
Requires-Dist: mkdocstrings[python]>=0.18; extra == "dev"
|
|
64
|
+
Requires-Dist: mike; extra == "dev"
|
|
65
|
+
Requires-Dist: mkdocs-material; extra == "dev"
|
|
66
|
+
Requires-Dist: mkdocs-glightbox; extra == "dev"
|
|
67
|
+
Dynamic: license-file
|
|
68
|
+
|
|
69
|
+
<div align="center">
|
|
70
|
+
|
|
71
|
+
<a href="https://mini-swe-agent.com/latest/"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/mini-swe-agent-banner.svg" alt="mini-swe-agent banner" style="height: 7em"/></a>
|
|
72
|
+
|
|
73
|
+
<h1>The 100 line AI agent that solves GitHub issues & more</h1>
|
|
74
|
+
|
|
75
|
+
[](https://mini-swe-agent.com/latest/)
|
|
76
|
+
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
In 2024, [SWE-bench](https://swebench.com) & [SWE-agent](https://swe-agent.com) helped kickstart the agentic AI for software revolution.
|
|
82
|
+
|
|
83
|
+
We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
|
|
84
|
+
|
|
85
|
+
`mini` is for
|
|
86
|
+
|
|
87
|
+
- 🧪 **Researchers** who want to **benchmark, fine-tune or RL** without assumptions, bloat, or surprises
|
|
88
|
+
- 🧑💻 **Hackers & power users** who like their tools like their scripts: **short, sharp, and readable**
|
|
89
|
+
- 🐳 **Engineers** who want something **trivial to sandbox & to deploy anywhere**
|
|
90
|
+
|
|
91
|
+
Here's some details:
|
|
92
|
+
|
|
93
|
+
- **🐜 Minimal**: Just [100 lines of python](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/agents/default.py) (+100 total for [env](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/environments/local.py),
|
|
94
|
+
[model](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/models/litellm_model.py), [script](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/run/hello_world.py)) — no fancy dependencies!
|
|
95
|
+
- **💪 Powerful:** Resolves 65% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/).
|
|
96
|
+
- **🤗 Friendly:** Comes with **two convenient UIs** that will turn this into your daily dev swiss army knife!
|
|
97
|
+
- **🍀 Environments:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
|
|
98
|
+
- **🧪 Tested:** [](https://codecov.io/gh/SWE-agent/mini-swe-agent)
|
|
99
|
+
- **🎓 Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
|
|
103
|
+
<summary>More motivation (for research)</summary>
|
|
104
|
+
|
|
105
|
+
[SWE-agent](https://swe-agent.com/latest/) jump-started the development of AI agents in 2024. Back then, we placed a lot of emphasis on tools and special interfaces for the agent.
|
|
106
|
+
However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
|
|
107
|
+
In fact, mini-SWE-agent
|
|
108
|
+
|
|
109
|
+
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
110
|
+
This means that you can run it with literally any model. When running in sandboxed environments you also don't need to to take care
|
|
111
|
+
of installing a single package — all it needs is bash.
|
|
112
|
+
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
|
|
113
|
+
So there's no difference between the trajectory and the messages that you pass on to the LM.
|
|
114
|
+
- Executes actions with `subprocess.run` — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
115
|
+
This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
|
|
116
|
+
scale up effortlessly.
|
|
117
|
+
|
|
118
|
+
This makes it perfect as a baseline system and for a system that puts the language model (rather than
|
|
119
|
+
the agent scaffold) in the middle of our attention.
|
|
120
|
+
|
|
121
|
+
</details>
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary>More motivation (as a tool)</summary>
|
|
125
|
+
|
|
126
|
+
Some agents are overfitted research artifacts.
|
|
127
|
+
Others are UI-heavy tools, highly optimized for a specific user experience.
|
|
128
|
+
Both variants are hard to understand.
|
|
129
|
+
|
|
130
|
+
`mini` strives to be
|
|
131
|
+
|
|
132
|
+
- **Simple** enough to understand at a glance
|
|
133
|
+
- **Convenient** enough to use in daily workflows
|
|
134
|
+
- **Flexible** to extend
|
|
135
|
+
|
|
136
|
+
A hackable tool, not a black box.
|
|
137
|
+
|
|
138
|
+
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)),
|
|
139
|
+
it is radically simpler, because it
|
|
140
|
+
|
|
141
|
+
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
142
|
+
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
|
|
143
|
+
- Executes actions with `subprocess.run` — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
144
|
+
|
|
145
|
+
</details>
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary>Should I use SWE-agent or mini-SWE-agent?</summary>
|
|
149
|
+
|
|
150
|
+
You should use [`swe-agent`](https://swe-agent.com/latest/) if
|
|
151
|
+
|
|
152
|
+
- You need specific tools or want to experiment with different tools
|
|
153
|
+
- You want to experiment with different history processors
|
|
154
|
+
- You want very powerful yaml configuration without touching code
|
|
155
|
+
|
|
156
|
+
You should use [`mini-swe-agent`](https://mini-swe-agent.com/latest/) if
|
|
157
|
+
|
|
158
|
+
- You want a quick command line tool that works locally
|
|
159
|
+
- You want an agent with a very simple control flow
|
|
160
|
+
- You want even faster, simpler & more stable sandboxing & benchmark evaluations
|
|
161
|
+
|
|
162
|
+
What you get with both
|
|
163
|
+
|
|
164
|
+
- Excellent performance on SWE-Bench
|
|
165
|
+
- A trajectory browser
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<table>
|
|
170
|
+
<tr>
|
|
171
|
+
<td width="50%">
|
|
172
|
+
<a href="https://mini-swe-agent.com/latest/usage/mini/"><strong>Simple UI</strong></a> (<code>mini</code>)
|
|
173
|
+
</td>
|
|
174
|
+
<td>
|
|
175
|
+
<a href="https://mini-swe-agent.com/latest/usage/mini_v/"><strong>Visual UI</strong></a> (<code>mini -v</code>)
|
|
176
|
+
</td>
|
|
177
|
+
</tr>
|
|
178
|
+
<tr>
|
|
179
|
+
<td width="50%">
|
|
180
|
+
|
|
181
|
+

|
|
182
|
+
|
|
183
|
+
</td>
|
|
184
|
+
<td>
|
|
185
|
+
|
|
186
|
+

|
|
187
|
+
|
|
188
|
+
</td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<td>
|
|
192
|
+
<a href="https://mini-swe-agent.com/latest/usage/swebench/"><strong>Batch inference</strong></a>
|
|
193
|
+
</td>
|
|
194
|
+
<td>
|
|
195
|
+
<a href="https://mini-swe-agent.com/latest/usage/inspector/"><strong>Trajectory browser</strong></a>
|
|
196
|
+
</td>
|
|
197
|
+
<tr>
|
|
198
|
+
<tr>
|
|
199
|
+
|
|
200
|
+
<td>
|
|
201
|
+
|
|
202
|
+

|
|
203
|
+
|
|
204
|
+
</td>
|
|
205
|
+
|
|
206
|
+
<td>
|
|
207
|
+
|
|
208
|
+

|
|
209
|
+
|
|
210
|
+
</td>
|
|
211
|
+
|
|
212
|
+
</tr>
|
|
213
|
+
<td>
|
|
214
|
+
<a href="https://mini-swe-agent.com/latest/advanced/cookbook/"><strong>Python bindings</strong></a>
|
|
215
|
+
</td>
|
|
216
|
+
<td>
|
|
217
|
+
<a href="https://mini-swe-agent.com"><strong>More in the docs</strong></a>
|
|
218
|
+
</td>
|
|
219
|
+
</tr>
|
|
220
|
+
<tr>
|
|
221
|
+
<td>
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
agent = DefaultAgent(
|
|
225
|
+
LitellmModel(model_name=...),
|
|
226
|
+
LocalEnvironment(),
|
|
227
|
+
)
|
|
228
|
+
agent.run("Write a sudoku game")
|
|
229
|
+
```
|
|
230
|
+
</td>
|
|
231
|
+
<td>
|
|
232
|
+
|
|
233
|
+
* [Quick start](https://mini-swe-agent.com/latest/quickstart/)
|
|
234
|
+
* [`mini`](https://mini-swe-agent.com/latest/usage/mini/)
|
|
235
|
+
* [FAQ](https://mini-swe-agent.com/latest/faq/)
|
|
236
|
+
* [Configuration](https://mini-swe-agent.com/latest/advanced/configuration/)
|
|
237
|
+
* [Power up](https://mini-swe-agent.com/latest/advanced/cookbook/)
|
|
238
|
+
|
|
239
|
+
</td>
|
|
240
|
+
</tr>
|
|
241
|
+
</table>
|
|
242
|
+
|
|
243
|
+
## 🔥 Let's get started!
|
|
244
|
+
|
|
245
|
+
Install + run in virtual environment
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Alternative: Install in current environment
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
pip install mini-swe-agent && mini [-v]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Alternative: Install from source
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
git clone https://github.com/SWE-agent/mini-swe-agent.git
|
|
261
|
+
cd mini-swe-agent
|
|
262
|
+
pip install -e .
|
|
263
|
+
mini [-v]
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Read more in our [documentation](https://mini-swe-agent.com/latest/):
|
|
267
|
+
|
|
268
|
+
* [Quick start guide](https://mini-swe-agent.com/latest/quickstart/)
|
|
269
|
+
* More on [`mini`](https://mini-swe-agent.com/latest/usage/mini/) and [`mini -v`](https://mini-swe-agent.com/latest/usage/mini_v/)
|
|
270
|
+
* [Configuration](https://mini-swe-agent.com/latest/advanced/configuration/)
|
|
271
|
+
* [Power up with the cookbook](https://mini-swe-agent.com/latest/advanced/cookbook/)
|
|
272
|
+
* [FAQ](https://mini-swe-agent.com/latest/faq/)
|
|
273
|
+
* [Contribute!](https://mini-swe-agent.com/latest/contributing/)
|
|
274
|
+
|
|
275
|
+
## 👀 More agentic AI
|
|
276
|
+
|
|
277
|
+
<div align="center">
|
|
278
|
+
<a href="https://github.com/SWE-agent/SWE-agent"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/sweagent_logo_text_below.svg" alt="SWE-agent" height="120px"></a>
|
|
279
|
+
|
|
280
|
+
<a href="https://github.com/SWE-agent/SWE-ReX"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swerex_logo_text_below.svg" alt="SWE-ReX" height="120px"></a>
|
|
281
|
+
|
|
282
|
+
<a href="https://github.com/SWE-bench/SWE-bench"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swebench_logo_text_below.svg" alt="SWE-bench" height="120px"></a>
|
|
283
|
+
|
|
284
|
+
<a href="https://github.com/SWE-bench/SWE-smith"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swesmith_logo_text_below.svg" alt="SWE-smith" height="120px"></a>
|
|
285
|
+
|
|
286
|
+
<a href="https://github.com/SWE-bench/sb-cli"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/sbcli_logo_text_below.svg" alt="sb-cli" height="120px"></a>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://mini-swe-agent.com/latest/"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/mini-swe-agent-banner.svg" alt="mini-swe-agent banner" style="height: 7em"/></a>
|
|
4
|
+
|
|
5
|
+
<h1>The 100 line AI agent that solves GitHub issues & more</h1>
|
|
6
|
+
|
|
7
|
+
[](https://mini-swe-agent.com/latest/)
|
|
8
|
+
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
In 2024, [SWE-bench](https://swebench.com) & [SWE-agent](https://swe-agent.com) helped kickstart the agentic AI for software revolution.
|
|
14
|
+
|
|
15
|
+
We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
|
|
16
|
+
|
|
17
|
+
`mini` is for
|
|
18
|
+
|
|
19
|
+
- 🧪 **Researchers** who want to **benchmark, fine-tune or RL** without assumptions, bloat, or surprises
|
|
20
|
+
- 🧑💻 **Hackers & power users** who like their tools like their scripts: **short, sharp, and readable**
|
|
21
|
+
- 🐳 **Engineers** who want something **trivial to sandbox & to deploy anywhere**
|
|
22
|
+
|
|
23
|
+
Here's some details:
|
|
24
|
+
|
|
25
|
+
- **🐜 Minimal**: Just [100 lines of python](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/agents/default.py) (+100 total for [env](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/environments/local.py),
|
|
26
|
+
[model](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/models/litellm_model.py), [script](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/run/hello_world.py)) — no fancy dependencies!
|
|
27
|
+
- **💪 Powerful:** Resolves 65% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/).
|
|
28
|
+
- **🤗 Friendly:** Comes with **two convenient UIs** that will turn this into your daily dev swiss army knife!
|
|
29
|
+
- **🍀 Environments:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
|
|
30
|
+
- **🧪 Tested:** [](https://codecov.io/gh/SWE-agent/mini-swe-agent)
|
|
31
|
+
- **🎓 Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
|
|
35
|
+
<summary>More motivation (for research)</summary>
|
|
36
|
+
|
|
37
|
+
[SWE-agent](https://swe-agent.com/latest/) jump-started the development of AI agents in 2024. Back then, we placed a lot of emphasis on tools and special interfaces for the agent.
|
|
38
|
+
However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
|
|
39
|
+
In fact, mini-SWE-agent
|
|
40
|
+
|
|
41
|
+
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
42
|
+
This means that you can run it with literally any model. When running in sandboxed environments you also don't need to to take care
|
|
43
|
+
of installing a single package — all it needs is bash.
|
|
44
|
+
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
|
|
45
|
+
So there's no difference between the trajectory and the messages that you pass on to the LM.
|
|
46
|
+
- Executes actions with `subprocess.run` — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
47
|
+
This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
|
|
48
|
+
scale up effortlessly.
|
|
49
|
+
|
|
50
|
+
This makes it perfect as a baseline system and for a system that puts the language model (rather than
|
|
51
|
+
the agent scaffold) in the middle of our attention.
|
|
52
|
+
|
|
53
|
+
</details>
|
|
54
|
+
|
|
55
|
+
<details>
|
|
56
|
+
<summary>More motivation (as a tool)</summary>
|
|
57
|
+
|
|
58
|
+
Some agents are overfitted research artifacts.
|
|
59
|
+
Others are UI-heavy tools, highly optimized for a specific user experience.
|
|
60
|
+
Both variants are hard to understand.
|
|
61
|
+
|
|
62
|
+
`mini` strives to be
|
|
63
|
+
|
|
64
|
+
- **Simple** enough to understand at a glance
|
|
65
|
+
- **Convenient** enough to use in daily workflows
|
|
66
|
+
- **Flexible** to extend
|
|
67
|
+
|
|
68
|
+
A hackable tool, not a black box.
|
|
69
|
+
|
|
70
|
+
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)),
|
|
71
|
+
it is radically simpler, because it
|
|
72
|
+
|
|
73
|
+
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
74
|
+
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
|
|
75
|
+
- Executes actions with `subprocess.run` — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
76
|
+
|
|
77
|
+
</details>
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary>Should I use SWE-agent or mini-SWE-agent?</summary>
|
|
81
|
+
|
|
82
|
+
You should use [`swe-agent`](https://swe-agent.com/latest/) if
|
|
83
|
+
|
|
84
|
+
- You need specific tools or want to experiment with different tools
|
|
85
|
+
- You want to experiment with different history processors
|
|
86
|
+
- You want very powerful yaml configuration without touching code
|
|
87
|
+
|
|
88
|
+
You should use [`mini-swe-agent`](https://mini-swe-agent.com/latest/) if
|
|
89
|
+
|
|
90
|
+
- You want a quick command line tool that works locally
|
|
91
|
+
- You want an agent with a very simple control flow
|
|
92
|
+
- You want even faster, simpler & more stable sandboxing & benchmark evaluations
|
|
93
|
+
|
|
94
|
+
What you get with both
|
|
95
|
+
|
|
96
|
+
- Excellent performance on SWE-Bench
|
|
97
|
+
- A trajectory browser
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
<table>
|
|
102
|
+
<tr>
|
|
103
|
+
<td width="50%">
|
|
104
|
+
<a href="https://mini-swe-agent.com/latest/usage/mini/"><strong>Simple UI</strong></a> (<code>mini</code>)
|
|
105
|
+
</td>
|
|
106
|
+
<td>
|
|
107
|
+
<a href="https://mini-swe-agent.com/latest/usage/mini_v/"><strong>Visual UI</strong></a> (<code>mini -v</code>)
|
|
108
|
+
</td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr>
|
|
111
|
+
<td width="50%">
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
</td>
|
|
116
|
+
<td>
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
</td>
|
|
121
|
+
</tr>
|
|
122
|
+
<tr>
|
|
123
|
+
<td>
|
|
124
|
+
<a href="https://mini-swe-agent.com/latest/usage/swebench/"><strong>Batch inference</strong></a>
|
|
125
|
+
</td>
|
|
126
|
+
<td>
|
|
127
|
+
<a href="https://mini-swe-agent.com/latest/usage/inspector/"><strong>Trajectory browser</strong></a>
|
|
128
|
+
</td>
|
|
129
|
+
<tr>
|
|
130
|
+
<tr>
|
|
131
|
+
|
|
132
|
+
<td>
|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
</td>
|
|
137
|
+
|
|
138
|
+
<td>
|
|
139
|
+
|
|
140
|
+

|
|
141
|
+
|
|
142
|
+
</td>
|
|
143
|
+
|
|
144
|
+
</tr>
|
|
145
|
+
<td>
|
|
146
|
+
<a href="https://mini-swe-agent.com/latest/advanced/cookbook/"><strong>Python bindings</strong></a>
|
|
147
|
+
</td>
|
|
148
|
+
<td>
|
|
149
|
+
<a href="https://mini-swe-agent.com"><strong>More in the docs</strong></a>
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr>
|
|
153
|
+
<td>
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
agent = DefaultAgent(
|
|
157
|
+
LitellmModel(model_name=...),
|
|
158
|
+
LocalEnvironment(),
|
|
159
|
+
)
|
|
160
|
+
agent.run("Write a sudoku game")
|
|
161
|
+
```
|
|
162
|
+
</td>
|
|
163
|
+
<td>
|
|
164
|
+
|
|
165
|
+
* [Quick start](https://mini-swe-agent.com/latest/quickstart/)
|
|
166
|
+
* [`mini`](https://mini-swe-agent.com/latest/usage/mini/)
|
|
167
|
+
* [FAQ](https://mini-swe-agent.com/latest/faq/)
|
|
168
|
+
* [Configuration](https://mini-swe-agent.com/latest/advanced/configuration/)
|
|
169
|
+
* [Power up](https://mini-swe-agent.com/latest/advanced/cookbook/)
|
|
170
|
+
|
|
171
|
+
</td>
|
|
172
|
+
</tr>
|
|
173
|
+
</table>
|
|
174
|
+
|
|
175
|
+
## 🔥 Let's get started!
|
|
176
|
+
|
|
177
|
+
Install + run in virtual environment
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Alternative: Install in current environment
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install mini-swe-agent && mini [-v]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Alternative: Install from source
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
git clone https://github.com/SWE-agent/mini-swe-agent.git
|
|
193
|
+
cd mini-swe-agent
|
|
194
|
+
pip install -e .
|
|
195
|
+
mini [-v]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Read more in our [documentation](https://mini-swe-agent.com/latest/):
|
|
199
|
+
|
|
200
|
+
* [Quick start guide](https://mini-swe-agent.com/latest/quickstart/)
|
|
201
|
+
* More on [`mini`](https://mini-swe-agent.com/latest/usage/mini/) and [`mini -v`](https://mini-swe-agent.com/latest/usage/mini_v/)
|
|
202
|
+
* [Configuration](https://mini-swe-agent.com/latest/advanced/configuration/)
|
|
203
|
+
* [Power up with the cookbook](https://mini-swe-agent.com/latest/advanced/cookbook/)
|
|
204
|
+
* [FAQ](https://mini-swe-agent.com/latest/faq/)
|
|
205
|
+
* [Contribute!](https://mini-swe-agent.com/latest/contributing/)
|
|
206
|
+
|
|
207
|
+
## 👀 More agentic AI
|
|
208
|
+
|
|
209
|
+
<div align="center">
|
|
210
|
+
<a href="https://github.com/SWE-agent/SWE-agent"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/sweagent_logo_text_below.svg" alt="SWE-agent" height="120px"></a>
|
|
211
|
+
|
|
212
|
+
<a href="https://github.com/SWE-agent/SWE-ReX"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swerex_logo_text_below.svg" alt="SWE-ReX" height="120px"></a>
|
|
213
|
+
|
|
214
|
+
<a href="https://github.com/SWE-bench/SWE-bench"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swebench_logo_text_below.svg" alt="SWE-bench" height="120px"></a>
|
|
215
|
+
|
|
216
|
+
<a href="https://github.com/SWE-bench/SWE-smith"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/swesmith_logo_text_below.svg" alt="SWE-smith" height="120px"></a>
|
|
217
|
+
|
|
218
|
+
<a href="https://github.com/SWE-bench/sb-cli"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/sbcli_logo_text_below.svg" alt="sb-cli" height="120px"></a>
|
|
219
|
+
</div>
|
|
220
|
+
|