refactor: Update model settings name from "aider/extra" to "aider/extra_params"

This commit is contained in:
Paul Gauthier 2024-11-19 12:15:11 -08:00 committed by Paul Gauthier (aider)
parent 7e787d93e6
commit cc18441435
3 changed files with 14 additions and 4 deletions

View file

@ -803,7 +803,7 @@ class Model(ModelSettings):
# Find the extra settings # Find the extra settings
self.extra_model_settings = next( 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) self.info = self.get_model_info(model)

View file

@ -70,7 +70,14 @@ Files loaded last will take priority.
The yaml file should be a list of dictionary objects for each model. 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 ```yaml
- name: aider/extra_params - 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 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. Below are all the pre-configured model settings to give a sense for the settings which are supported.

View file

@ -100,7 +100,7 @@ class TestModels(unittest.TestCase):
# Create temporary YAML file with test settings # Create temporary YAML file with test settings
test_settings = [ test_settings = [
{ {
"name": "aider/extra", "name": "aider/extra_params",
"extra_params": { "extra_params": {
"extra_headers": {"Foo": "bar"}, "extra_headers": {"Foo": "bar"},
"some_param": "some value", "some_param": "some value",