From a536f71aafe0031e051485c2af7b56345c6ed310 Mon Sep 17 00:00:00 2001 From: Ondrej Metelka Date: Thu, 21 May 2026 08:24:21 +0200 Subject: [PATCH 1/2] Add required runtime field to GoogleCloudVertex LLMProvider config (OLS-3150) Introduce GoogleCloudVertexRuntime (Claude, Gemini, OpenAI) so Vertex providers declare which SDK stack they use. Operator routing is a follow-up; this PR is API and CRD only. Co-authored-by: Cursor --- api/v1alpha1/llmprovider_types.go | 22 +++++++++++++++++++ .../agentic.openshift.io_llmproviders.yaml | 15 ++++++++++++- controller/proposal/reconciler_test.go | 1 + examples/setup/00-llm-providers.yaml | 1 + test/e2e/helpers_test.go | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/llmprovider_types.go b/api/v1alpha1/llmprovider_types.go index e95ba0cf..11b55c14 100644 --- a/api/v1alpha1/llmprovider_types.go +++ b/api/v1alpha1/llmprovider_types.go @@ -72,6 +72,20 @@ type AnthropicConfig struct { URL string `json:"url,omitempty"` } +// GoogleCloudVertexRuntime selects which SDK talks to Vertex AI. +// +// +kubebuilder:validation:Enum=Claude;Gemini;OpenAI +type GoogleCloudVertexRuntime string + +const ( + // GoogleCloudVertexRuntimeClaude uses Anthropic-on-Vertex (Claude SDK). + GoogleCloudVertexRuntimeClaude GoogleCloudVertexRuntime = "Claude" + // GoogleCloudVertexRuntimeGemini uses Google GenAI on Vertex. + GoogleCloudVertexRuntimeGemini GoogleCloudVertexRuntime = "Gemini" + // GoogleCloudVertexRuntimeOpenAI uses the OpenAI SDK against Vertex's OpenAI-compatible endpoint. + GoogleCloudVertexRuntimeOpenAI GoogleCloudVertexRuntime = "OpenAI" +) + // GoogleCloudVertexConfig contains configuration for the Google Cloud Vertex AI provider. type GoogleCloudVertexConfig struct { // credentialsSecret references a Secret in the operator namespace @@ -100,6 +114,13 @@ type GoogleCloudVertexConfig struct { // +kubebuilder:validation:XValidation:rule="self.matches('^[a-z][a-z0-9-]*[a-z0-9]$')",message="region must contain only lowercase letters, digits, and hyphens, start with a letter, and not end with a hyphen" Region string `json:"region,omitempty"` + // runtime selects which SDK talks to Vertex AI (required). + // "Claude" uses Anthropic-on-Vertex; "Gemini" uses Google GenAI on Vertex; + // "OpenAI" uses the OpenAI SDK against Vertex's OpenAI-compatible API. + // Enum is defined on GoogleCloudVertexRuntime. + // +required + Runtime GoogleCloudVertexRuntime `json:"runtime"` + // url is an optional override for the Vertex AI API endpoint. // Only needed for custom deployments or API proxies. // Must be a valid HTTP or HTTPS URL with a hostname. Paths and query @@ -312,6 +333,7 @@ type LLMProviderSpec struct { // name: llm-credentials // projectID: my-gcp-project // region: us-central1 +// runtime: Claude type LLMProvider struct { metav1.TypeMeta `json:",inline"` diff --git a/config/crd/bases/agentic.openshift.io_llmproviders.yaml b/config/crd/bases/agentic.openshift.io_llmproviders.yaml index 18509a78..501d51a2 100644 --- a/config/crd/bases/agentic.openshift.io_llmproviders.yaml +++ b/config/crd/bases/agentic.openshift.io_llmproviders.yaml @@ -36,7 +36,8 @@ spec: AI provider (model specified on Agent, not here):\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind: LLMProvider\n\tmetadata:\n\t name: vertex-ai\n\tspec:\n\t type: GoogleCloudVertex\n\t \ googleCloudVertex:\n\t credentialsSecret:\n\t name: llm-credentials\n\t - \ projectID: my-gcp-project\n\t region: us-central1" + \ projectID: my-gcp-project\n\t region: us-central1\n\t runtime: + Claude" properties: apiVersion: description: |- @@ -295,6 +296,17 @@ spec: - message: region must contain only lowercase letters, digits, and hyphens, start with a letter, and not end with a hyphen rule: self.matches('^[a-z][a-z0-9-]*[a-z0-9]$') + runtime: + description: |- + runtime selects which SDK talks to Vertex AI (required). + "Claude" uses Anthropic-on-Vertex; "Gemini" uses Google GenAI on Vertex; + "OpenAI" uses the OpenAI SDK against Vertex's OpenAI-compatible API. + Enum is defined on GoogleCloudVertexRuntime. + enum: + - Claude + - Gemini + - OpenAI + type: string url: description: |- url is an optional override for the Vertex AI API endpoint. @@ -318,6 +330,7 @@ spec: - credentialsSecret - projectID - region + - runtime type: object openAI: description: |- diff --git a/controller/proposal/reconciler_test.go b/controller/proposal/reconciler_test.go index 21fd84b6..04a818e8 100644 --- a/controller/proposal/reconciler_test.go +++ b/controller/proposal/reconciler_test.go @@ -106,6 +106,7 @@ func testLLM(name string) *agenticv1alpha1.LLMProvider { CredentialsSecret: agenticv1alpha1.SecretReference{Name: "llm-secret"}, ProjectID: "test-project", Region: "us-central1", + Runtime: agenticv1alpha1.GoogleCloudVertexRuntimeClaude, }, }, } diff --git a/examples/setup/00-llm-providers.yaml b/examples/setup/00-llm-providers.yaml index 237804fa..fe3fed90 100644 --- a/examples/setup/00-llm-providers.yaml +++ b/examples/setup/00-llm-providers.yaml @@ -20,3 +20,4 @@ spec: name: llm-credentials projectID: my-gcp-project region: us-central1 + runtime: Claude diff --git a/test/e2e/helpers_test.go b/test/e2e/helpers_test.go index 59a5e2a4..1d747d55 100644 --- a/test/e2e/helpers_test.go +++ b/test/e2e/helpers_test.go @@ -134,6 +134,7 @@ func createFixtures(t *testing.T, c client.Client) *e2eFixtures { CredentialsSecret: agenticv1alpha1.SecretReference{Name: "e2e-llm-secret"}, ProjectID: "e2e-project", Region: "us-central1", + Runtime: agenticv1alpha1.GoogleCloudVertexRuntimeClaude, }, }, }, From 172226f8972e2e685057c4ddefffa7ce4bc92192 Mon Sep 17 00:00:00 2001 From: Ondrej Metelka Date: Thu, 21 May 2026 08:28:49 +0200 Subject: [PATCH 2/2] Rename googleCloudVertex.runtime to modelProvider (OLS-3150) Use vendor-oriented values Anthropic, Google, and OpenAI instead of Claude, Gemini, and OpenAI SDK names. Co-authored-by: Cursor --- api/v1alpha1/llmprovider_types.go | 30 +++++++++---------- .../agentic.openshift.io_llmproviders.yaml | 28 ++++++++--------- controller/proposal/reconciler_test.go | 2 +- examples/setup/00-llm-providers.yaml | 2 +- test/e2e/helpers_test.go | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/api/v1alpha1/llmprovider_types.go b/api/v1alpha1/llmprovider_types.go index 11b55c14..0e129781 100644 --- a/api/v1alpha1/llmprovider_types.go +++ b/api/v1alpha1/llmprovider_types.go @@ -72,18 +72,18 @@ type AnthropicConfig struct { URL string `json:"url,omitempty"` } -// GoogleCloudVertexRuntime selects which SDK talks to Vertex AI. +// GoogleCloudVertexModelProvider selects which model provider stack talks to Vertex AI. // -// +kubebuilder:validation:Enum=Claude;Gemini;OpenAI -type GoogleCloudVertexRuntime string +// +kubebuilder:validation:Enum=Anthropic;Google;OpenAI +type GoogleCloudVertexModelProvider string const ( - // GoogleCloudVertexRuntimeClaude uses Anthropic-on-Vertex (Claude SDK). - GoogleCloudVertexRuntimeClaude GoogleCloudVertexRuntime = "Claude" - // GoogleCloudVertexRuntimeGemini uses Google GenAI on Vertex. - GoogleCloudVertexRuntimeGemini GoogleCloudVertexRuntime = "Gemini" - // GoogleCloudVertexRuntimeOpenAI uses the OpenAI SDK against Vertex's OpenAI-compatible endpoint. - GoogleCloudVertexRuntimeOpenAI GoogleCloudVertexRuntime = "OpenAI" + // GoogleCloudVertexModelProviderAnthropic uses Anthropic models on Vertex (Claude SDK). + GoogleCloudVertexModelProviderAnthropic GoogleCloudVertexModelProvider = "Anthropic" + // GoogleCloudVertexModelProviderGoogle uses Google models on Vertex (GenAI SDK). + GoogleCloudVertexModelProviderGoogle GoogleCloudVertexModelProvider = "Google" + // GoogleCloudVertexModelProviderOpenAI uses OpenAI-compatible models on Vertex (OpenAI SDK). + GoogleCloudVertexModelProviderOpenAI GoogleCloudVertexModelProvider = "OpenAI" ) // GoogleCloudVertexConfig contains configuration for the Google Cloud Vertex AI provider. @@ -114,12 +114,12 @@ type GoogleCloudVertexConfig struct { // +kubebuilder:validation:XValidation:rule="self.matches('^[a-z][a-z0-9-]*[a-z0-9]$')",message="region must contain only lowercase letters, digits, and hyphens, start with a letter, and not end with a hyphen" Region string `json:"region,omitempty"` - // runtime selects which SDK talks to Vertex AI (required). - // "Claude" uses Anthropic-on-Vertex; "Gemini" uses Google GenAI on Vertex; - // "OpenAI" uses the OpenAI SDK against Vertex's OpenAI-compatible API. - // Enum is defined on GoogleCloudVertexRuntime. + // modelProvider selects which model provider stack talks to Vertex AI (required). + // "Anthropic" uses Anthropic models on Vertex; "Google" uses Google models on Vertex; + // "OpenAI" uses OpenAI-compatible models on Vertex. + // Enum is defined on GoogleCloudVertexModelProvider. // +required - Runtime GoogleCloudVertexRuntime `json:"runtime"` + ModelProvider GoogleCloudVertexModelProvider `json:"modelProvider"` // url is an optional override for the Vertex AI API endpoint. // Only needed for custom deployments or API proxies. @@ -333,7 +333,7 @@ type LLMProviderSpec struct { // name: llm-credentials // projectID: my-gcp-project // region: us-central1 -// runtime: Claude +// modelProvider: Anthropic type LLMProvider struct { metav1.TypeMeta `json:",inline"` diff --git a/config/crd/bases/agentic.openshift.io_llmproviders.yaml b/config/crd/bases/agentic.openshift.io_llmproviders.yaml index 501d51a2..d9167138 100644 --- a/config/crd/bases/agentic.openshift.io_llmproviders.yaml +++ b/config/crd/bases/agentic.openshift.io_llmproviders.yaml @@ -36,8 +36,8 @@ spec: AI provider (model specified on Agent, not here):\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind: LLMProvider\n\tmetadata:\n\t name: vertex-ai\n\tspec:\n\t type: GoogleCloudVertex\n\t \ googleCloudVertex:\n\t credentialsSecret:\n\t name: llm-credentials\n\t - \ projectID: my-gcp-project\n\t region: us-central1\n\t runtime: - Claude" + \ projectID: my-gcp-project\n\t region: us-central1\n\t modelProvider: + Anthropic" properties: apiVersion: description: |- @@ -269,6 +269,17 @@ spec: required: - name type: object + modelProvider: + description: |- + modelProvider selects which model provider stack talks to Vertex AI (required). + "Anthropic" uses Anthropic models on Vertex; "Google" uses Google models on Vertex; + "OpenAI" uses OpenAI-compatible models on Vertex. + Enum is defined on GoogleCloudVertexModelProvider. + enum: + - Anthropic + - Google + - OpenAI + type: string projectID: description: |- projectID is the Google Cloud Project ID where Vertex AI is enabled. @@ -296,17 +307,6 @@ spec: - message: region must contain only lowercase letters, digits, and hyphens, start with a letter, and not end with a hyphen rule: self.matches('^[a-z][a-z0-9-]*[a-z0-9]$') - runtime: - description: |- - runtime selects which SDK talks to Vertex AI (required). - "Claude" uses Anthropic-on-Vertex; "Gemini" uses Google GenAI on Vertex; - "OpenAI" uses the OpenAI SDK against Vertex's OpenAI-compatible API. - Enum is defined on GoogleCloudVertexRuntime. - enum: - - Claude - - Gemini - - OpenAI - type: string url: description: |- url is an optional override for the Vertex AI API endpoint. @@ -328,9 +328,9 @@ spec: rule: '!self.contains(''#'')' required: - credentialsSecret + - modelProvider - projectID - region - - runtime type: object openAI: description: |- diff --git a/controller/proposal/reconciler_test.go b/controller/proposal/reconciler_test.go index 04a818e8..dcedece2 100644 --- a/controller/proposal/reconciler_test.go +++ b/controller/proposal/reconciler_test.go @@ -106,7 +106,7 @@ func testLLM(name string) *agenticv1alpha1.LLMProvider { CredentialsSecret: agenticv1alpha1.SecretReference{Name: "llm-secret"}, ProjectID: "test-project", Region: "us-central1", - Runtime: agenticv1alpha1.GoogleCloudVertexRuntimeClaude, + ModelProvider: agenticv1alpha1.GoogleCloudVertexModelProviderAnthropic, }, }, } diff --git a/examples/setup/00-llm-providers.yaml b/examples/setup/00-llm-providers.yaml index fe3fed90..5366ef46 100644 --- a/examples/setup/00-llm-providers.yaml +++ b/examples/setup/00-llm-providers.yaml @@ -20,4 +20,4 @@ spec: name: llm-credentials projectID: my-gcp-project region: us-central1 - runtime: Claude + modelProvider: Anthropic diff --git a/test/e2e/helpers_test.go b/test/e2e/helpers_test.go index 1d747d55..7bbbad05 100644 --- a/test/e2e/helpers_test.go +++ b/test/e2e/helpers_test.go @@ -134,7 +134,7 @@ func createFixtures(t *testing.T, c client.Client) *e2eFixtures { CredentialsSecret: agenticv1alpha1.SecretReference{Name: "e2e-llm-secret"}, ProjectID: "e2e-project", Region: "us-central1", - Runtime: agenticv1alpha1.GoogleCloudVertexRuntimeClaude, + ModelProvider: agenticv1alpha1.GoogleCloudVertexModelProviderAnthropic, }, }, },