Claude Sonnet 4.0 Upgrade
## Overview
Anthropic has released their new Sonnet 4.0 model. We need to upgrade all existing Sonnet integrations across GitLab Duo features.
## Features to Update
### :white_check_mark: Migration Progress Checklist
#### Generally Available Features
- [x] GitLab Duo Chat
- [x] Discussion Summary
- [x] Code Suggestions (code generation part)
- [x] Code-based Slash Commands
- [x] Merge Commit Message Generation
- [x] Root Cause Analysis
- [ ] Vulnerability Resolution
- [ ] Vulnerability Explanation
- [x] Code Review
#### Beta Features
- [x] Merge Request Summary
- [x] GitLab Duo Workflow: https://gitlab.com/gitlab-org/gitlab/-/issues/545193+
#### Experimental Features
- [x] Code Review Summary
- [x] Agentic Chat
## Required Changes
- Add model configuration file for model flexibility
- New prompt definition created to use the Claude 4.0 model.
- Feature flag created to slow rollout of correct prompt version
## Technical Details
- Model name changes required as per [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models#model-names)
- Affects both GitLab.com and self-managed instances
## Implementation Steps
1. [ ] Update model configurations in each feature
2. [ ] Update [unit_primitives.yml](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/blob/main/ai_gateway/model_selection/unit_primitives.yml) by adding the new model to every feature that will adopt it
3. [ ] Verify performance improvements
4. [ ] Deploy updates
5. [ ] Update documentation
6. [ ] Update AI catalog - https://duo-feature-list-754252.gitlab.io/
## Timeline
Priority: ASAP
## References
- [Anthropic Announcement](https://www.anthropic.com/news/claude-4)
- [Model Documentation](https://docs.anthropic.com/en/docs/about-claude/models#model-names)
- [GitLab Duo Documentation](https://docs.gitlab.com/ee/user/gitlab_duo/)
- [Model Migration docs](https://docs.gitlab.com/development/ai_features/model_migration/#expected-duration)
- [LiteLLM Model Support Issue](https://github.com/BerriAI/litellm/issues/8768)
## Proposed Solution
1. Create a new model `config_claude_4`
2. Ensure that there nothing new about the model that requires changes to our API schema references
3. Simultaneous ensure Quota usage for prod accounts are setup for rollout
4. Engage feature teams to create new prompt definitions. We can utilize the .update_script I wrote in the AI gateway for teams to bump the version.
GitLab Duo Feature Status Table
# GitLab Duo Feature Status Table
_As of June 17, 2025_
<table>
<tr>
<th>Feature</th>
<th>Current Status</th>
<th>Timeline</th>
<th>ETA</th>
<th>
**Issue**
</th>
</tr>
<tr>
<td>
**Duo Chat**
</td>
<td>
:white_check_mark:
</td>
<td>
Enabling the Duo ReAct Agent feature flag for internal users June 3rd
All Duo Chat tools enabled Jun 10th
</td>
<td>Jun 6th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545491
</td>
</tr>
<tr>
<td>
**Code Generation**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-16.</td>
<td>June 17th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545489
</td>
</tr>
<tr>
<td>
**Code-based Slash Commands**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-16.</td>
<td>June 17th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545490
</td>
</tr>
<tr>
<td>
**Merge Request Summary**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-18</td>
<td>June 18th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545504
</td>
</tr>
<tr>
<td>
**Duo Code Review**
</td>
<td>
MRs created: [Rails](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/192920) and [AIGW](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/merge_requests/2640)
</td>
<td>Likely waiting until after Duo Code Review GA to enable FF. Do not want to impact the GA timeline.</td>
<td>18.2</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545502
</td>
</tr>
<tr>
<td>
**Code Review Summary**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-18</td>
<td>June 18th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545693
</td>
</tr>
<tr>
<td>
**Merge Commit Message Generation**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-18</td>
<td>June 18th</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545695
</td>
</tr>
<tr>
<td>
**Explain Vulnerability**
</td>
<td></td>
<td></td>
<td></td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545697
</td>
</tr>
<tr>
<td>
**Vulnerability Resolution**
</td>
<td>Planning</td>
<td>
Requires quality test suite run by ~"group::static analysis". Currently looking at 18.3 https://gitlab.com/gitlab-org/gitlab/-/issues/545117#note_2531634454
</td>
<td></td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545698
</td>
</tr>
<tr>
<td>
**Root Cause Analysis**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-07-01</td>
<td>
%"18.2"
</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545699
</td>
</tr>
<tr>
<td>
**Duo Workflow**
</td>
<td>
:white_check_mark:
</td>
<td>Feature flag enabled globally - 2025-06-12</td>
<td>2025/06/12</td>
<td>
https://gitlab.com/gitlab-org/gitlab/-/issues/545700
</td>
</tr>
</table>
issue