mini-swe-agent 1.17.1__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.
Files changed (66) hide show
  1. mini_swe_agent-1.17.1/LICENSE.md +21 -0
  2. mini_swe_agent-1.17.1/PKG-INFO +314 -0
  3. mini_swe_agent-1.17.1/README.md +243 -0
  4. mini_swe_agent-1.17.1/pyproject.toml +265 -0
  5. mini_swe_agent-1.17.1/setup.cfg +4 -0
  6. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/PKG-INFO +314 -0
  7. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/SOURCES.txt +64 -0
  8. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/dependency_links.txt +1 -0
  9. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/entry_points.txt +5 -0
  10. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/requires.txt +32 -0
  11. mini_swe_agent-1.17.1/src/mini_swe_agent.egg-info/top_level.txt +1 -0
  12. mini_swe_agent-1.17.1/src/minisweagent/__init__.py +83 -0
  13. mini_swe_agent-1.17.1/src/minisweagent/__main__.py +7 -0
  14. mini_swe_agent-1.17.1/src/minisweagent/agents/__init__.py +1 -0
  15. mini_swe_agent-1.17.1/src/minisweagent/agents/default.py +130 -0
  16. mini_swe_agent-1.17.1/src/minisweagent/agents/interactive.py +153 -0
  17. mini_swe_agent-1.17.1/src/minisweagent/agents/interactive_textual.py +450 -0
  18. mini_swe_agent-1.17.1/src/minisweagent/config/README.md +9 -0
  19. mini_swe_agent-1.17.1/src/minisweagent/config/__init__.py +27 -0
  20. mini_swe_agent-1.17.1/src/minisweagent/config/default.yaml +156 -0
  21. mini_swe_agent-1.17.1/src/minisweagent/config/extra/__init__.py +1 -0
  22. mini_swe_agent-1.17.1/src/minisweagent/config/extra/swebench.yaml +230 -0
  23. mini_swe_agent-1.17.1/src/minisweagent/config/extra/swebench_roulette.yaml +233 -0
  24. mini_swe_agent-1.17.1/src/minisweagent/config/extra/swebench_xml.yaml +215 -0
  25. mini_swe_agent-1.17.1/src/minisweagent/config/github_issue.yaml +145 -0
  26. mini_swe_agent-1.17.1/src/minisweagent/config/mini.tcss +86 -0
  27. mini_swe_agent-1.17.1/src/minisweagent/config/mini.yaml +157 -0
  28. mini_swe_agent-1.17.1/src/minisweagent/environments/__init__.py +31 -0
  29. mini_swe_agent-1.17.1/src/minisweagent/environments/docker.py +114 -0
  30. mini_swe_agent-1.17.1/src/minisweagent/environments/extra/__init__.py +0 -0
  31. mini_swe_agent-1.17.1/src/minisweagent/environments/extra/bubblewrap.py +112 -0
  32. mini_swe_agent-1.17.1/src/minisweagent/environments/extra/swerex_docker.py +47 -0
  33. mini_swe_agent-1.17.1/src/minisweagent/environments/local.py +38 -0
  34. mini_swe_agent-1.17.1/src/minisweagent/environments/singularity.py +97 -0
  35. mini_swe_agent-1.17.1/src/minisweagent/models/__init__.py +114 -0
  36. mini_swe_agent-1.17.1/src/minisweagent/models/anthropic.py +35 -0
  37. mini_swe_agent-1.17.1/src/minisweagent/models/extra/__init__.py +0 -0
  38. mini_swe_agent-1.17.1/src/minisweagent/models/extra/roulette.py +61 -0
  39. mini_swe_agent-1.17.1/src/minisweagent/models/litellm_model.py +100 -0
  40. mini_swe_agent-1.17.1/src/minisweagent/models/litellm_response_api_model.py +80 -0
  41. mini_swe_agent-1.17.1/src/minisweagent/models/openrouter_model.py +125 -0
  42. mini_swe_agent-1.17.1/src/minisweagent/models/portkey_model.py +154 -0
  43. mini_swe_agent-1.17.1/src/minisweagent/models/portkey_response_api_model.py +74 -0
  44. mini_swe_agent-1.17.1/src/minisweagent/models/requesty_model.py +119 -0
  45. mini_swe_agent-1.17.1/src/minisweagent/models/test_models.py +42 -0
  46. mini_swe_agent-1.17.1/src/minisweagent/models/utils/__init__.py +0 -0
  47. mini_swe_agent-1.17.1/src/minisweagent/models/utils/cache_control.py +54 -0
  48. mini_swe_agent-1.17.1/src/minisweagent/models/utils/key_per_thread.py +20 -0
  49. mini_swe_agent-1.17.1/src/minisweagent/models/utils/openai_utils.py +41 -0
  50. mini_swe_agent-1.17.1/src/minisweagent/py.typed +0 -0
  51. mini_swe_agent-1.17.1/src/minisweagent/run/__init__.py +1 -0
  52. mini_swe_agent-1.17.1/src/minisweagent/run/extra/__init__.py +0 -0
  53. mini_swe_agent-1.17.1/src/minisweagent/run/extra/config.py +114 -0
  54. mini_swe_agent-1.17.1/src/minisweagent/run/extra/swebench.py +266 -0
  55. mini_swe_agent-1.17.1/src/minisweagent/run/extra/swebench_single.py +79 -0
  56. mini_swe_agent-1.17.1/src/minisweagent/run/extra/utils/__init__.py +0 -0
  57. mini_swe_agent-1.17.1/src/minisweagent/run/extra/utils/batch_progress.py +178 -0
  58. mini_swe_agent-1.17.1/src/minisweagent/run/github_issue.py +87 -0
  59. mini_swe_agent-1.17.1/src/minisweagent/run/hello_world.py +36 -0
  60. mini_swe_agent-1.17.1/src/minisweagent/run/inspector.py +210 -0
  61. mini_swe_agent-1.17.1/src/minisweagent/run/mini.py +108 -0
  62. mini_swe_agent-1.17.1/src/minisweagent/run/mini_extra.py +44 -0
  63. mini_swe_agent-1.17.1/src/minisweagent/run/utils/__init__.py +0 -0
  64. mini_swe_agent-1.17.1/src/minisweagent/run/utils/save.py +78 -0
  65. mini_swe_agent-1.17.1/src/minisweagent/utils/__init__.py +0 -0
  66. mini_swe_agent-1.17.1/src/minisweagent/utils/log.py +36 -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,314 @@
