Resolve "Integrate Model Selection with Code Generation"
What does this MR do and why?
This MR integrates model selection with Code Generation (NOT Code completion).
Code generation requests are always passed through the monolith, so there are no concerns around "direct connection".
Testing steps:
-
gdk updateso that changes in gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!2675 (merged) land on GDK. - Install VSCode and install the GitLab workflow extension.
- Login to the GitLab workflow extension with your GDK credentials (ie, PAT of root user)
- Enable model switching globally:
Feature.enable(:ai_model_switching) - In the root group where you have enabled model switching, set
Claude Sonnet 3.7as the model for Code Generation viahttp://gdk.test:3000/groups/group-name/-/settings/gitlab_duo/model_selection
- Clone any project within this group locally, and open it in VSCode.
- Make sure that VSCode correctly associates the opened folder to a GitLab project. If it does, you should be a able to see the following details on the GitLab Workflow tab like Issues assigned to me etc.
- Create a new file named hello.py and fire a generation request like
# generate a method to print hello world
- If you tail ai gateway logs with
gdk tail gitlab-ai-gateway, you should be able to see that the generation request was powered byClaude Sonnet 3.7and that it works.
- Similarly, if we switch the model for code generation to
Claude Sonnet 3.5and execute a generation request, we can see in the logs that the request is indeed powered by Sonnet 3.5
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
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.
Related to #545065 (closed)
Edited by Manoj M J [OOO]




