From cc18441435c682732a50de01cffb5999decc1e22 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 19 Nov 2024 12:15:11 -0800 Subject: [PATCH] refactor: Update model settings name from "aider/extra" to "aider/extra_params" --- aider/models.py | 2 +- aider/website/docs/config/adv-model-settings.md | 14 ++++++++++++-- tests/basic/test_models.py | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/aider/models.py b/aider/models.py index 64ec5d216..b5cd9cd9f 100644 --- a/aider/models.py +++ b/aider/models.py @@ -803,7 +803,7 @@ class Model(ModelSettings): # Find the extra settings self.extra_model_settings = next( - (ms for ms in MODEL_SETTINGS if ms.name == "aider/extra"), None + (ms for ms in MODEL_SETTINGS if ms.name == "aider/extra_params"), None ) self.info = self.get_model_info(model) diff --git a/aider/website/docs/config/adv-model-settings.md b/aider/website/docs/config/adv-model-settings.md index 9fe7fe22e..7947ea758 100644 --- a/aider/website/docs/config/adv-model-settings.md +++ b/aider/website/docs/config/adv-model-settings.md @@ -70,7 +70,14 @@ Files loaded last will take priority. The yaml file should be a list of dictionary objects for each model. -You can use the special model name `aider/extra_params` to define settings that will be applied to all models. For example: + +### Global extra params + +You can use the special model name `aider/extra_params` to define +`extra_params` that will be passed to `litellm.completion()` for all models. +Only the `extra_params` dict is used from this special model name. + +For example: ```yaml - name: aider/extra_params @@ -80,7 +87,10 @@ You can use the special model name `aider/extra_params` to define settings that max_tokens: 8192 ``` -These settings will be merged with any model-specific settings, with the model-specific settings taking precedence for any conflicts. +These settings will be merged with any model-specific settings, with the +`aider/extra_params` settings taking precedence for any direct conflicts. + +### Example model settings Below are all the pre-configured model settings to give a sense for the settings which are supported. diff --git a/tests/basic/test_models.py b/tests/basic/test_models.py index 7145a0fa8..fb91ef218 100644 --- a/tests/basic/test_models.py +++ b/tests/basic/test_models.py @@ -100,7 +100,7 @@ class TestModels(unittest.TestCase): # Create temporary YAML file with test settings test_settings = [ { - "name": "aider/extra", + "name": "aider/extra_params", "extra_params": { "extra_headers": {"Foo": "bar"}, "some_param": "some value",