Mini-SWE-Agent Integration

Mini-SWE-Agent is a lightweight software engineering agent. The ConTree integration enables it to execute code in isolated, reproducible containers. Every command in Mini-SWE-Agent is executed in a fresh shell session, which makes it perfectly suitable for ConTree.

Integration is available via ContreeEnvironment starting from mini-swe-agent v2.2.0.

Using ContreeEnvironment

 1from minisweagent.agents.default import DefaultAgent
 2from minisweagent.environments.extra.contree import ContreeEnvironment
 3from minisweagent.models import get_model
 4
 5from contree_sdk.auth import IAMAuth
 6from contree_sdk.config import ContreeConfig
 7
 8
 9def main():
10    contree_env = ContreeEnvironment(
11        contree_config=ContreeConfig(
12            auth=IAMAuth(base_url="https://contree.dev/"),
13        ),
14        image="python:3.13-slim",
15        cwd="/workspace",
16    )
17
18    agent = DefaultAgent(
19        get_model(input_model_name="gemini/gemini-flash-latest"), contree_env, system_template="", instance_template=""
20    )
21    agent.run("Develop small calculator script and check it")
22
23    result = contree_env.session.run(shell="ls /workspace -lah").wait()
24    print(result.stdout)
25
26
27if __name__ == "__main__":
28    main()

Running with SWE-bench

Setup

  1. Install the dependencies:

    pip install "mini-swe-agent[contree]"
    
  2. Set up Nebius IAM token and base URL:

    export NEBIUS_API_KEY="your-nebius-iam-token"
    export NEBIUS_PROJECT_ID="your-project-id"
    export CONTREE_BASE_URL="your-given-base-url-for-contree"
    

Usage

Run mini-swe-agent like with any other environment:

mini-extra swebench \
    --subset verified \
    --split test \
    --workers 100
    --environment-class contree

It can be specified both through cli parameter or by setting environment_class to contree in your swebench.yaml config