Skip to content

Commit 7719001

Browse files
timvisher-ddMatthewZMD
authored andcommitted
docs: clarify model selection and config file precedence in README.md
1 parent 3d1d982 commit 7719001

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,13 @@ This approach keeps sensitive information out of your dotfiles while still makin
203203

204204
### Default Model Selection
205205

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:
207207

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:
208213
```emacs-lisp
209214
(setq aidermacs-default-model "sonnet")
210215
```
@@ -246,7 +251,7 @@ To start new sessions in Architect mode by default, set `aidermacs-default-chat-
246251

247252
`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.
248253

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`.
250255

251256
```emacs-lisp
252257
(setq aidermacs-default-chat-mode 'architect)
@@ -280,7 +285,7 @@ Models will reflect changes to `aidermacs-default-model` unless they've been exp
280285

281286
### Customize Weak Model
282287

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.
284289

285290
```emacs-lisp
286291
;; default to nil
@@ -476,9 +481,18 @@ Aidermacs supports project-specific configurations via `.aider.conf.yml` files.
476481
477482
*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`.*
478483
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.
482496
483497
### Claude 3.7 Sonnet Thinking Tokens
484498

0 commit comments

Comments
 (0)