Configure GitLab to access self-hosted models
Tier: Ultimate with GitLab Duo Enterprise - Start a trial
Offering: Self-managed
Status: Beta
History
-
Introduced in GitLab 17.1 with a flag named
ai_custom_model
. Disabled by default.
The availability of this feature is controlled by a feature flag.
For more information, see the history.
To configure your GitLab instance to access the available self-hosted models in your infrastructure:
- Configure the self-hosted model.
- Configure the GitLab Duo features to use your self-hosted model.
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 ().
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
- Select Models.
- Select New self-hosted model.
- Complete the fields:
- Enter the model name, for example,
Mistral
. - From the Model family dropdown list, select the model. Only GitLab-approved models are in this list.
- 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.
- Optional. For Model identifier, enter the cloud provider where the model is hosted, and the name the cloud provider uses for that model (for example:
anthropic/claude-3-5-sonnet-20240620
).
- Enter the model name, for example,
- Select Create model.
Configure GitLab Duo features to use self-hosted models
Prerequisites:
- You must be an administrator.
View 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 ().
- If the AI-powered features menu item is not available, synchronize your
subscription after purchase:
- Select Features.
Configure the feature to use a self-hosted model
Configure the GitLab Duo feature to send queries to the configured self-hosted model:
- In Features, 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 want to use, for example,
Mistral
.
- Select Save Changes.
Configure the features to use GitLab AI Vendor models
You can choose a GitLab AI vendor to be the GitLab Duo feature’s model provider. The feature then uses the GitLab-hosted model through the GitLab Cloud Connector:
- In Features, for the feature you want to set, select Edit.
- In the list of model providers for the feature, select AI Vendor.
- Select Save Changes.