Skip to content

Add alias routes with /ai prefix

Nikola Milojevic requested to merge add-alternative-ai-routes into main

What does this merge request do and why?

In Install load balancer at cloud.gitlab.com (gitlab-com/gl-infra/production-engineering#24711 - closed) we are looking to install a load balancer reachable at cloud.gitlab.com , which can route traffic into various GitLab stage group backends based on URL matching.

  1. The request comes in to cloud.gitlab.com/ai/code/completions
  2. The request is forwarded to codesuggestions.gitlab.com/code/completions

Unfortunately, we encountered the Cloudflare limitation here, meaning that cloud.gitlab.com/ai/paht will be actually forwarded to codesuggestions.gitlab.com/ai/path (without omitting ai prefix).

Note that we are exploring the potential solution with the Cloudflare team (another solution would be to use Cloudflare workers), but we agreed to temporarily add route allies with /ai prefix, to mitigate this problem, so we can deliver cloud.gitlab.com on time

This MR adds /ai prefix to all ai gateway routes as alias routes.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.

Merge request reports