Model Switching - Model routing for offered models
(The current issue is subject to change) Model Swithcing users will send request to the AIGW with their model selection for the specific feature/sub-feature they are using.
Build the API endpoint to handle this accordingly.
Proposal
We can use part of the Self-hosted models logic with a twist for this.
If a request to the AIGW contains the gitlab provider and the model identifier in the model_params section of its body as in the example below:
model_params: {
'provider': 'gitlab',
'id': 'claude_3_7_sonnet'
}
We can conclude that its a should be a model offered for switching by considering the offered model metadata.
- name: "Claude 3.7 sonnet"
identifier: offered_models/bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0
api-key: some-api-key
endpoint: https://example_models.com/v1
release_state: GA
features:
- duo-chat
- code-generation
- name: ETC...
If the model is offered: In that case we can retrieved the metadata stored here base on the id and inject those in the existing instances ModelMetadata class in the right places and let Self-hosted models logic do its magic from here.
If the model is offered is in a TERMINATED relase state: route request to system default model for feature. (Ignore model params)
If the model is not offered: Send a 404
If the offered is not compactible with the feature: Send a 404