Skip to content

Commit 3d1d982

Browse files
timvisher-ddMatthewZMD
authored andcommitted
feat: support environment variables for default AI model configurations
1 parent 16c971f commit 3d1d982

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

aidermacs-models.el

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
"Model selection for Aidermacs."
4343
:group 'aidermacs)
4444

45-
(defcustom aidermacs-default-model "sonnet"
46-
"Default AI model to use for aidermacs sessions when not in Architect mode."
45+
(defcustom aidermacs-default-model (or (getenv "AIDER_MODEL") "sonnet")
46+
"Default AI model to use for aidermacs sessions when not in Architect mode.
47+
Respects the `AIDER_MODEL' environment variable if set."
4748
:type 'string)
4849

4950
(defcustom aidermacs-architect-model nil
@@ -52,15 +53,17 @@ If nil, uses the value of `aidermacs-default-model'."
5253
:type '(choice (const :tag "Use default model" nil)
5354
(string :tag "Specific model")))
5455

55-
(defcustom aidermacs-editor-model nil
56+
(defcustom aidermacs-editor-model (getenv "AIDER_EDITOR_MODEL")
5657
"Default editing AI model to use for architect mode.
57-
If nil, uses the value of `aidermacs-default-model'."
58+
If nil, uses the value of `aidermacs-default-model'.
59+
Respects the `AIDER_EDITOR_MODEL' environment variable if set."
5860
:type '(choice (const :tag "Use default model" nil)
5961
(string :tag "Specific model")))
6062

61-
(defcustom aidermacs-weak-model nil
63+
(defcustom aidermacs-weak-model (getenv "AIDER_WEAK_MODEL")
6264
"Default weak AI model to use.
63-
If nil, uses a model automatically selected based on the default model."
65+
If nil, uses a model automatically selected based on the default model.
66+
Respects the `AIDER_WEAK_MODEL' environment variable if set."
6467
:type '(choice (const :tag "Use default model" nil)
6568
(string :tag "Specific model")))
6669

0 commit comments

Comments
 (0)