doc/administration/gitlab_duo_self_hosted/configure_duo_features.md
{{< details >}}
{{< /details >}}
{{< history >}}
ai_custom_model. Disabled by default.ai_custom_model removed in GitLab 17.8{{< /history >}}
Prerequisites:
To configure your GitLab instance to access self-hosted models in your infrastructure:
To configure access between your GitLab instance and your local AI Gateway:
[!note] If your AI Gateway URL points to a local network or private IP address (for example,
172.31.x.xor internal hostnames likeip-172-xx-xx-xx.region.compute.internal), GitLab might block the request for security reasons. To allow requests to this address, add the address to the IP allowlist.
{{< history >}}
{{< /history >}}
To conserve resources and prevent long-running queries, configure the timeout for GitLab requests to the AI Gateway when waiting for model responses. Use longer timeouts for self-hosted models with large context windows or complex queries.
You can configure a timeout between 60 and 600 seconds (10 minutes). If you don't set the timeout, GitLab uses the default timeout of 60 seconds.
To configure the AI Gateway timeout:
The timeout value depends on your specific deployment and use case.
To determine the timeout value:
A1000 timeout errors in your logs. If these errors occur frequently, consider increasing the timeout.For more information about troubleshooting timeout errors, see Error A1000.
If responses are cut off without an error even with higher timeout values, see
responses are truncated without an error.
{{< history >}}
{{< /history >}}
The AI Gateway request timeout controls how long GitLab waits for the AI Gateway. A separate timeout controls how long the AI Gateway waits for a chat response from your self-hosted model. By default, the AI Gateway ends a single chat model request after 30 seconds.
Large context windows or complex agentic prompts against slower self-hosted models can take longer than 30 seconds.
To increase this timeout, set the AIGW_DUO_CHAT__MODEL_REQUEST_TIMEOUT environment variable, in seconds, on the AI Gateway container:
docker run -e AIGW_GITLAB_URL=<your_gitlab_instance> \
-e AIGW_DUO_CHAT__MODEL_REQUEST_TIMEOUT=600 \
<ai_gateway_image>
The value must be greater than 0.
If a model has its own timeout in MODEL_SPECIFICATIONS, that value takes precedence over this default.
{{< history >}}
self_hosted_agent_platform. Disabled by default.self_hosted_agent_platform removed in GitLab 18.9.{{< /history >}}
Prerequisites:
To access the Agent Platform service from your GitLab instance:
http:// or https://.You must add a self-hosted model to your GitLab instance to use it with GitLab Duo features.
To add a self-hosted model:
In the upper-right corner, select Admin.
In the left sidebar, select GitLab Duo.
Select Configure models for GitLab Duo.
Select Add self-hosted model.
Complete the fields:
Deployment name: Enter a name to uniquely identify the model deployment, for example, Mixtral-8x7B-it-v0.1 on GCP.
Model family: Select the model family the deployment belongs to. You can select either a supported or compatible model.
Endpoint: Enter the URL where the model is hosted.
API key: Optional. Add an API key if you need one to access the model.
Model identifier: Enter the model identifier based on your deployment method. The model identifier should match the following format:
| Deployment method | Format | Example |
|---|---|---|
| vLLM | custom_openai/<name of the model served through vLLM> | custom_openai/Mixtral-8x7B-Instruct-v0.1 |
| Amazon Bedrock - Set the model identifier | bedrock/<model ID of the model> | bedrock/mistral.mixtral-8x7b-instruct-v0:1 |
| Amazon Bedrock - Use an application inference profile ARN | bedrock/converse/<application inference profile ARN> | bedrock/converse/arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abcd1234efgh |
| Gemini Enterprise Agent Platform | vertex_ai/<model ID of the model> | vertex_ai/claude-sonnet-4-6@default |
| Anthropic | anthropic/<model ID of the model> | anthropic/claude-opus-4-6 |
| OpenAI | openai/<model ID of the model> | openai/gpt-5 |
| Azure OpenAI | azure/<model ID of the model> | azure/gpt-35-turbo |
Select Add self-hosted model.
When you add an Amazon Bedrock self-hosted model, you can do either of the following:
To set a model identifier for an Amazon Bedrock model:
Set your AWS_REGION. Ensure you have access to models in that region in your AI Gateway Docker configuration.
Add the region prefix to the model's inference profile ID for cross-region inferencing.
Use the bedrock/ prefix region as the prefix for the model identifier.
For example, for the Anthropic Claude 4.0 model in the Tokyo region:
AWS_REGION is ap-northeast-1.apac..bedrock/apac.anthropic.claude-sonnet-4-20250514-v1:0.Some regions are not supported by cross-region inferencing. For these regions, do not specify a region prefix in the model identifier. For example:
AWS_REGION is eu-west-2.anthropic.claude-sonnet-4-5-20250929-v1:0.To use an application inference profile ARN as the model identifier, use the following format:
bedrock/converse/arn:aws:bedrock:<region>:<account-id>:application-inference-profile/<id>
For example:
bedrock/converse/arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abcd1234efgh
The converse/ prefix routes the request through the Amazon Bedrock Converse API, which is
required for ARN-based identifiers.
[!note] Turning on beta self-hosted models and features also accepts the GitLab Testing Agreement.
To enable self-hosted beta models and features:
To select a self-hosted model:
[!note] If you don't specify a model for a GitLab Duo Chat sub-feature, it automatically uses the model configured for General Chat. This ensures all Chat functionality works without requiring individual model selection for each sub-feature.
{{< history >}}
ai_self_hosted_vendored_features. Disabled by default.ai_self_hosted_vendored_features removed.{{< /history >}}
You can select a GitLab-managed model for a feature, even if you use a self-hosted AI Gateway and self-hosted models.
GitLab Duo features remain turned on even if you have not chosen a model for a feature.
To turn off a GitLab Duo feature:
If your setup prevents you from accessing the GitLab documentation at
docs.gitlab.com, you can self-host the documentation.
For more information, see Host the GitLab product documentation.