Configure GitLab to access self-hosted models
DETAILS: Tier: For a limited time, Premium and Ultimate. In the future, GitLab Duo Enterprise. Offering: Self-managed Status: Experiment
- Introduced in GitLab 17.1 with a flag named
ai_custom_model
. Disabled by default.
FLAG: The availability of this feature is controlled by a feature flag. For more information, see the history.
WARNING: This feature is considered experimental and is not intended for customer usage outside of initial design partners. We expect major changes to this feature.
DISCLAIMER: This page contains information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. The development, release, and timing of any products, features, or functionality may be subject to change or delay and remain at the sole discretion of GitLab Inc.
To configure your GitLab instance to access the available self-hosted large language models (LLMs) in your infrastructure:
- Configure the self-hosted model.
- Configure the GitLab Duo AI-powered features to use your self-hosted models.
Configure the self-hosted model
Prerequisites:
- You must be an administrator.
To configure a self-hosted model:
-
On the left sidebar, at the bottom, select Admin.
-
Select AI-powered features.
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
- On the left sidebar, select Subscription.
- In Subscription details, to the right of Last sync, select synchronize subscription ({retry}).
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
-
Select Models.
-
Set your model details by selecting New self-hosted model.
-
Complete the fields:
- Enter the model name, for example, Mistral.
- From the Model dropdown list, select the model. Only GitLab-approved models are listed here.
- For Endpoint, select the self-hosted model endpoint, for example, the server hosting the model.
- Optional. For API token, add an API key if you need one to access the model.
-
Select Create model.
Configure the features to your models
Prerequisites:
- You must be an administrator.
View the configured features
- On the left sidebar, at the bottom, select Admin.
- Select AI-powered features.
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
- On the left sidebar, select Subscription.
- In Subscription details, to the right of Last sync, select synchronize subscription ({retry}).
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
- Select Features.
Configure the features to use self-hosted models
Use a self-hosted AI Gateway to execute queries to the configured self-hosted model:
- For the feature you want to set, select Edit. For example, Code Generation.
- Select the model provider for the feature:
- From the list, select Self-Hosted Model.
- Choose the self-hosted model you would like to use, for example, Mistral.
- Select Save Changes.
Configure the features to use GitLab AI Vendor models
You can set a GitLab Duo feature's model provider to the GitLab AI Vendor. That feature then uses GitLab hosted models through the Cloud Connector:
- For the feature you want to set, select Edit.
- In the list of model providers for the feature, select AI Vendor.
- Select Save Changes.