Add aiFeatureSettings GQL query
Add aiFeatureSettings GQL query
GraphQL query to support frontend retrieving the self-hosted models compatible with a certain configurable AI feature.
it covers these issues:
- GraphQL query to get self-hosted models compati... (#487948 - closed) • Patrick Cyiza • 17.5 • On track
- GraphQL query to get the configurable AI featur... (#487953 - closed) • Patrick Cyiza • 17.5 • On track
- Add GraphQL Query For Fetching Features Used by... (#476257 - closed) • Mohamed Hamda • 17.5 • On track
All packaged in one query as suggested in !166132 (comment 2125234328)
EE: true Changelog: added
How to set up and validate locally
query aiFeatureSettings {
aiFeatureSettings {
nodes {
feature
title
mainFeature
provider
releaseState
compatibleLlms
selfHostedModel {
id
name
model
}
validModels {
nodes {
id
name
model
}
}
}
}
}
response
{
"data": {
"aiFeatureSettings": {
"nodes": [
{
"feature": "code_generations",
"title": "Code Generation",
"mainFeature": "Code Suggestions",
"provider": "self_hosted",
"releaseState": "GA",
"compatibleLlms": [
"codegemma",
"codellama",
"codestral",
"deepseekcoder",
"mistral",
"mixtral",
"mixtral_8x22b"
],
"selfHostedModel": {
"id": "gid://gitlab/Ai::SelfHostedModel/3",
"name": "test-codegemma",
"model": "codegemma"
},
"validModels": {
"nodes": [
{
"id": "gid://gitlab/Ai::SelfHostedModel/3",
"name": "test-codegemma",
"model": "codegemma"
},
{
"id": "gid://gitlab/Ai::SelfHostedModel/1",
"name": "mistral-local-ollama-",
"model": "mistral"
},
{
"id": "gid://gitlab/Ai::SelfHostedModel/4",
"name": "anothermistral",
"model": "mistral"
}
]
}
},
(...)
{
"feature": "duo_chat",
"title": "Duo Chat",
"mainFeature": "Duo Chat",
"provider": "vendored",
"releaseState": "BETA",
"compatibleLlms": [
"mistral",
"mixtral_8x22b",
"mixtral"
],
"selfHostedModel": {
"id": "gid://gitlab/Ai::SelfHostedModel/1",
"name": "mistral-local-ollama-",
"model": "mistral"
},
"validModels": {
"nodes": [
{
"id": "gid://gitlab/Ai::SelfHostedModel/1",
"name": "mistral-local-ollama-",
"model": "mistral"
},
{
"id": "gid://gitlab/Ai::SelfHostedModel/4",
"name": "anothermistral",
"model": "mistral"
}
]
}
}
]
}
}
}
## With the self-hosted model's ID
query aiFeatureSettings(selfHostedModelId: "gid://gitlab/Ai::SelfHostedModel/3") {
aiFeatureSettings {
nodes {
feature
title
mainFeature
provider
releaseState
compatibleLlms
selfHostedModel {
id
name
model
}
validModels {
nodes {
id
name
model
}
}
}
}
}
response
{
"data": {
"aiFeatureSettings": {
"nodes": [
{
"feature": "code_generations",
"title": "Code Generation",
"mainFeature": "Code Suggestions",
"provider": "self_hosted",
"releaseState": "GA",
"compatibleLlms": [
"codegemma",
"codellama",
"codestral",
"deepseekcoder",
"mistral",
"mixtral",
"mixtral_8x22b"
],
"selfHostedModel": {
"id": "gid://gitlab/Ai::SelfHostedModel/3",
"name": "test-codegemma",
"model": "codegemma"
},
"validModels": {
"nodes": [
{
"id": "gid://gitlab/Ai::SelfHostedModel/3",
"name": "test-codegemma",
"model": "codegemma"
},
{
"id": "gid://gitlab/Ai::SelfHostedModel/1",
"name": "mistral-local-ollama-",
"model": "mistral"
},
{
"id": "gid://gitlab/Ai::SelfHostedModel/4",
"name": "anothermistral",
"model": "mistral"
}
]
}
}
]
}
}
}
Related to #487953 (closed)
Edited by Patrick Cyiza