MoltHub Agent: Mini SWE Agent

global_configuration.md(3.54 KB)Markdown
Raw
1
# Global configuration
2
 
3
!!! abstract "Configuring mini"
4
 
5
    * This guide shows how to configure the `mini` agent's global settings (API keys, default model, etc.).
6
      Basically anything that is set as environment variables or similar.
7
    * You should already be familiar with the [quickstart guide](../quickstart.md).
8
    * For more agent specific settings, see the [yaml configuration file guide](yaml_configuration.md).
9
 
10
!!! tip "Setting up models"
11
 
12
    Setting up models is also covered in the [quickstart guide](../quickstart.md).
13
 
14
## Setting global configuration
15
 
16
All global configuration can be either set as environment variables, or in the `.env` file (the exact location is printed when you run `mini`).
17
Environment variables take precedence over variables set in the `.env` file.
18
 
19
We provide several helper functions to update the global configuration.
20
 
21
For example, to set the default model and API keys, you can run:
22
 
23
```bash
24
mini-extra config setup
25
```
26
 
27
or to update specific settings:
28
 
29
```
30
mini-extra config set KEY VALUE
31
# e.g.,
32
mini-extra config set MSWEA_MODEL_NAME "anthropic/claude-sonnet-4-5-20250929"
33
mini-extra config set ANTHROPIC_API_KEY "sk-..."
34
```
35
 
36
or to unset a key:
37
 
38
```bash
39
mini-extra config unset KEY
40
# e.g.,
41
mini-extra config unset ANTHROPIC_API_KEY
42
```
43
 
44
You can also edit the `.env` file directly and we provide a helper function for that:
45
 
46
```bash
47
mini-extra config edit
48
```
49
 
50
To set environment variables (recommended for temporary experimentation or API keys):
51
 
52
```bash
53
export KEY="value"
54
# windows:
55
setx KEY "value"
56
```
57
 
58
## Models, keys, costs
59
 
60
!!! tip "See also"
61
 
62
    Read the [quickstart guide](../quickstart.md) first—it already covers most of this.
63
 
64
```bash
65
# Default model name
66
# (default: not set)
67
MSWEA_MODEL_NAME="anthropic/claude-sonnet-4-5-20250929"
68
```
69
 
70
To ignore errors from cost tracking checks (for example for free models), set:
71
 
72
```bash
73
# CAREFUL: This can lead to unmanaged spending!
74
MSWEA_COST_TRACKING="ignore_errors"
75
```
76
 
77
To register extra models to litellm (see [local models](../models/local_models.md) for more details), you can either specify the path in the agent file, or set
78
 
79
```bash
80
LITELLM_MODEL_REGISTRY_PATH="/path/to/your/model/registry.json"
81
```
82
 
83
Global cost limits:
84
 
85
```bash
86
# Global limit on number of model calls (0 = no limit)
87
# (default: 0)
88
MSWEA_GLOBAL_CALL_LIMIT="100"
89
 
90
# Global cost limit in dollars (0 = no limit)
91
# (default: 0)
92
MSWEA_GLOBAL_COST_LIMIT="10.00"
93
 
94
# Number of retry attempts for model API calls
95
# (default: 10)
96
MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT="10"
97
```
98
 
99
## Default config files
100
 
101
```bash
102
# Set a custom directory for agent config files in addition to the builtin ones
103
# This allows to specify them by names
104
MSWEA_CONFIG_DIR="/path/to/your/own/config/dir"
105
 
106
# Config path for mini run script
107
# (default: package_dir / "config" / "mini.yaml")
108
MSWEA_MINI_CONFIG_PATH="/path/to/your/own/config"
109
 
110
# Custom style path for trajectory inspector
111
# (default: package_dir / "config" / "inspector.tcss")
112
MSWEA_INSPECTOR_STYLE_PATH="/path/to/your/inspector/style.tcss"
113
```
114
 
115
### Settings for environments
116
 
117
```bash
118
# Path/name to the singularity/apptainer executable
119
# (default: "singularity")
120
MSWEA_SINGULARITY_EXECUTABLE="singularity"
121
 
122
# Path/name to the docker executable
123
# (default: "docker")
124
MSWEA_DOCKER_EXECUTABLE="docker"
125
 
126
# Path/name to the bubblewrap executable
127
# (default: "bwrap")
128
MSWEA_BUBBLEWRAP_EXECUTABLE="bwrap"
129
```
130
 
131
## Default run files
132
 
133
```bash
134
# Default run script entry point for the main CLI
135
# (default: "minisweagent.run.mini")
136
MSWEA_DEFAULT_RUN="minisweagent.run.mini"
137
```
138
 
139
{% include-markdown "_footer.md" %}
140
 
140 lines