Skip to content

Code Suggestions on self-managed GitLab

DETAILS: Tier: Premium, Ultimate Offering: Self-managed

Get started using Code Suggestions in your IDE. These instructions apply to users of GitLab self-managed instances.

Prerequisites:

To use Code Suggestions:

  1. Author your code. As you type, suggestions are displayed. Code Suggestions provide code snippets or completes the current line, depending on the cursor position.

  2. Describe the requirements in natural language. Code Suggestions generates functions and code snippets based on the context provided.

  3. To accept a suggestion, press Tab. To reject a suggestion, press Esc.

  4. To ignore a suggestion, keep typing as you usually would.

AI is non-deterministic, so you may not get the same suggestion every time with the same input. To generate quality code, write clear, descriptive, specific tasks.

Enable Code Suggestions

How you enable Code Suggestions for your instance depends on your GitLab version.

The following instructions apply to GitLab 16.3 and later. To use Code Suggestions on a self-managed instance in 16.1 or 16.2, follow these instructions.

Prerequisites:

  • You must be a new Code Suggestions customer. If you've used Code Suggestions in the past, see the upgrade steps.
  • You must have a Premium or Ultimate subscription. These tiers support cloud licensing, which is required.
  • All of the users in your instance must have the latest version of their IDE extension.
  • You must be an administrator.
  • You must agree to the GitLab Testing Agreement.
  • You must acknowledge that GitLab sends data from the instance, including personal data, to GitLab.com infrastructure.

What's my GitLab version?

Configure network and proxy settings

The first step is to configure any firewalls to allow outbound connections to https://cloud.gitlab.com/.

If your GitLab instance uses an HTTP proxy server to access the internet, ensure the server is configured to allow outbound connections, including the gitlab_workhorse environment variable.

Enable Code Suggestions for the instance

The second step is to enable Code Suggestions for your self-managed instance:

  1. On the left sidebar, at the bottom, select Admin Area.

  2. Select Settings > General.

  3. Expand AI-powered features and select Enable Code Suggestions for this instance.

    In GitLab 16.3, leave the Personal access token text box blank. In GitLab 16.4 and later, the Personal access token text box does not exist.

  4. Select Save changes.

  5. Manually synchronize your subscription.

The users in your instance can now use Code Suggestions.

Manually synchronize your subscription

You must manually synchronize your subscription if either:

  • You have already upgraded to GitLab 16.3 and have just bought a Premium or Ultimate subscription.
  • You already have a Premium or Ultimate subscription and have just upgraded to GitLab 16.3.

Without the manual synchronization, it might take up to 24 hours to active Code Suggestions on your instance.

Data privacy

A self-managed GitLab instance does not generate Code Suggestions. After successful authentication to the self-managed instance, a token is generated.

The IDE/editor then uses this token to securely transmit data directly to the GitLab.com Code Suggestions service through the Cloud Connector gateway service for processing.

The Code Suggestions service then securely returns the AI-generated suggestion.

Neither GitLab nor Google Vertex AI Codey APIs have any visibility into self-managed customers' code, other than what is sent to generate the suggestion.

Disable Code Suggestions

To disable Code Suggestions, disable the feature in your IDE editor extension.