{"id":3550,"library":"mini-swe-agent","title":"Nano SWE Agent","description":"mini-SWE-agent is a minimalist yet powerful AI software engineering agent, designed to solve GitHub issues and assist in command-line tasks. It's built on a radically simple 100-line Python core, primarily leveraging bash for actions and supporting various models via LiteLLM. Widely adopted by institutions like Meta and Stanford, it focuses on performance, deployability across different environments (local, Docker), and is actively developed with frequent updates.","status":"active","version":"2.2.8","language":"en","source_language":"en","source_url":"https://github.com/SWE-agent/mini-swe-agent","tags":["nlp","agents","code","llm","swe-bench"],"install":[{"cmd":"pip install mini-swe-agent","lang":"bash","label":"Stable release"},{"cmd":"pip install -e .","lang":"bash","label":"Development install (from source after cloning)"}],"dependencies":[{"reason":"Used for model flexibility, supporting over 100 LLM providers. Specific versions (1.82.7, 1.82.8) were compromised and are excluded.","package":"litellm"},{"reason":"Direct dependency, with specific problematic versions excluded.","package":"openai"},{"reason":"Core dependency for configuration.","package":"pyyaml"},{"reason":"Used for rich terminal output and interactive experience.","package":"rich"}],"imports":[{"symbol":"DefaultAgent","correct":"from minisweagent.agents.default import DefaultAgent"},{"symbol":"LitellmModel","correct":"from minisweagent.models.litellm_model import LitellmModel"},{"symbol":"LocalEnvironment","correct":"from minisweagent.environments.local import LocalEnvironment"}],"quickstart":{"code":"import os\nfrom minisweagent.agents.default import DefaultAgent\nfrom minisweagent.models.litellm_model import LitellmModel\nfrom minisweagent.environments.local import LocalEnvironment\n\n# Set your LLM API key and model name\nos.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"MINI_SWE_AGENT_OPENAI_KEY\", \"sk-YOUR_OPENAI_KEY\")\nmodel_name = os.environ.get(\"MINI_SWE_AGENT_MODEL_NAME\", \"gpt-4o-mini\") # Or \"claude-3-sonnet\", etc.\n\nagent = DefaultAgent(\n    LitellmModel(model_name=model_name),\n    LocalEnvironment(),\n)\n\ntask = \"Write a Python function to calculate the nth Fibonacci number, with tests.\"\nresult = agent.run(task)\n\nprint(f\"Agent finished with status: {result.get('exit_status')}\")\nprint(f\"Submission: {result.get('submission')}\")","lang":"python","description":"This quickstart demonstrates how to initialize and run a `DefaultAgent` using a LiteLLM-compatible model (like OpenAI's GPT models) within a `LocalEnvironment`. The agent is tasked with writing a Python function and its tests. Ensure your LLM API key and preferred model name are set, either directly or via environment variables."},"warnings":[{"fix":"Upgrade `mini-swe-agent` to `v2.2.8` or newer, which excludes compromised `litellm` versions. If managing `litellm` directly, ensure it's not `1.82.7` or `1.82.8`.","message":"Dependency `litellm` versions `1.82.7` and `1.82.8` were compromised. Update to a version that excludes these, or ensure your `litellm` installation is not one of these specific versions. The `mini-swe-agent` project has explicitly excluded these in its dependencies.","severity":"breaking","affected_versions":"litellm==1.82.7, litellm==1.82.8 (as a dependency)"},{"fix":"Upgrade or downgrade `openai` to a version outside of `1.100.0` or `1.100.1`.","message":"The `openai` dependency has specific versions (`1.100.0`, `1.100.1`) that are excluded due to known issues. Ensure your `openai` package is not one of these versions.","severity":"gotcha","affected_versions":"openai==1.100.0, openai==1.100.1"},{"fix":"Upgrade to `mini-swe-agent` v2.2.5 or newer to benefit from bug fixes related to `FormatError` handling.","message":"Older versions (pre-v2.2.5) could experience `FormatError`s, especially with weaker/smaller language models that make tool-calling mistakes, potentially hanging the agent.","severity":"gotcha","affected_versions":"<2.2.5"},{"fix":"Consult the 'v2 migration guide' in the official documentation for details on the new output format, especially if parsing old trajectory files or comparing results across versions. Use the `inspector` for interactive browsing of new format files.","message":"The output format of trajectory files changed with v2.0 (from `trajectory_format: mini-swe-agent-1.0` to `mini-swe-agent-1.1`). If you have existing scripts or tools parsing v1 trajectory files, they will need updates.","severity":"gotcha","affected_versions":">=2.0.0 (when interacting with v1 outputs)"},{"fix":"Upgrade to `mini-swe-agent` v2.2.4 or newer to resolve the configuration reload issue after initial setup.","message":"In versions prior to `v2.2.4`, invoking `mini` for the first time after installation and calling `setup` could lead to an exception due to a missing default model name, as the configuration wasn't reloaded correctly.","severity":"gotcha","affected_versions":"<2.2.4"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}