GraphQL query to get self-hosted models compatible with feature setting

Build the GraphQL query to support frontend retrieving the self-hosted models compatible with a certain configurable AI feature.

Implementation plan

You can use ::Ai::FeatureSetting#compatible_self_hosted_models

Query has to look like:

query aiFeatureSelfHostedModels($feature: AiFeatures!) {
  aiFeatureSelfHostedModels(feature: $feature) {
    nodes {
      model
      endpoint
      id
    }
  }
}

and response

{
  "data": {
    "aiFeatureSelfHostedModels": {
      "nodes": [
        {
          "model": "codegemma_7b",
          "endpoint": "http://0.0.0.0:4000",
          "id": "gid://gitlab/Ai::SelfHostedModel/2"
        }
      ]
    }
  }
}

In this draft you can find all the type definitions and implementation for this.

Edited by Patrick Cyiza