Mini Swe Agent
The 100 line AI agent that solves GitHub issues or helps you in your command line. Radically simple, no huge configs, no giant monorepo—but scores >74% on SWE-bench verified!
Last verified:
What is Mini Swe Agent?
mini-SWE-agent (Mini Swe Agent 2) is a radically simple AI software engineering agent that solves GitHub issues and assists with command-line tasks. Built by researchers from Princeton University and Stanford University, it consists of just 100 lines of Python code and scores over 74% on the SWE-bench verified benchmark. The agent uses only bash as its tool and does not rely on LLM tool-calling interfaces, making it compatible with any language model.
Key features include support for all models via LiteLLM, OpenRouter, and Portkey; multiple deployment options including local environments, Docker, Podman, Singularity, and Apptainer; a simple CLI interface (mini); a visual UI mode (mini -v); batch inference capabilities; trajectory browser for debugging; and Python bindings for programmatic use. The agent has a completely linear message history, executes each action independently via subprocess.run, and is widely adopted by institutions like Meta, NVIDIA, IBM, Stanford, and Princeton.
mini-SWE-agent is designed for researchers who want to benchmark, fine-tune, or perform reinforcement learning without agent scaffold bloat; developers who prefer simple, readable tools; and engineers who need something trivial to sandbox and deploy anywhere. It's ideal for those wanting a quick command-line tool that works locally with simple control flow and stable sandboxing for benchmark evaluations.
Mini Swe Agent pricing
Pricing model: Freemium
mini-SWE-agent is completely free and open source under the MIT license. There are no paid tiers or subscription plans. The tool can be installed via pip (pip install mini-swe-agent), pipx, uv, or from source. All features including the CLI, visual UI, batch inference, trajectory browser, and Python bindings are available free of charge. Users only pay for the LLM API costs when using paid models through LiteLLM/OpenRouter, though local models can be used for free.
Mini Swe Agent pros
- Only 100 lines of Python code - radically simple
- Scores over 74% on SWE-bench verified benchmark
- Uses only bash - no other tools needed
- No LLM tool-calling interface required
- Compatible with any language model via LiteLLM
- Supports OpenRouter and Portkey integration
- Works with local models (vLLM, Ollama)
- Fast startup - faster than Claude Code
- No package installation needed in sandboxed environments
- Multiple sandbox options: Docker, Podman, Singularity, Apptainer, bublewrap, contree
- Linear message history - easy debugging and fine-tuning
- Each action is independent via subprocess.run - very stable
- Simple CLI interface (mini command)
- Visual UI mode available (mini -v)
- Python bindings for programmatic use
- Batch inference capabilities
- Trajectory browser for reviewing agent actions
- MIT license - open source
- Actively developed by Princeton & Stanford team
- Global configuration stored in simple .env file
Mini Swe Agent cons
- No tools other than bash available
- Actions parsed from triple-backtick blocks instead of function calling
- Each action is independent - cannot change directories persistently
- Cannot export environment variables persistently between actions
- No custom tool interface for specialized tasks
- YAML configuration less powerful than swe-agent
- No history processor experimentation like swe-agent
- Limited to bash-based workflows only
Frequently asked questions about Mini Swe Agent
Does mini-SWE-agent work on my system?
mini-SWE-agent should work on any system that has a bash shell or uses a container runtime such as Docker, Singularity, or Apptainer to emulate one. This includes Linux, macOS, and Windows (with WSL or a container runtime).
Should I use mini-SWE-agent or swe-agent?
Use mini-SWE-agent if you want a quick command-line tool that works locally, want an agent with very simple control flow, want faster/simpler/more stable sandboxing and benchmark evaluations, or are doing fine-tuning or RL without wanting to overfit to a specific agent scaffold. Use swe-agent if you need specific tools, want to experiment with different tools or history processors, or want powerful YAML configuration without touching code. Both offer excellent SWE-Bench performance and a trajectory browser.
How is mini simpler than swe-agent?
mini is simpler because it has no tools other than bash and doesn't use the tool-calling interface of LLMs, meaning you don't need to install anything in the environment you're running in - bash is all you need. It has a completely linear history where every step just appends to messages. It executes actions with subprocess.run so every action is completely independent rather than keeping a stateful shell session running, which avoids many issues.
What are the limitations of mini-SWE-agent?
The default setup has no tools other than bash, actions are parsed from triple-backtick blocks rather than using function calling/tool calling format, and by default actions are executed as subprocess.run meaning every action is independent (the agent cannot change directories or export environment variables persistently, though environment variables can be set per-action). However, none of these limitations are a problem in practice as reflected by high SWE-bench scores. For more flexibility, you can use SWE-agent instead.
Where is global configuration stored?
The global configuration is stored in the .env file in the config directory. The location is printed when you run mini --help. The .env file is a simple key-value file read by the dotenv library. You can also set the MSWEA_MINI_CONFIG_PATH to set a custom path to the default mini configuration file.
What models do you support?
mini-SWE-agent supports all models that are supported by LiteLLM or OpenRouter. This includes models from OpenAI, Anthropic, Google, and many others. The team is open to extending the models directory with more models if LiteLLM does not support them. Local models can also be used with vLLM or Ollama.
How do I set the API key for a model?
The API key can be set temporarily as an environment variable (e.g., export OPENAI_API_KEY=sk-test123) or permanently in the config file using mini-extra config set OPENAI_API_KEY sk-test123. Alternatively, you can directly edit the .env file in the config directory. Environment variables are not persistent unless set in your ~/.bashrc or similar.
How can I set the default model?
The default model is stored in the config/environment as MSWEA_MODEL_NAME. To permanently change it, use mini-extra config set MSWEA_MODEL_NAME anthropic/claude-sonnet-4-5-20250929. Alternatively, you can directly edit the .env file in the config directory.
Why is not needing a running shell session such a big deal?
Most agents keep a running shell session which is problematic: it's not obvious when a command has terminated, bad commands can kill the shell session, and interrupting commands can mess up the shell itself. mini has no running shell session - every action is executed as a subprocess (literally subprocess.run, os.system, or docker exec), making each action independent. This makes it trivial to execute actions in sandboxes and scale up effortlessly. You can always prefix cd /path/to/project or export FOO=bar to every action.
How do I install mini-SWE-agent?
You can install via pip (pip install mini-swe-agent, then run mini), pipx (pipx install mini-swe-agent, then run mini), uv (uvx mini-swe-agent), or from source (git clone https://github.com/SWE-agent/mini-swe-agent.git, cd mini-swe-agent, pip install -e ., then run mini). The --v flag enables visual UI mode. For extra utilities, use mini-extra command.