Add support for AI models accessible only by GitLab team members
What does this MR do and why?
This MR enables GitLab team members to access development AI models that are not exposed to external users.
Currently, all AI models configured for a group are visible to all users within that group. This prevents GitLab team members from experimenting with new or unstable models without making them available to customers.
This MR introduces team-member-only model access by:
- Adding developer-only
group_idsandselectable_modelsto model definitions - Implementing conditional model merging based on GitLab team membership
- Allowing team members in specified groups to access development models while keeping the standard model set for regular users
References
- Parent issue: ai-assist#1517
- AI Gateway API that enables the new developer fields for GitLab: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!3712 (merged)
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
The following steps require a working GitLab Development Kit (GDK) that you can access locally.
-
Set up AI Gateway in your GDK. Make sure to have this in your
env.runitfile:export FETCH_MODEL_SELECTION_DATA_FROM_LOCAL=1 -
Modify any feature in
<gdk_dir>/gitlab-ai-gateway/ai_gateway/model_selection/unit_primitives.ymlto allow certain models for team members only. For example:-
Change
duo_chat:- feature_setting: "duo_chat" unit_primitives: - "ask_build" - "ask_commit" default_model: "claude_sonnet_4_20250514_vertex" selectable_models: - "claude_sonnet_3_7_20250219" - "claude_sonnet_3_7_20250219_vertex" - "claude_sonnet_4_20250514" - "claude_sonnet_4_20250514_vertex" dev: # <------ new models available only for team members selectable_models: - "claude_sonnet_4_5_20250929" - "claude_haiku_4_5_20251001" group_ids: # <------ group IDs where these models are accessible by team members - 1000000 -
Change
duo_agent_platform:- feature_setting: "duo_agent_platform" unit_primitives: - "duo_agent_platform" default_model: "claude_sonnet_4_20250514_vertex" selectable_models: - "claude_sonnet_3_7_20250219" - "claude_sonnet_4_20250514" - "claude_sonnet_4_20250514_vertex" - "claude_sonnet_4_5_20250929_vertex" dev: # <------ new models available only for team members selectable_models: - "claude_haiku_4_5_20251001" - "gpt_5" - "gpt_5_codex" - "gpt_5_mini" group_ids: # <------ group IDs where these models are accessible by team members - 1000000
-
-
Go to GitLab repository and checkout to this MR branch:
cd <gdk_dir>/gitlab git checkout add-support-for-ai-models-accessible-only-by-gitlab-team-members -
Open
<gdk_dir>/gitlab/ee/lib/gitlab/graphql/representation/model_selection/feature_settings.rband change L72 as follows:def use_dev_overrides? #L71 return false unless true # current_user&.gitlab_team_member?Note: This step is necessary because the root user is not a GitLab team member.
-
Restart your GDK and go to the Model Selection area of the GitLab Duo group (
group ID=1000000): http://gdk.test:3000/groups/gitlab-duo/-/settings/gitlab_duo/model_selection. Then click on Configure AI Features. -
If this MR works correctly, the GitLab Duo Chat > General Chat should display the following models:
Similarly, GitLab Duo Agent Platform and the Duo Agent Chat in the right panel should look as follows:
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.



