doc/development/ai_features/availability.md
This document explains how GitLab Duo features are controlled, who can access them, and how they are configured across GitLab deployments.
Various settings control when and how users can interact with GitLab Duo features. The end-user documentation explains this from a user perspective. This document explains the implementation logic from a developer perspective and includes technical details.
On GitLab.com, the governing_namespace method
determines the authoritative namespace for GitLab Duo usage-based billing and governance in a user's request context.
Governing namespace is not applicable to self-managed or dedicated instances.
The governing_namespace method follows this decision process:
scope (namespace context) is provided and the user is a member
of that namespace's top-level group or any subgroups or projects within the top-level group, use the top-level group.
Otherwise, use the user's selected default GitLab Duo namespace.nil if no suitable namespace can be determined.# Without a scope: uses the user's default GitLab Duo namespace
governing_ns = current_user.governing_namespace
# => Returns the user's default namespace or inferred namespace
# With a scope: prefers the scope's top-level group if the user is a member
governing_ns = current_user.governing_namespace(project)
# => Returns the project's top-level group if the user is a member. Otherwise, returns the default namespace
# Alias for clarity in billing contexts
billable_ns = current_user.billable_duo_namespace(resource)
In the UI, the "GitLab Duo Enterprise availability" setting shows 3 options:
These UI options map directly to the following database states:
| UI Option | duo_features_enabled | lock_duo_features_enabled |
|---|---|---|
| On by default | true | false |
| Off by default | false | false |
| Always off | false | true |
The duo_features_enabled setting is a cascading setting, which impacts how GitLab Duo features are propagated through the hierarchy.
This cascading behavior means:
trueduo_features_enabled: false can have a group with duo_features_enabled: trueduo_features_enabled: true can have a subgroup with duo_features_enabled: falsetrue at a parent level, all child entities are reset to truefalse at a parent level, all child entities are reset to falselock_duo_features_enabled: true (displayed as "Always off" in the UI)
Users with a paid GitLab Duo license (GitLab Duo Pro or GitLab Duo Enterprise) can access Chat and Code Suggestions in both the Web UI and IDE for:
Resources that cannot disable GitLab Duo features:
Resources where GitLab Duo features are enabled:
In the IDE environment specifically, users with a GitLab Duo license can always use Chat and Code Suggestions for:
On GitLab.com, a GitLab Duo license is associated with the individual user to whom it is assigned, not the group that assigned the seat. User accounts on GitLab.com are independent entities that belong to the entire GitLab instance rather than being "owned" by any specific group.
Disabling GitLab Duo features (duo_features_enabled: false) in a group:
If a user has a GitLab Duo license but belongs to a group where GitLab Duo features are set to "Always off", they can still:
This flow diagram shows how GitLab Duo feature availability works on GitLab.com:
flowchart TD
A[Start] --> B{Member of Premium/Ultimate group?}
B -->|No| C[Cannot use GitLab Duo]
B -->|Yes| D{Has GitLab Duo Pro/Enterprise license?}
D -->|No| E[Cannot use GitLab Duo]
D -->|Yes| F{Using GitLab Duo with specific
group/project resource?}
F -->|No| G[Can use GitLab Duo]
F -->|Yes| H{Group/Project has
GitLab Duo features enabled?}
H -->|No| I[Cannot use GitLab Duo with
this resource]
H -->|Yes| J[Can use GitLab Duo with
this resource]
GitLab offers three tiers of AI functionality:
With the introduction of GitLab Duo Core, a new setting is available for top-level Premium and Ultimate groups.
This setting allows group owners to control GitLab Duo Core availability:
| Feature | GitLab Duo Core | GitLab Duo Pro | GitLab Duo Enterprise |
|---|---|---|---|
| Chat | Limited to IDE | Full functionality | Full functionality |
| Code Suggestions | Available in IDE and Web IDE | Available in IDE and Web IDE | Available in IDE and Web IDE |
| Additional AI features | Not available | Some Available | All Available |
This flow diagram shows how GitLab Duo feature availability works on GitLab.com with GitLab Duo Core settings taken into consideration:
flowchart TD
A[Start] --> B{Member of Premium/Ultimate group?}
B -->|No| C[Cannot use GitLab Duo]
B -->|Yes| D{Has GitLab Duo Pro/Enterprise license?}
D -->|Yes| E[Can use GitLab Duo]
D -->|No| F{Any Premium/Ultimate group has
GitLab Duo Core enabled?}
F -->|No| G[Cannot use GitLab Duo]
F -->|Yes| H{Using Chat or
Code Suggestions in IDE?}
H -->|No| I[Cannot use GitLab Duo]
H -->|Yes| J{Using GitLab Duo with specific
group/project resource?}
J -->|No| K[Can use GitLab Duo]
J -->|Yes| L{Group/Project has
GitLab Duo features enabled?}
L -->|Yes| M[Can use GitLab Duo with
this resource]
L -->|No| N[Cannot use GitLab Duo with
this resource]
The following settings pages are available for configuring GitLab Duo on GitLab.com:
/admin/gitlab_duo
/groups/$GROUP_FULL_PATH/-/settings/gitlab_duo
/groups/$GROUP_PATH/-/settings/gitlab_duo/configuration
/groups/$GROUP_FULL_PATH/-/edit
/$PROJECT_FULL_PATH/edit
For Premium and Ultimate GitLab Self-Managed and Dedicated instances, the feature availability logic follows similar patterns as GitLab.com with one key difference:
Instance administrators have the ability to set GitLab Duo features to "Always off" at the instance level. When configured this way, all GitLab Duo features are disabled for all users across the entire instance, regardless of individual license assignments.
flowchart TD
A[Start] --> B{Instance has GitLab Duo features
set to 'Always off'?}
B -->|Yes| C[Cannot use GitLab Duo]
B -->|No| D{Has GitLab Duo Pro/Enterprise license?}
D -->|No| E[Cannot use GitLab Duo]
D -->|Yes| F{Using GitLab Duo with specific
group/project resource?}
F -->|No| G[Can use GitLab Duo]
F -->|Yes| H{Group/Project has
GitLab Duo features enabled?}
H -->|No| I[Cannot use GitLab Duo with
this resource]
H -->|Yes| J[Can use GitLab Duo with
this resource]
For GitLab Self-Managed and Dedicated instances, GitLab Duo Core is controlled through an instance-level setting. This setting is available to all Premium and Ultimate instances.
Instance administrators can:
The same feature differentiation between GitLab Duo Core, GitLab Duo Pro, and GitLab Duo Enterprise applies to self-managed and dedicated instances:
Self-managed instances have additional configuration options for integrating with self-hosted AI models and controlling feature behavior.
This flow diagram shows how GitLab Duo feature availability works on non-GitLab.com instances with GitLab Duo Core settings taken into consideration:
flowchart TD
A[Start] --> B{Instance has GitLab Duo features
set to 'Always off'?}
B -->|Yes| C[Cannot use GitLab Duo]
B -->|No| D{Has GitLab Duo Pro/Enterprise license?}
D -->|Yes| E[Can use GitLab Duo]
D -->|No| F{Instance has GitLab Duo Core enabled?}
F -->|No| G[Cannot use GitLab Duo]
F -->|Yes| H{Using Chat or
Code Suggestions in IDE?}
H -->|No| I[Cannot use GitLab Duo]
H -->|Yes| J{Using GitLab Duo with specific
group/project resource?}
J -->|No| K[Can use GitLab Duo]
J -->|Yes| L{Group/Project has
GitLab Duo features enabled?}
L -->|Yes| M[Can use GitLab Duo with
this resource]
L -->|No| N[Cannot use GitLab Duo with
this resource]
The following settings pages are available for configuring GitLab Duo on self-managed and dedicated instances:
/admin/gitlab_duo
/admin/gitlab_duo/configuration
/admin/gitlab_duo/model_selection
/groups/$GROUP_FULL_PATH/-/edit
/$PROJECT_FULL_PATH/edit