{"id":23888,"library":"inspect-swe","title":"Inspect Swe","description":"Inspect Swe is a library for software engineering agents, built on top of Inspect AI. It provides tools and workflows for creating AI agents that can interact with code, run tests, and perform software engineering tasks. Version 0.2.50 is current, with active development.","status":"active","version":"0.2.50","language":"python","source_language":"en","source_url":"https://github.com/UKGovernmentBEIS/inspect-swe","tags":["agent","software-engineering","inspect-ai","ai-agents"],"install":[{"cmd":"pip install inspect-swe","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency - inspect-swe builds on Inspect AI framework","package":"inspect-ai","optional":false}],"imports":[{"note":"SweAgent is exposed at top-level package, not a submodule","wrong":"from inspect_swe.agent import SweAgent","symbol":"SweAgent","correct":"from inspect_swe import SweAgent"},{"note":"Use top-level import for SweEnvironment","wrong":"import inspect_swe.environment","symbol":"SweEnvironment","correct":"from inspect_swe import SweEnvironment"}],"quickstart":{"code":"from inspect_swe import SweAgent\nfrom inspect_ai import Task\ntask = Task(\"Write a function that adds two numbers\")","lang":"python","description":"Basic usage: create a SweAgent and run it on a simple coding task."},"warnings":[{"fix":"Change SweAgent(model='gpt-4') to SweAgent(config=SweConfig(model='gpt-4'))","message":"Breaking change in v0.2.0: SweAgent no longer accepts 'model' as a constructor argument. Use 'config.model' instead.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Replace agent.run(task) with agent.solve(task) or agent.execute(task)","message":"The 'run' method is deprecated since v0.2.40. Use 'solve' or 'execute' instead.","severity":"deprecated","affected_versions":">=0.2.40"},{"fix":"Ensure Docker Desktop or daemon is running before creating SweEnvironment.","message":"SweEnvironment requires a running Docker daemon when using local Docker backend. Failure to start Docker will raise RuntimeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'persistent' backend if state across tasks is needed.","message":"When using SweEnvironment with 'sandbox' backend, the environment is reset after each task. State is not persisted.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest: pip install --upgrade inspect-swe","cause":"Older version of inspect-swe (<0.1.0) did not expose SweAgent at package level.","error":"ImportError: cannot import name 'SweAgent' from 'inspect_swe'"},{"fix":"Start Docker Desktop or run 'dockerd' on Linux.","cause":"SweEnvironment requires Docker for local sandbox; Docker daemon not active.","error":"RuntimeError: Docker is not running. Please start Docker."},{"fix":"Check supported models: https://inspect.ai/docs/models","cause":"The model name passed to SweConfig is invalid. Inspect AI may not support that model.","error":"ValueError: Model 'gpt-4-32k' is not supported by Inspect AI."},{"fix":"Set timeout in SweConfig: SweConfig(timeout=120).then agent.solve(task)","cause":"The 'timeout' parameter was removed in v0.2.45. Use SweConfig(timeout=...) instead.","error":"TypeError: solve() got an unexpected keyword argument 'timeout'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}