Este conteúdo não está disponível no idioma selecionado.
Chapter 4. Integrating Google Vertex AI with OpenShift Lightspeed
As an administrator, you can integrate Google Vertex AI as a large language model (LLM) provider for OpenShift Lightspeed.
4.1. Google Vertex AI provider types Copiar o linkLink copiado para a área de transferência!
OpenShift Lightspeed supports Google Vertex AI as an LLM provider. You can deploy Google-native models or Anthropic models hosted on the Google Cloud Platform (GCP) infrastructure.
Both provider types authenticate using a GCP service account JSON key stored within a Kubernetes Secret.
| Provider type | Use case | Required configuration field |
|---|---|---|
|
| Google-native models like Gemini. |
|
|
| Anthropic models like Claude hosted on Vertex AI. |
|
4.2. Configuring Google Vertex AI Copiar o linkLink copiado para a área de transferência!
To use Google Vertex AI, create a credentials secret and apply an OLSConfig custom resource (CR).
Prerequisites
- The OpenShift Lightspeed Operator must be installed.
- You must possess a valid GCP service account JSON key file.
- The Vertex AI API must be enabled in your Google Cloud project.
- Your GCP service account must have appropriate Vertex AI permissions.
Procedure
Create the credentials Secret in the operator namespace by running the following command:
oc create secret generic llmcreds \ --from-file=gcp-service-account.json=/path/to/service-account-key.json \ -n openshift-lightspeedNoteThe Operator looks for a key named
apitokenby default if you omit thecredentialKeyfield later.Create an
OLSConfigCR file namedolsconfig.yamlusing one of the following examples:Example configuration for Gemini (
google_vertex):apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: google type: google_vertex credentialsSecretRef: name: llmcreds credentialKey: gcp-service-account.json googleVertexConfig: projectID: my-gcp-project-123 location: us-central1 models: - name: gemini-2.5-flash-lite ols: defaultModel: gemini-2.5-flash-lite defaultProvider: googleExample configuration for Claude (
google_vertex_anthropic):apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: google-anthropic type: google_vertex_anthropic credentialsSecretRef: name: llmcreds credentialKey: gcp-service-account.json googleVertexAnthropicConfig: projectID: my-gcp-project-123 location: us-east4 models: - name: claude-3-sonnet ols: defaultModel: claude-3-sonnet defaultProvider: google-anthropic
Apply the configuration file to your cluster:
oc apply -f olsconfig.yaml
Verification
Verify that the Operator has completed reconciliation:
oc get olsconfig cluster -o jsonpath='{.status.overallStatus}'Expected output:
Ready
4.3. OLSConfig field reference for Google Vertex AI Copiar o linkLink copiado para a área de transferência!
The following reference tables describe the configuration schema for Google Vertex AI providers.
| Field | Type | Required | Description |
|---|---|---|---|
|
|
| Yes |
Logical name for the provider. Referenced by |
|
|
| Yes |
Must be set to |
|
|
| Yes | Name of the Secret in the operator namespace that contains provider credentials. |
|
|
| No |
Key name inside the Secret to read. Defaults to |
|
|
| No | The provider API endpoint URL. This field is typically not required for Vertex AI. |
|
|
| Yes | List of models available from the provider. |
| Field | Type | Required | Description |
|---|---|---|---|
|
|
| Yes |
The Google Cloud project ID (for example, |
|
|
| Yes |
The target GCP region for Vertex AI (for example, |
| Field | Type | Required | Description |
|---|---|---|---|
|
|
| Yes | The Google Cloud project ID. |
|
|
| Yes |
The target GCP region for Vertex AI (for example, |
| Field | Type | Required | Description |
|---|---|---|---|
|
|
| Yes |
Model name (such as |
|
|
| No | The model-specific API endpoint URL. |
|
|
| No | Context window size in tokens. Minimum value: 1024. |
|
|
| No | Maximum tokens allowed for responses. Default value: 2048. |
|
|
| No | Ratio of the context window allocated for the tool token budget. Range: 0.1 to 0.5. Default value: 0.5. |