Code Suggestions on GitLab SaaS

Version history
  • Introduced in GitLab 15.9 as Beta for early access Ultimate customers on GitLab.com.
  • Enabled as opt-in with GitLab 15.11 as Beta.
  • Moved from GitLab Ultimate to GitLab Premium in 16.0.
  • Moved from GitLab Premium to GitLab Free in 16.0.
  • Enabled by default in GitLab 16.1.

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

Usage of GitLab Duo Code Suggestions is governed by the GitLab Testing Agreement. Learn about data usage when using Code Suggestions.

Enable Code Suggestions

Introduced in GitLab 16.1 as Beta.

You can enable Code Suggestions for an individual or group:

The group setting takes precedence over the user setting.

Use Code Suggestions

Prerequisites:

To use Code Suggestions:

  1. Author your code. As you type, suggestions are displayed. Depending on the cursor position, the extension either:

    • Provides entire code snippets, like generating functions.
    • Completes the current line.
  2. To accept a suggestion, press Tab.

Suggestions are best when writing new code. Editing existing functions or ‘fill in the middle’ of a function may not perform as expected.

GitLab is making improvements to the Code Suggestions to improve the quality. AI is non-deterministic, so you may not get the same suggestion every time with the same input.

This feature is currently in Beta. Code Suggestions depends on both Google Vertex AI Codey APIs and the GitLab Code Suggestions service. We have built this feature to gracefully degrade and have controls in place to allow us to mitigate abuse or misuse. GitLab may disable this feature for any or all customers at any time at our discretion.