feat: Add config flag to filter provider models #580
+14
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When using Azure OpenAI as a model provider, all potentially available models from this service are shown, but that likely doesn't correspond to the deployed models in a workspace of this service--we have 4 deployed models. You of course get an error if you try to call a model that is not deployed.
Solution
The fix in this PR adds a flag that allows filtering to only the models defined in the config file.
Example
Here, no models will be shown for Copilot despite a Github token being found, and only 3 models of 4 deployed are shown, with the rest found and added to the database being hidden.
Alternatively, this could just be default behavior omitting the need for such a flag.
It would also be nice to query the available models to prevent the need to define models in the config., but the included solution is easy enough and allows some additional flexibility about which models to show.