doc/user/gitlab_duo/model_selection.md
{{< details >}}
{{< /details >}}
Every GitLab Duo feature uses a default model. GitLab might update default models to optimize performance. You can select a different model for a feature, which persists until you change it.
The following table lists the default model for each GitLab Duo feature.
| Feature | Model |
|---|---|
| Code Suggestions | |
| Code Generation | Claude Sonnet 4 Vertex |
| Code Completion | Codestral 25.08 Fireworks |
| GitLab Duo Chat | |
| General Chat | Claude Sonnet 4.5 Vertex |
| Code Explanation | Claude Sonnet 4 |
| Test Generation | Claude Sonnet 4.5 Vertex |
| Refactor Code | Claude Sonnet 4.5 Vertex |
| Fix Code | Claude Sonnet 4.5 Vertex |
| Root Cause Analysis | Claude Sonnet 4 Vertex |
| GitLab Duo for merge requests | |
| Merge Commit Message Generation | Claude Sonnet 4 Vertex |
| Merge Request Summary | Claude Sonnet 4 Vertex |
| Code Review Summary | Claude Sonnet 4 Vertex |
| Code Review | Claude Sonnet 4.6 Vertex |
| Other GitLab Duo features | |
| Vulnerability Explanation | Claude Sonnet 4.5 Vertex |
| Vulnerability Resolution | Claude Sonnet 4.5 |
| Discussion Summary | Claude Sonnet 4.5 Vertex |
| GitLab Duo for CLI | Claude Haiku 4.5 |
The following tables list the models you can select for each feature.
| Model | Code Generation | Code Completion |
|---|---|---|
| Claude Sonnet 4 | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4 Vertex | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4 Bedrock | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4.5 | {{< yes >}} | {{< yes >}} |
| Codestral 25.01 Fireworks | {{< no >}} | {{< yes >}} |
| Codestral 25.08 Fireworks | {{< no >}} | {{< yes >}} |
| Codestral 25.08 Vertex | {{< no >}} | {{< yes >}} |
| Gemini 2.5 Flash Vertex | {{< yes >}} | {{< no >}} |
| Model | General Chat | Code Explanation | Test Generation | Refactor Code | Fix Code | Root Cause Analysis |
|---|---|---|---|---|---|---|
| Claude Haiku 4.5 | {{< yes >}} | {{< no >}} | {{< no >}} | |||
| Claude Sonnet 3 | {{< no >}} | {{< no >}} | {{< yes >}} | |||
| Claude Sonnet 4 | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4 Vertex | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4.5 | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4.5 Vertex | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Model | Merge Commit Message Generation | Merge Request Summary | Code Review Summary | Code Review |
|---|---|---|---|---|
| Claude Sonnet 4 | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4 Vertex | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4.5 | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Model | Vulnerability Explanation | Vulnerability Resolution | GitLab Duo for CLI | Discussion Summary |
|---|---|---|---|---|
| Claude Haiku 3 | {{< yes >}} | {{< no >}} | {{< yes >}} | {{< no >}} |
| Claude Haiku 4.5 | {{< no >}} | {{< yes >}} | {{< no >}} | |
| Claude Sonnet 4 | {{< yes >}} | {{< yes >}} | {{< yes >}} | |
| Claude Sonnet 4 Vertex | {{< yes >}} | {{< yes >}} | {{< yes >}} | |
| Claude Sonnet 4.5 | {{< yes >}} | {{< yes >}} | {{< yes >}} | {{< yes >}} |
| Claude Sonnet 4.5 Vertex | {{< yes >}} | {{< yes >}} |
{{< details >}}
{{< /details >}}
{{< history >}}
ai_model_switching. Disabled by default.ai_model_switching enabled.ai_model_switching removed in GitLab 18.7.{{< /history >}}
You can select a model for a feature in a top-level group. The model that you select applies to that feature for all child groups and projects.
Prerequisites:
To select a model for a feature:
When selecting models other than the default, you might encounter the following issues.
If you are using the default GitLab model for a GitLab Duo AI-native feature, GitLab might change the default model without notifying the user to maintain optimal performance and reliability.
If you have selected a specific model for a GitLab Duo AI-native feature, and that model is not available, there is no automatic fallback. The feature that uses this model is unavailable.
When using a GitLab Duo feature with a selected model, you might get an error that states that you have not selected a default GitLab Duo namespace. For example, on:
Error 422: I'm sorry, you have not selected a default GitLab Duo namespace. Please go to GitLab and in user Preferences - Behavior, select a default namespace for GitLab Duo.Error G3002: I'm sorry, you have not selected a default GitLab Duo namespace. Please go to GitLab and in user Preferences - Behavior, select a default namespace for GitLab Duo.This issue occurs when you belong to multiple GitLab Duo namespaces, but have not chosen one as your default namespace.
To resolve this, set a default GitLab Duo namespace.