Show Cost Indicators for GitLab Models

What does this MR do and why?

Show model cost indicators for GitLab vendored models in the model selector when the agentic_chat_ga feature flag is enabled. This change impacts user, namespace and instance-level model selection where GitLab vendored models are used. Self-hosted models are not impacted and do not use cost indicators.

Note: Cost indicator values come from the AIGW service, defined in models.yml (example)

References

Related: https://gitlab.com/gitlab-org/gitlab/-/work_items/566740

Screenshots or screen recordings

End-user model selection (.com & self-managed)

Before After
Screenshot_2025-12-08_at_3.09.18_pm Screenshot_2025-12-08_at_3.07.43_pm

Namespace model selection (.com)

Before After
Screenshot_2025-12-08_at_3.21.47_pm Screenshot_2025-12-08_at_3.21.16_pm

Instance-level model selection (self-managed)

Before After After (Screen Recording with self-hosted models)
Screenshot_2025-12-08_at_3.10.19_pm Screenshot_2025-12-08_at_3.10.42_pm Screen_Recording_2025-12-08_at_3.15.39_pm

"Add Self-hosted" model selector (shared component, but no changes)

Before After
Screenshot_2025-11-21_at_4.49.52_pm Screenshot_2025-11-21_at_4.42.11_pm

How to set up and validate locally

Set-up pre-requisites

  • An active online cloud or legacy, Ultimate license.
  • Set up AI Gateway (Easiest way is to through GDK)
  • Enable the necessary feature flags agentic_chat_ga, duo_agent_platform_model_selection, self_hosted_agent_platform by visiting http://gdk.test:3000/rails/features/

To validate user-level and namespace-level model selectors:

  1. Start GDK in saas mode GITLAB_SIMULATE_SAAS=1 gdk start
  2. Run the Duo setup rake task in SaaS mode GITLAB_SIMULATE_SAAS=1 bundle exec 'rake gitlab:duo:setup' to seed instance with a Duo test group (it will be called gitlab-duo).
  3. Navigate to the Model Selection page of the group. The URL should look like this: http://gdk.test:3000/groups/<name of Duo group just created>/-/settings/gitlab_duo/model_selection. If you have any existing Ai::SelfHostedModel records in the DB then you will also need to change this line to false.
  4. To validate the namespace-level model selector, open the model selector of any feature setting and ensure it looks like the screengrabs and functions as expected
  5. To validate the user-level model selector, stay on the same page as step 5, click on the Duo Chat icon on the upper right corner of the screen (under your avatar) to open the chat window. Make sure the "Agentic mode" toggle is enabled. Open the user model selector and ensure it looks like the screengrabs and functions as expected

To validate instance-level model selector:

  1. Start GDK in self-managed mode GITLAB_SIMULATE_SAAS=0 gdk start
  2. Run the Duo setup rake task in SM mode GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup'
  3. Navigate to the instance-level model selection page. The URL is: http://gdk.test:3000/admin/gitlab_duo/self_hosted.
  4. Open up the model selector of any feature setting and ensure it looks like the screengrabs and also functions as expected.

To validate no regression in the "Add self-hosted model" model selector:

  1. From the http://gdk.test:3000/admin/gitlab_duo/self_hosted` page you visited above, click the Add self-hosted model button on the upper right-hand side of the screen.
  2. Open the "Model family" dropdown and validate there are no changes

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Julie Huang

Merge request reports

Loading