Skip to content

Commit 9a39693

Browse files
committed
Expose new config: LLMProjectID and LLMDeploymentName
In order to support Microsoft Azure OpenAI and WatsonX we need to expose these two new configurations in our operator. Microsoft Azure OpenAI requires the spec.llm.providers.deploymentName configuration to be set in OLSConfig [0]. Likewise, WatsonX requires the spec.llm.providers.projectID configuration to be set in OLSConfig [0]. The LLMDeploymentName and LLMProjectID exposed by us are optional configurations that can be set when configuring these LLM providers. Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
1 parent 5292bc2 commit 9a39693

5 files changed

Lines changed: 37 additions & 1 deletion

File tree

api/v1beta1/openstacklightspeed_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ type OpenStackLightspeedCore struct {
7777
// +kubebuilder:default="redhat-operators"
7878
// Name of the CatalogSource that contains the OLS Operator
7979
CatalogSourceName string `json:"catalogSourceName"`
80+
81+
// +kubebuilder:validation:Optional
82+
// Project ID for LLM providers that require it (e.g., WatsonX)
83+
LLMProjectID string `json:"llmProjectID,omitempty"`
84+
85+
// +kubebuilder:validation:Optional
86+
// Deployment name for LLM providers that require it (e.g., Microsoft Azure OpenAI)
87+
LLMDeploymentName string `json:"llmDeploymentName,omitempty"`
8088
}
8189

8290
// OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed

bundle/manifests/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
Secret name containing API token for the LLMEndpoint. The key for the field
6464
in the secret that holds the token should be "apitoken".
6565
type: string
66+
llmDeploymentName:
67+
description: Deployment name for LLM providers that require it (e.g.,
68+
Microsoft Azure OpenAI)
69+
type: string
6670
llmEndpoint:
6771
description: URL pointing to the LLM
6872
type: string
@@ -77,6 +81,9 @@ spec:
7781
- rhelai_vllm
7882
- fake_provider
7983
type: string
84+
llmProjectID:
85+
description: Project ID for LLM providers that require it (e.g., WatsonX)
86+
type: string
8087
maxTokensForResponse:
8188
description: MaxTokensForResponse defines the maximum number of tokens
8289
to be used for the response generation

bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ metadata:
2424
}
2525
]
2626
capabilities: Basic Install
27-
createdAt: "2025-12-10T11:14:44Z"
27+
createdAt: "2026-01-06T16:38:24Z"
2828
operatorframework.io/suggested-namespace: openshift-lightspeed
2929
operators.operatorframework.io/builder: operator-sdk-v1.38.0
3030
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4

config/crd/bases/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
Secret name containing API token for the LLMEndpoint. The key for the field
6464
in the secret that holds the token should be "apitoken".
6565
type: string
66+
llmDeploymentName:
67+
description: Deployment name for LLM providers that require it (e.g.,
68+
Microsoft Azure OpenAI)
69+
type: string
6670
llmEndpoint:
6771
description: URL pointing to the LLM
6872
type: string
@@ -77,6 +81,9 @@ spec:
7781
- rhelai_vllm
7882
- fake_provider
7983
type: string
84+
llmProjectID:
85+
description: Project ID for LLM providers that require it (e.g., WatsonX)
86+
type: string
8087
maxTokensForResponse:
8188
description: MaxTokensForResponse defines the maximum number of tokens
8289
to be used for the response generation

internal/controller/funcs.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ func PatchOLSConfig(
150150
"url": instance.Spec.LLMEndpoint,
151151
},
152152
}
153+
154+
provider := providersPatch[0].(map[string]interface{})
155+
if instance.Spec.LLMProjectID != "" {
156+
if err := uns.SetNestedField(provider, instance.Spec.LLMProjectID, "projectID"); err != nil {
157+
return err
158+
}
159+
}
160+
161+
if instance.Spec.LLMDeploymentName != "" {
162+
if err := uns.SetNestedField(provider, instance.Spec.LLMDeploymentName, "deploymentName"); err != nil {
163+
return err
164+
}
165+
}
166+
153167
if err := uns.SetNestedSlice(olsConfig.Object, providersPatch, "spec", "llm", "providers"); err != nil {
154168
return err
155169
}

0 commit comments

Comments
 (0)