You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,8 +203,13 @@ This approach keeps sensitive information out of your dotfiles while still makin
203
203
204
204
### Default Model Selection
205
205
206
-
You can customize the default AI model used by Aidermacs by setting the `aidermacs-default-model` variable:
206
+
You can customize the default AI model used by Aidermacs. The model is determined in the following order of priority:
207
207
208
+
1. The value of the Emacs variable `aidermacs-default-model` if you have set it (e.g., via `setq`).
209
+
2. The value of the `AIDER_MODEL` environment variable, if set.
210
+
3. A built-in default value (e.g., `"sonnet"`).
211
+
212
+
To set it in Emacs:
208
213
```emacs-lisp
209
214
(setq aidermacs-default-model "sonnet")
210
215
```
@@ -246,7 +251,7 @@ To start new sessions in Architect mode by default, set `aidermacs-default-chat-
246
251
247
252
`architect` mode will default to using `aidermacs-default-model`. You may also configure the `aidermacs-architect-model` variable to specify the model to use for the Architect role if you prefer a different main model when using `architect` mode.
248
253
249
-
By default, the `aidermacs-editor-model` is the same as `aidermacs-default-model`. You only need to set `aidermacs-editor-model` if you want to use a different model for the Editor role.
254
+
By default, the `aidermacs-editor-model` is the same as `aidermacs-default-model`. You only need to set `aidermacs-editor-model` if you want to use a different model for the Editor role. This variable also respects the `AIDER_EDITOR_MODEL` environment variable, following the same priority as `aidermacs-default-model`.
250
255
251
256
```emacs-lisp
252
257
(setq aidermacs-default-chat-mode 'architect)
@@ -280,7 +285,7 @@ Models will reflect changes to `aidermacs-default-model` unless they've been exp
280
285
281
286
### Customize Weak Model
282
287
283
-
The Weak model is used for commit messages (if you have `aidermacs-auto-commits` set to `t`) and chat history summarization (default depends on –model). You can customize it using
288
+
The Weak model is used for commit messages (if you have `aidermacs-auto-commits` set to `t`) and chat history summarization (default depends on –model). You can customize it using the `aidermacs-weak-model` variable, which also respects the `AIDER_WEAK_MODEL` environment variable.
*Note: You can also rely on Aider's default behavior of automatically searching for `.aider.conf.yml` in the home directory, project root, or current directory, in that order. In this case, you do not need to set `aidermacs-config-file` or include `--config` in `aidermacs-extra-args`.*
478
483
479
-
* **Important:** When using a config file, all other Aidermacs configuration variables supplying an argument option (e.g., `aidermacs-default-model`, `aidermacs-architect-model`, `aidermacs-use-architect-mode`) are **IGNORED**. Aider will *only* use the settings specified in your `.aider.conf.yml` file. Do not attempt to combine these Emacs settings with a config file, as the results will be unpredictable.
480
-
* **Precedence:** Settings in `.aider.conf.yml` *always* take precedence when a config file is explicitly specified.
481
-
* **Avoid Conflicts:** When using a config file, *do not* include model-related arguments (like `--model`, `--architect`, etc.) in `aidermacs-extra-args`. Configure *all* settings within your `.aider.conf.yml` file.
484
+
* **Important: Configuration Precedence**
485
+
486
+
When an Aidermacs session starts, it determines which settings to use based on the following hierarchy:
487
+
488
+
1. **Aider Configuration File (`.aider.conf.yml`):** If a config file is found (either in a default location or specified via `aidermacs-config-file` or `aidermacs-extra-args`), it takes **highest priority**. Aidermacs will **ignore** its own Emacs variables (like `aidermacs-default-model`) and let the `aider` tool manage settings directly from the file. The precedence is then determined by `aider` itself (where command-line arguments override environment variables, which override the config file).
489
+
490
+
2. **Emacs Configuration (if no config file is used):** If no `.aider.conf.yml` is present, Aidermacs will build the command-line arguments for `aider`. The values it uses are determined by this order of priority:
491
+
a. **Emacs Variables (Highest):** Values you set in your `init.el` (e.g., `(setq aidermacs-default-model "...")`).
492
+
b. **Environment Variables:** If an Emacs variable is not set, its value is taken from the corresponding environment variable (e.g., `AIDER_MODEL`).
493
+
c. **Built-in Defaults (Lowest):** If neither of the above are set, a hardcoded default is used.
494
+
495
+
**To avoid conflicts:** When using a `.aider.conf.yml` file, you should define all your settings within that file. Do not set variables like `aidermacs-default-model` in Emacs or pass arguments like `--model` in `aidermacs-extra-args`, as they will be ignored and can cause confusion.
0 commit comments