Code Suggestions

This feature is in Beta. Beta users should read about the known limitations. We look forward to hearing your feedback.

Write code more efficiently by using generative AI to suggest code while you’re developing.

Code Suggestions supports two distinct types of interactions:

  • Code Completion, which suggests completions the current line you are typing. These suggestions are usually low latency.
  • Code Generation, which generates code based on a natural language code comment block. Generating code can exceed multiple seconds.

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.

During Beta, usage of Code Suggestions is governed by the GitLab Testing Agreement. Learn about data usage when using Code Suggestions. As Code Suggestions matures to General Availibility it will be governed by our AI Functionality Terms.

Use Code Suggestions


To use Code Suggestions:

  1. Author your code. As you type, suggestions are displayed. Code Suggestions, depending on the cursor position, either provides code snippets or completes the current line.
  2. Describe the requirements in natural language. Be concise and specific. Code Suggestions generates functions and code snippets as appropriate.
  3. To accept a suggestion, press Tab.
  4. To ignore a suggestion, keep typing as you usually would.
  5. To explicitly reject a suggestion, press esc.

Things to remember:

  • AI is non-deterministic, so you may not get the same suggestion every time with the same input.
  • Just like product requirements, writing clear, descriptive, and specific tasks results in quality generated code.

Progressive enhancement

This feature is designed as a progressive enhancement to developer’s IDEs. Code Suggestions offer a completion if a suitable recommendation is provided to the user in a timely matter. 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.

Supported languages

Code Suggestions support is a function of the:

  • Underlying large language model.
  • IDE used.
  • Extension or plug-in support in the IDE.

For languages not listed in the following table, Code Suggestions might not function as expected.

Supported languages in IDEs

Editor support for languages is documented in the following table.

Language VS Code JetBrains IDEs Visual Studio Neovim
C++ Yes Yes Yes Yes
C# Yes Yes Yes Yes
Go Yes Yes Yes Yes
Google SQL No Yes Yes Yes
Java Yes Yes Yes Yes
JavaScript Yes Yes Yes Yes
Kotlin Yes Yes Yes Yes
PHP Yes Yes Yes Yes
Python Yes Yes Yes Yes
Ruby Yes Yes Yes Yes
Rust Yes Yes Yes Yes
Scala Yes Yes Yes Yes
Swift Yes Yes Yes Yes
TypeScript Yes Yes Yes Yes
Google Cloud No No No No
Kubernetes Resource Model (KRM) No No No No
Terraform Yes (Requires third-party extension providing Terraform support) Yes No Yes (Requires third-party extension providing the terraform file type)
Some languages are not supported in all JetBrains IDEs, or may require additional plugin support. Refer to the JetBrains documentation for specifics on your IDE.

Supported editor extensions

Code Suggestions supports a variety of popular editors including:

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 data usage

Code Suggestions is powered by a generative AI model.

Your personal access token enables a secure API connection to or to your GitLab instance. This API connection securely transmits a context window from your IDE/editor to the GitLab AI Gateway, a GitLab hosted service. The gateway calls the large language model APIs, and then the generated suggestion is transmitted back to your IDE/editor.

GitLab selects the best-in-class large-language models for specific tasks. We use Google Vertex AI Code Models and Anthropic Claude for Code Suggestions.

View data retention policies.


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

Inference window context

Code Suggestions inferences against the currently opened file, the content before and after the cursor, the filename, and the extension type. For more information on possible future context expansion to improve the quality of suggestions, see epic 11669.

Training data

GitLab does not train generative AI models based on private (non-public) data. The vendors we work with also do not train models based on private data.

For more information on GitLab Code Suggestions data sub-processors, see:

Known limitations

While in Beta, we are working on improving the accuracy of overall generated content. However, Code Suggestions may generate suggestions that are:

  • Low-quality
  • Incomplete
  • Produce failed pipelines
  • Insecure code
  • Offensive or insensitive


Report issues in the feedback issue.