Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/v1beta1/openstacklightspeed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ type OpenStackLightspeedCore struct {
// +kubebuilder:default="redhat-operators"
// Name of the CatalogSource that contains the OLS Operator
CatalogSourceName string `json:"catalogSourceName"`

// +kubebuilder:validation:Optional
// Project ID for LLM providers that require it (e.g., WatsonX)
LLMProjectID string `json:"llmProjectID,omitempty"`

// +kubebuilder:validation:Optional
// Deployment name for LLM providers that require it (e.g., Microsoft Azure OpenAI)
LLMDeploymentName string `json:"llmDeploymentName,omitempty"`

// +kubebuilder:validation:Optional
// LLM API Version for LLM providers that require it (e.g., Microsoft Azure OpenAI)
LLMAPIVersion string `json:"llmAPIVersion,omitempty"`
}

// OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,19 @@ spec:
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
llmAPIVersion:
description: LLM API Version for LLM providers that require it (e.g.,
Microsoft Azure OpenAI)
type: string
llmCredentials:
description: |-
Secret name containing API token for the LLMEndpoint. The key for the field
in the secret that holds the token should be "apitoken".
type: string
llmDeploymentName:
Comment thread
umago marked this conversation as resolved.
description: Deployment name for LLM providers that require it (e.g.,
Microsoft Azure OpenAI)
Comment thread
umago marked this conversation as resolved.
type: string
llmEndpoint:
description: URL pointing to the LLM
type: string
Expand All @@ -77,6 +85,9 @@ spec:
- rhelai_vllm
- fake_provider
type: string
llmProjectID:
description: Project ID for LLM providers that require it (e.g., WatsonX)
type: string
maxTokensForResponse:
description: MaxTokensForResponse defines the maximum number of tokens
to be used for the response generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2025-12-10T11:14:44Z"
createdAt: "2026-01-08T13:07:00Z"
operatorframework.io/suggested-namespace: openshift-lightspeed
operators.operatorframework.io/builder: operator-sdk-v1.38.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,19 @@ spec:
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
llmAPIVersion:
description: LLM API Version for LLM providers that require it (e.g.,
Microsoft Azure OpenAI)
type: string
llmCredentials:
description: |-
Secret name containing API token for the LLMEndpoint. The key for the field
in the secret that holds the token should be "apitoken".
type: string
llmDeploymentName:
description: Deployment name for LLM providers that require it (e.g.,
Microsoft Azure OpenAI)
type: string
llmEndpoint:
description: URL pointing to the LLM
type: string
Expand All @@ -77,6 +85,9 @@ spec:
- rhelai_vllm
- fake_provider
type: string
llmProjectID:
description: Project ID for LLM providers that require it (e.g., WatsonX)
type: string
maxTokensForResponse:
description: MaxTokensForResponse defines the maximum number of tokens
to be used for the response generation
Expand Down
20 changes: 20 additions & 0 deletions internal/controller/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,26 @@ func PatchOLSConfig(
"url": instance.Spec.LLMEndpoint,
},
}

provider := providersPatch[0].(map[string]interface{})
if instance.Spec.LLMProjectID != "" {
if err := uns.SetNestedField(provider, instance.Spec.LLMProjectID, "projectID"); err != nil {
return err
}
}

if instance.Spec.LLMDeploymentName != "" {
if err := uns.SetNestedField(provider, instance.Spec.LLMDeploymentName, "deploymentName"); err != nil {
return err
}
}

if instance.Spec.LLMAPIVersion != "" {
if err := uns.SetNestedField(provider, instance.Spec.LLMAPIVersion, "apiVersion"); err != nil {
return err
}
}

if err := uns.SetNestedSlice(olsConfig.Object, providersPatch, "spec", "llm", "providers"); err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
- name: ibm-granite/granite-3.1-8b-instruct
parameters:
maxTokensForResponse: 2048
projectID: test-project-id
deploymentName: test-deployment-name
apiVersion: v1
ols:
defaultProvider: openstack-lightspeed-provider
defaultModel: ibm-granite/granite-3.1-8b-instruct
Expand Down Expand Up @@ -54,6 +57,8 @@ spec:
llmEndpointType: openai
modelName: ibm-granite/granite-3.1-8b-instruct
tlsCACertBundle: openstack-lightspeed-cert
llmProjectID: test-project-id
llmDeploymentName: test-deployment-name
status:
conditions:
- type: Ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ spec:
llmCredentials: openstack-lightspeed-apitoken
modelName: ibm-granite/granite-3.1-8b-instruct
tlsCACertBundle: openstack-lightspeed-cert

llmProjectID: test-project-id
llmDeploymentName: test-deployment-name
llmAPIVersion: v1
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ spec:
llmCredentials: openstack-lightspeed-apitoken-UPDATE
modelName: ibm-granite/granite-3.1-8b-instruct-UPDATE
tlsCACertBundle: openstack-lightspeed-cert-UPDATE
llmProjectID: test-project-id-UPDATE
llmDeploymentName: test-deployment-name-UPDATE
llmAPIVersion: v1.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
- name: ibm-granite/granite-3.1-8b-instruct-UPDATE
parameters:
maxTokensForResponse: 2048
projectID: test-project-id-UPDATE
deploymentName: test-deployment-name-UPDATE
apiVersion: v1.1
ols:
defaultProvider: openstack-lightspeed-provider
defaultModel: ibm-granite/granite-3.1-8b-instruct-UPDATE
Expand Down
Loading