Setting up local development

Set up your local GitLab instance

  1. Configure GDK to set up Duo Features in the local environment
  2. For GitLab Rails, enable ai_custom_model feature flag:

    Feature.enable(:ai_custom_model)
    
  3. For AI Gateway:
  • Set AIGW_CUSTOM_MODELS__ENABLED=True
  • Set AIGW_AUTH__BYPASS_EXTERNAL=False or AIGW_GITLAB_URL=<your-gitlab-instance>
  1. Run gitlab:duo:verify_self_hosted_setup task to verify the setup

Configure self-hosted models

  1. Follow the instructions to configure self-hosted models
  2. Follow the instructions to configure features to use the models

AI-powered features are now powered by self-hosted models.

Configure features to use AI vendor models

After adding support for configuring features to either use self-hosted models for AI Vendor, setting CLOUD_CONNECTOR_SELF_SIGN_TOKENS is no longer necessary for the customers. But it is harder for developers to configure the features to use AI vendored because we still want to send all requests to the local AI Gateway instead of Cloud Connector.

Setting CLOUD_CONNECTOR_BASE_URL is not sufficient because we add /ai suffix to it.

Currently, there are the following workarounds:

  1. Verify that CLOUD_CONNECTOR_SELF_SIGN_TOKENS=1
  2. Remove ai_feature_settings record responsible to the configuration to fallback to using AI_GATEWAY_URL as Cloud Connector URL:
Ai::FeatureSetting.find_by(feature: :duo_chat).destroy!