Configuration option to switch model for Code generations/completions
What does this MR do and why?
Related issue: Configuration option to select model (#454323 - closed). Draft MR with the full functionality: Draft: Instance-Level Self-Hosted Model serving... (!151505 - closed)
This MR introduces UI for switching model for Code Generations and Code Completions.
Prerequisite
A customer should first configure a self-hosted model:
This MR
Screen_Recording_2024-05-08_at_15.08.50
How to test it
- Checkout this branch
 - Make sure that the feature is available for your environment: https://gitlab.com/gitlab-org/gitlab/-/blob/f5b475469a8c4108f5a04d4d86c07cc9bae6c600/ee/app/controllers/admin/ai/feature_settings_controller.rb#L60-62
 
- Feature flag 
ai_custom_modelis enabled (Feature.enable(:ai_custom_model)in Rails console) - It's not Saas instance, i.e Saas is not simulated: https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance
 - Your GDK has Ultimate license
 - 
self_managed_code_suggestionsfeature flag is enabled 
- This MR requires 
Ai::SelfHostedModelrecord to be created in the database. The table/model exists on the target branch, but the UI doesn't yet exists there: Front-end iteration for self-deployed model con... (!152107 - merged). Please, create a record in Rails console:::Ai::SelfHostedModel.create!(model: 0, endpoint: 'http://127.0.0.1:11434/v1', name: 'mistral-7B', api_token: 'token') 
Edited  by Igor Drozdov