Private
Public Access
1
0

Add support for per-model configuration

A provider's models may now be provided in the config as a simple
string, or as a mapping with at least a `name` key.

This is a valid configuration:

```yaml
models:
- name: model-a
  reasoning: true
- model-b
```

This opens the door to providing model-specific configuration, e.g. an
overridden max tokens count, or whether the model is a 'reasoning'
model.
This commit is contained in:
2025-03-29 23:25:01 +00:00
parent 43f8de89c5
commit 7c3a2c3cb9
3 changed files with 117 additions and 33 deletions

View File

@@ -103,10 +103,10 @@ func (m *Model) getModelOptions() []list.OptionGroup {
group := list.OptionGroup{
Name: providerLabel,
}
for _, model := range p.Models {
for _, model := range p.Models() {
group.Options = append(group.Options, list.Option{
Label: model,
Value: modelOpt{provider, model},
Label: model.Name,
Value: modelOpt{provider, model.Name},
})
}
modelOpts = append(modelOpts, group)