1
+ Metadata-Version: 2.4
2
+ Name: mini-swe-agent
3
+ Version: 1.17.1
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.10
36
+ Classifier: Programming Language :: Python :: 3 :: Only
37
+ Requires-Python: >=3.10
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>=1.75.5
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
+ Requires-Dist: openai!=1.100.0,!=1.100.1
52
+ Provides-Extra: full
53
+ Requires-Dist: mini-swe-agent[dev]; extra == "full"
54
+ Requires-Dist: swe-rex>=1.4.0; extra == "full"
55
+ Provides-Extra: dev
56
+ Requires-Dist: datasets; extra == "dev"
57
+ Requires-Dist: pytest; extra == "dev"
58
+ Requires-Dist: pytest-cov; extra == "dev"
59
+ Requires-Dist: pytest-asyncio; extra == "dev"
60
+ Requires-Dist: pytest-xdist; extra == "dev"
61
+ Requires-Dist: pre-commit; extra == "dev"
62
+ Requires-Dist: ruff; extra == "dev"
63
+ Requires-Dist: mkdocs-include-markdown-plugin; extra == "dev"
64
+ Requires-Dist: mkdocstrings[python]>=0.18; extra == "dev"
65
+ Requires-Dist: mike; extra == "dev"
66
+ Requires-Dist: mkdocs-material; extra == "dev"
67
+ Requires-Dist: mkdocs-glightbox; extra == "dev"
68
+ Requires-Dist: mkdocs-redirects; extra == "dev"
69
+ Requires-Dist: portkey-ai; extra == "dev"
70
+ Dynamic: license-file
71
+
72
+ <div align="center">
73
+ <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>
74
+ </div>
75
+
76
+ # The 100 line AI agent that solves GitHub issues & more
77
+
78
+ 📣 [Gemini 3 Pro reaches 74% on SWE-bench verified with mini-swe-agent!](https://x.com/KLieret/status/1991164693839270372)<br/>
79
+ 📣 [New blogpost: Randomly switching between GPT-5 and Sonnet 4 boosts performance](https://www.swebench.com/SWE-bench/blog/2025/08/19/mini-roulette/)
80
+
81
+ [![Docs](https://img.shields.io/badge/Docs-green?style=for-the-badge&logo=materialformkdocs&logoColor=white)](https://mini-swe-agent.com/latest/)
82
+ [![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
83
+ [![PyPI - Version](https://img.shields.io/pypi/v/mini-swe-agent?style=for-the-badge&logo=python&logoColor=white&labelColor=black&color=deeppink)](https://pypi.org/project/mini-swe-agent/)
84
+
85
+ In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the coding agent revolution.
86
+
87
+ We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
88
+
89
+ `mini` is for
90
+
91
+ - **Researchers** who want to **[benchmark](https://swe-bench.com), [fine-tune](https://swesmith.com/) or RL** without assumptions, bloat, or surprises
92
+ - **Developers** who like their tools like their scripts: **short, sharp, and readable**
93
+ - **Engineers** who want something **trivial to sandbox & to deploy anywhere**
94
+
95
+ Here's some details:
96
+
97
+ - **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),
98
+ [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!
99
+ - **Powerful:** Resolves >74% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/) ([leaderboard](https://swe-bench.com/)).
100
+ - **Convenient:** Comes with UIs that turn this into your daily dev swiss army knife!
101
+ - **Deployable:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
102
+ - **Tested:** [![Codecov](https://img.shields.io/codecov/c/github/swe-agent/mini-swe-agent?style=flat-square)](https://codecov.io/gh/SWE-agent/mini-swe-agent)
103
+ - **Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
104
+
105
+ <details>
106
+
107
+ <summary>More motivation (for research)</summary>
108
+
109
+ [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.
110
+ However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
111
+ In fact, mini-SWE-agent
112
+
113
+ - **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
114
+ This means that you can run it with literally any model. When running in sandboxed environments you also don't need to take care
115
+ of installing a single package — all it needs is bash.
116
+ - **Has a completely linear history** — every step of the agent just appends to the messages and that's it.
117
+ So there's no difference between the trajectory and the messages that you pass on to the LM.
118
+ Great for debugging & fine-tuning.
119
+ - **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
120
+ This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
121
+ scale up effortlessly. Seriously, this is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session), trust me.
122
+
123
+ This makes it perfect as a baseline system and for a system that puts the language model (rather than
124
+ the agent scaffold) in the middle of our attention.
125
+ You can see the result on the [SWE-bench (bash only)](https://www.swebench.com/) leaderboard, that evaluates the performance of different LMs with `mini`.
126
+
127
+ </details>
128
+
129
+ <details>
130
+ <summary>More motivation (as a tool)</summary>
131
+
132
+ Some agents are overfitted research artifacts. Others are UI-heavy frontend monsters.
133
+
134
+ `mini` wants to be a hackable tool, not a black box.
135
+
136
+ - **Simple** enough to understand at a glance
137
+ - **Convenient** enough to use in daily workflows
138
+ - **Flexible** to extend
139
+
140
+ Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)), it is radically simpler, because it:
141
+
142
+ - **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
143
+ Instead of implementing custom tools for every specific thing the agent might want to do, the focus is fully on the LM utilizing the shell to its full potential.
144
+ Want it to do something specific like opening a PR?
145
+ Just tell the LM to figure it out rather than spending time to implement it in the agent.
146
+ - **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
147
+ This is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session) for the stability of the agent, trust me.
148
+ - **Has a completely linear history** — every step of the agent just appends to the messages that are passed to the LM in the next step and that's it.
149
+ This is great for debugging and understanding what the LM is prompted with.
150
+
151
+ </details>
152
+
153
+ <details>
154
+ <summary>Should I use SWE-agent or mini-SWE-agent?</summary>
155
+
156
+ You should use `mini-swe-agent` 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
+ - You are doing FT or RL and don't want to overfit to a specific agent scaffold
162
+
163
+ You should use `swe-agent` if
164
+
165
+ - You need specific tools or want to experiment with different tools
166
+ - You want to experiment with different history processors
167
+ - You want very powerful yaml configuration without touching code
168
+
169
+ What you get with both
170
+
171
+ - Excellent performance on SWE-Bench
172
+ - A trajectory browser
173
+
174
+ </details>
175
+
176
+ <table>
177
+ <tr>
178
+ <td width="50%">
179
+ <a href="https://mini-swe-agent.com/latest/usage/mini/"><strong>Simple UI</strong></a> (<code>mini</code>)
180
+ </td>
181
+ <td>
182
+ <a href="https://mini-swe-agent.com/latest/usage/mini_v/"><strong>Visual UI</strong></a> (<code>mini -v</code>)
183
+ </td>
184
+ </tr>
185
+ <tr>
186
+ <td width="50%">
187
+
188
+ ![mini](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/mini.gif?raw=true)
189
+
190
+ </td>
191
+ <td>
192
+
193
+ ![miniv](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/mini2.gif?raw=true)
194
+
195
+ </td>
196
+ </tr>
197
+ <tr>
198
+ <td>
199
+ <a href="https://mini-swe-agent.com/latest/usage/swebench/"><strong>Batch inference</strong></a>
200
+ </td>
201
+ <td>
202
+ <a href="https://mini-swe-agent.com/latest/usage/inspector/"><strong>Trajectory browser</strong></a>
203
+ </td>
204
+ <tr>
205
+ <tr>
206
+
207
+ <td>
208
+
209
+ ![swebench](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/swebench.gif?raw=true)
210
+
211
+ </td>
212
+
213
+ <td>
214
+
215
+ ![inspector](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/inspector.gif?raw=true)
216
+
217
+ </td>
218
+
219
+ </tr>
220
+ <td>
221
+ <a href="https://mini-swe-agent.com/latest/advanced/cookbook/"><strong>Python bindings</strong></a>
222
+ </td>
223
+ <td>
224
+ <a href="https://mini-swe-agent.com"><strong>More in the docs</strong></a>
225
+ </td>
226
+ </tr>
227
+ <tr>
228
+ <td>
229
+
230
+ ```python
231
+ agent = DefaultAgent(
232
+ LitellmModel(model_name=...),
233
+ LocalEnvironment(),
234
+ )
235
+ agent.run("Write a sudoku game")
236
+ ```
237
+ </td>
238
+ <td>
239
+
240
+ * [Quick start](https://mini-swe-agent.com/latest/quickstart/)
241
+ * [`mini`](https://mini-swe-agent.com/latest/usage/mini/)
242
+ * [FAQ](https://mini-swe-agent.com/latest/faq/)
243
+ * [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
244
+ * [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
245
+ * [Power up](https://mini-swe-agent.com/latest/advanced/cookbook/)
246
+
247
+ </td>
248
+ </tr>
249
+ </table>
250
+
251
+ ## Let's get started!
252
+
253
+ **Option 1:** If you just want to try out the CLI (package installed in anonymous virtual environment)
254
+
255
+ ```bash
256
+ pip install uv && uvx mini-swe-agent [-v]
257
+ # or
258
+ pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
259
+ ```
260
+
261
+ **Option 2:** Install CLI & python bindings in current environment
262
+
263
+ ```bash
264
+ pip install mini-swe-agent
265
+ mini -v # run the CLI
266
+ ```
267
+
268
+ **Option 3:** Install from source (developer setup)
269
+
270
+ ```bash
271
+ git clone https://github.com/SWE-agent/mini-swe-agent.git
272
+ cd mini-swe-agent && pip install -e .
273
+ mini [-v] # run the CLI
274
+ ```
275
+
276
+ Read more in our [documentation](https://mini-swe-agent.com/latest/):
277
+
278
+ * [Quick start guide](https://mini-swe-agent.com/latest/quickstart/)
279
+ * More on [`mini`](https://mini-swe-agent.com/latest/usage/mini/) and [`mini -v`](https://mini-swe-agent.com/latest/usage/mini_v/)
280
+ * [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
281
+ * [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
282
+ * [Power up with the cookbook](https://mini-swe-agent.com/latest/advanced/cookbook/)
283
+ * [FAQ](https://mini-swe-agent.com/latest/faq/)
284
+ * [Contribute!](https://mini-swe-agent.com/latest/contributing/)
285
+
286
+ ## Attribution
287
+
288
+ If you found this work helpful, please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
289
+
290
+ ```bibtex
291
+ @inproceedings{yang2024sweagent,
292
+ title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
293
+ author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
294
+ booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
295
+ year={2024},
296
+ url={https://arxiv.org/abs/2405.15793}
297
+ }
298
+ ```
299
+
300
+ Our other projects:
301
+
302
+ <div align="center">
303
+ <a href="https://github.com/SWE-agent/SWE-agent"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/sweagent_logo_text_below.svg" alt="SWE-agent" height="120px"></a>
304
+ &nbsp;&nbsp;
305
+ <a href="https://github.com/SWE-agent/SWE-ReX"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swerex_logo_text_below.svg" alt="SWE-ReX" height="120px"></a>
306
+ &nbsp;&nbsp;
307
+ <a href="https://github.com/SWE-bench/SWE-bench"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swebench_logo_text_below.svg" alt="SWE-bench" height="120px"></a>
308
+ &nbsp;&nbsp;
309
+ <a href="https://github.com/SWE-bench/SWE-smith"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swesmith_logo_text_below.svg" alt="SWE-smith" height="120px"></a>
310
+ &nbsp;&nbsp;
311
+ <a href="https://github.com/codeclash-ai/codeclash"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/codeclash_logo_text_below.svg" alt="CodeClash" height="120px"></a>
312
+ &nbsp;&nbsp;
313
+ <a href="https://github.com/SWE-bench/sb-cli"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/sbcli_logo_text_below.svg" alt="sb-cli" height="120px"></a>
314
+ </div>
@@ -0,0 +1,243 @@
1
+ <div align="center">
2
+ <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>
3
+ </div>
4
+
5
+ # The 100 line AI agent that solves GitHub issues & more
6
+
7
+ 📣 [Gemini 3 Pro reaches 74% on SWE-bench verified with mini-swe-agent!](https://x.com/KLieret/status/1991164693839270372)<br/>
8
+ 📣 [New blogpost: Randomly switching between GPT-5 and Sonnet 4 boosts performance](https://www.swebench.com/SWE-bench/blog/2025/08/19/mini-roulette/)
9
+
10
+ [![Docs](https://img.shields.io/badge/Docs-green?style=for-the-badge&logo=materialformkdocs&logoColor=white)](https://mini-swe-agent.com/latest/)
11
+ [![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
12
+ [![PyPI - Version](https://img.shields.io/pypi/v/mini-swe-agent?style=for-the-badge&logo=python&logoColor=white&labelColor=black&color=deeppink)](https://pypi.org/project/mini-swe-agent/)
13
+
14
+ In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the coding agent revolution.
15
+
16
+ We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
17
+
18
+ `mini` is for
19
+
20
+ - **Researchers** who want to **[benchmark](https://swe-bench.com), [fine-tune](https://swesmith.com/) or RL** without assumptions, bloat, or surprises
21
+ - **Developers** who like their tools like their scripts: **short, sharp, and readable**
22
+ - **Engineers** who want something **trivial to sandbox & to deploy anywhere**
23
+
24
+ Here's some details:
25
+
26
+ - **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),
27
+ [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!
28
+ - **Powerful:** Resolves >74% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/) ([leaderboard](https://swe-bench.com/)).
29
+ - **Convenient:** Comes with UIs that turn this into your daily dev swiss army knife!
30
+ - **Deployable:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
31
+ - **Tested:** [![Codecov](https://img.shields.io/codecov/c/github/swe-agent/mini-swe-agent?style=flat-square)](https://codecov.io/gh/SWE-agent/mini-swe-agent)
32
+ - **Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
33
+
34
+ <details>
35
+
36
+ <summary>More motivation (for research)</summary>
37
+
38
+ [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.
39
+ However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
40
+ In fact, mini-SWE-agent
41
+
42
+ - **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
43
+ This means that you can run it with literally any model. When running in sandboxed environments you also don't need to take care
44
+ of installing a single package — all it needs is bash.
45
+ - **Has a completely linear history** — every step of the agent just appends to the messages and that's it.
46
+ So there's no difference between the trajectory and the messages that you pass on to the LM.
47
+ Great for debugging & fine-tuning.
48
+ - **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
49
+ This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
50
+ scale up effortlessly. Seriously, this is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session), trust me.
51
+
52
+ This makes it perfect as a baseline system and for a system that puts the language model (rather than
53
+ the agent scaffold) in the middle of our attention.
54
+ You can see the result on the [SWE-bench (bash only)](https://www.swebench.com/) leaderboard, that evaluates the performance of different LMs with `mini`.
55
+
56
+ </details>
57
+
58
+ <details>
59
+ <summary>More motivation (as a tool)</summary>
60
+
61
+ Some agents are overfitted research artifacts. Others are UI-heavy frontend monsters.
62
+
63
+ `mini` wants to be a hackable tool, not a black box.
64
+
65
+ - **Simple** enough to understand at a glance
66
+ - **Convenient** enough to use in daily workflows
67
+ - **Flexible** to extend
68
+
69
+ Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)), it is radically simpler, because it:
70
+
71
+ - **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
72
+ Instead of implementing custom tools for every specific thing the agent might want to do, the focus is fully on the LM utilizing the shell to its full potential.
73
+ Want it to do something specific like opening a PR?
74
+ Just tell the LM to figure it out rather than spending time to implement it in the agent.
75
+ - **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
76
+ This is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session) for the stability of the agent, trust me.
77
+ - **Has a completely linear history** — every step of the agent just appends to the messages that are passed to the LM in the next step and that's it.
78
+ This is great for debugging and understanding what the LM is prompted with.
79
+
80
+ </details>
81
+
82
+ <details>
83
+ <summary>Should I use SWE-agent or mini-SWE-agent?</summary>
84
+
85
+ You should use `mini-swe-agent` if
86
+
87
+ - You want a quick command line tool that works locally
88
+ - You want an agent with a very simple control flow
89
+ - You want even faster, simpler & more stable sandboxing & benchmark evaluations
90
+ - You are doing FT or RL and don't want to overfit to a specific agent scaffold
91
+
92
+ You should use `swe-agent` if
93
+
94
+ - You need specific tools or want to experiment with different tools
95
+ - You want to experiment with different history processors
96
+ - You want very powerful yaml configuration without touching code
97
+
98
+ What you get with both
99
+
100
+ - Excellent performance on SWE-Bench
101
+ - A trajectory browser
102
+
103
+ </details>
104
+
105
+ <table>
106
+ <tr>
107
+ <td width="50%">
108
+ <a href="https://mini-swe-agent.com/latest/usage/mini/"><strong>Simple UI</strong></a> (<code>mini</code>)
109
+ </td>
110
+ <td>
111
+ <a href="https://mini-swe-agent.com/latest/usage/mini_v/"><strong>Visual UI</strong></a> (<code>mini -v</code>)
112
+ </td>
113
+ </tr>
114
+ <tr>
115
+ <td width="50%">
116
+
117
+ ![mini](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/mini.gif?raw=true)
118
+
119
+ </td>
120
+ <td>
121
+
122
+ ![miniv](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/mini2.gif?raw=true)
123
+
124
+ </td>
125
+ </tr>
126
+ <tr>
127
+ <td>
128
+ <a href="https://mini-swe-agent.com/latest/usage/swebench/"><strong>Batch inference</strong></a>
129
+ </td>
130
+ <td>
131
+ <a href="https://mini-swe-agent.com/latest/usage/inspector/"><strong>Trajectory browser</strong></a>
132
+ </td>
133
+ <tr>
134
+ <tr>
135
+
136
+ <td>
137
+
138
+ ![swebench](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/swebench.gif?raw=true)
139
+
140
+ </td>
141
+
142
+ <td>
143
+
144
+ ![inspector](https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/inspector.gif?raw=true)
145
+
146
+ </td>
147
+
148
+ </tr>
149
+ <td>
150
+ <a href="https://mini-swe-agent.com/latest/advanced/cookbook/"><strong>Python bindings</strong></a>
151
+ </td>
152
+ <td>
153
+ <a href="https://mini-swe-agent.com"><strong>More in the docs</strong></a>
154
+ </td>
155
+ </tr>
156
+ <tr>
157
+ <td>
158
+
159
+ ```python
160
+ agent = DefaultAgent(
161
+ LitellmModel(model_name=...),
162
+ LocalEnvironment(),
163
+ )
164
+ agent.run("Write a sudoku game")
165
+ ```
166
+ </td>
167
+ <td>
168
+
169
+ * [Quick start](https://mini-swe-agent.com/latest/quickstart/)
170
+ * [`mini`](https://mini-swe-agent.com/latest/usage/mini/)
171
+ * [FAQ](https://mini-swe-agent.com/latest/faq/)
172
+ * [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
173
+ * [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
174
+ * [Power up](https://mini-swe-agent.com/latest/advanced/cookbook/)
175
+
176
+ </td>
177
+ </tr>
178
+ </table>
179
+
180
+ ## Let's get started!
181
+
182
+ **Option 1:** If you just want to try out the CLI (package installed in anonymous virtual environment)
183
+
184
+ ```bash
185
+ pip install uv && uvx mini-swe-agent [-v]
186
+ # or
187
+ pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
188
+ ```
189
+
190
+ **Option 2:** Install CLI & python bindings in current environment
191
+
192
+ ```bash
193
+ pip install mini-swe-agent
194
+ mini -v # run the CLI
195
+ ```
196
+
197
+ **Option 3:** Install from source (developer setup)
198
+
199
+ ```bash
200
+ git clone https://github.com/SWE-agent/mini-swe-agent.git
201
+ cd mini-swe-agent && pip install -e .
202
+ mini [-v] # run the CLI
203
+ ```
204
+
205
+ Read more in our [documentation](https://mini-swe-agent.com/latest/):
206
+
207
+ * [Quick start guide](https://mini-swe-agent.com/latest/quickstart/)
208
+ * More on [`mini`](https://mini-swe-agent.com/latest/usage/mini/) and [`mini -v`](https://mini-swe-agent.com/latest/usage/mini_v/)
209
+ * [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
210
+ * [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
211
+ * [Power up with the cookbook](https://mini-swe-agent.com/latest/advanced/cookbook/)
212
+ * [FAQ](https://mini-swe-agent.com/latest/faq/)
213
+ * [Contribute!](https://mini-swe-agent.com/latest/contributing/)
214
+
215
+ ## Attribution
216
+
217
+ If you found this work helpful, please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
218
+
219
+ ```bibtex
220
+ @inproceedings{yang2024sweagent,
221
+ title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
222
+ author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
223
+ booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
224
+ year={2024},
225
+ url={https://arxiv.org/abs/2405.15793}
226
+ }
227
+ ```
228
+
229
+ Our other projects:
230
+
231
+ <div align="center">
232
+ <a href="https://github.com/SWE-agent/SWE-agent"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/sweagent_logo_text_below.svg" alt="SWE-agent" height="120px"></a>
233
+ &nbsp;&nbsp;
234
+ <a href="https://github.com/SWE-agent/SWE-ReX"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swerex_logo_text_below.svg" alt="SWE-ReX" height="120px"></a>
235
+ &nbsp;&nbsp;
236
+ <a href="https://github.com/SWE-bench/SWE-bench"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swebench_logo_text_below.svg" alt="SWE-bench" height="120px"></a>
237
+ &nbsp;&nbsp;
238
+ <a href="https://github.com/SWE-bench/SWE-smith"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/swesmith_logo_text_below.svg" alt="SWE-smith" height="120px"></a>
239
+ &nbsp;&nbsp;
240
+ <a href="https://github.com/codeclash-ai/codeclash"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/codeclash_logo_text_below.svg" alt="CodeClash" height="120px"></a>
241
+ &nbsp;&nbsp;
242
+ <a href="https://github.com/SWE-bench/sb-cli"><img src="https://raw.githubusercontent.com/SWE-agent/swe-agent-media/refs/heads/main/media/logos_banners/sbcli_logo_text_below.svg" alt="sb-cli" height="120px"></a>
243
+ </div>