- Supported languages
- Supported editor extensions
- Code Suggestions data usage
- Progressive enhancement
- Known limitations
- Introduced support for Google Vertex AI Codey APIs in GitLab 16.1.
- Removed support for GitLab native model in GitLab 16.2.
Write code more efficiently by using generative AI to suggest code while you’re developing.
GitLab Duo Code Suggestions are available:
- On self-managed and SaaS.
- In VS Code, Microsoft Visual Studio, JetBrains IDEs, and Neovim. You must have the corresponding GitLab extension installed.
- In the GitLab WebIDE.
The best results from Code Suggestions are expected for languages the Google Vertex AI Codey APIs directly support:
- Google SQL
Code Suggestions includes Google Vertex AI Codey APIs support for the following infrastructure as code interfaces:
- Google Cloud CLI
- Kubernetes Resource Model (KRM)
Suggestion quality for other languages and using natural language code comments to request completions may not yet result in high-quality suggestions.
Editor support for languages is documented in the following table.
|Language||VS Code||JetBrains IDEs||Visual Studio||Neovim|
|Go||Yes||Yes (IDEA Ultimate / GoLand)||Yes||Yes|
|PHP||Yes||Yes (IDEA Ultimate)||Yes||Yes|
|Ruby||Yes||Yes (IDEA Ultimate / RubyMine)||Yes||Yes|
|Kubernetes Resource Model (KRM)||No||No||No||No|
|Terraform||Yes (Requires third-party extension providing Terraform support)||No||No|| Yes (Requires third-party extension providing the |
Code Suggestions supports a variety of popular editors including:
- VS Code, using the VS Code GitLab Workflow extension.
- GitLab WebIDE (VS Code in the Cloud), with no additional configuration.
- Microsoft Visual Studio, using the Visual Studio GitLab extension.
- JetBrains IDEs, using the GitLab plugin.
- Neovim, using the
A GitLab Language Server for Code Suggestions is also in process. This improvement should result in:
- Faster iteration and standardization of the IDE extensions.
- The ability to use Code Suggestions even when an official editor extension isn’t available.
Code Suggestions is a generative artificial intelligence (AI) model.
Your personal access token enables a secure API connection to GitLab.com. This API connection securely transmits a context window from your IDE/editor to the Code Suggestions GitLab hosted service which calls Google Vertex AI Codey APIs, and the generated suggestion is transmitted back to your IDE/editor.
For self-managed instances that have enabled Code Suggestions and SaaS accounts, we collect aggregated or de-identified first-party usage data through our Snowplow collector. This usage data includes the following metrics:
- Language the code suggestion was in (for example, Python)
- Editor being used (for example, VS Code)
- Number of suggestions shown, accepted, rejected, or that had errors
- Duration of time that a suggestion was shown
- Prompt and suffix lengths
- Model used
- Number of unique users
- Number of unique instances
Code Suggestions currently inferences against the currently opened file and has a context window of 2,048 tokens and 8,192 character limits. This limit includes content before and after the cursor, the file name, and the extension type. Learn more about Google Vertex AI code-gecko.
The maximum number of tokens that is generated in the response is default 64. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words.
Learn more about Google Vertex AI
Google Vertex AI Codey APIs are not trained on private non-public GitLab customer or user data.
Google has shared the following about the data Codey models are trained on:
Codey is our family of foundational coding models built on PaLM 2. Codey was fine-tuned on a large dataset of high quality, permissively licensed code from external sources
This feature is designed as a progressive enhancement to developer’s IDEs. Code Suggestions offer a completion if the machine learning engine can generate a recommendation. In the event of a connection issue or model inference failure, the feature gracefully degrades. Code Suggestions do not prevent you from writing code in your IDE.
Code Suggestions does not work with offline environments.
To use Code Suggestions:
- On GitLab.com, you must have an internet connection and be able to access GitLab.
- In GitLab 16.1 and later, on self-managed GitLab, you must have an internet connection.
Code Suggestions can generate low-quality, incomplete, and possibly insecure code. We strongly encourage all beta users to leverage GitLab native Code Quality Scanning and Security Scanning capabilities.
GitLab currently does not retrain Google Vertex AI Codey APIs. GitLab makes no claims to the accuracy or quality of Code Suggestions generated by Google Vertex AI Codey API. Read more about Google Vertex AI foundation model capabilities.
While in Beta, we are working on improving the accuracy of overall generated content. However, Code Suggestions may generate suggestions that are:
- Produce failed pipelines
- Insecure code
- Offensive or insensitive
We are also aware of specific situations that can produce unexpected or incoherent results including:
- Suggestions written in the middle of existing functions, or “fill in the middle.”
- Suggestions based on natural language code comments.
- Suggestions that mixed programming languages in unexpected ways.
Report issues in the feedback issue.