Allow customer to use Claude Haiku model for code completion
What does this MR do and why?
Adds new feature flag use_claude_code_completion
for a customer who needs to use Anthropic for code completion as code-gecko is being deprecated and onboarding a new model for code completion will be a long process. They already have the Claude family of models approved.
See https://gitlab.com/gitlab-org/gitlab/-/issues/523902 for more details
Requires AIGW MR gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!2137 (merged)
How to set up and validate locally
Feature.enable(:use_claude_code_completion, Group.find(YOUR_USER.duo_available_namespace_ids.first))
curl -X "POST" "http://gdk.test:3000/api/v4/code_suggestions/completions" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer AUTH_TOKEN' \
-d $'{
"current_file": {
"file_name": "test.go",
"content_above_cursor": "// write a function that parses a .env file",
"content_below_cursor": "//end function"
},
"prompt_version": 2,
"intent": "completion"
}'
model.name: "claude-3-5-haiku-20241022"
in response.
curl -X "POST" "http://gdk.test:3000/api/v4/code_suggestions/direct_access" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer AUTH_TOKEN' \
-d $'{}'
Should return "message": "403 Forbidden - Direct connections are disabled"
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 #524897
Related to #523902