Configure Red Hat OpenShift Lightspeed 1.0tp1 Configuring OpenShift Lightspeed Red Hat OpenShift Documentation Team

Commands:
apiVersion: v1 kind: Secret metadata: name: credentials namespace: openshift-lightspeed type: Opaque stringData: apitoken: <api_token> 1
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: rhelai-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: rhoai-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: watsonx-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: azure-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: client_id: <base64_encoded_client_id> client_secret: <base64_encoded_client_secret> tenant_id: <base64_encoded_tenant_id> kind: Secret metadata: name: azure-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: myOpenai type: openai credentialsSecretRef: name: credentials url: https://api.openai.com/v1 models: - name: gpt-3.5-turbo ols: defaultModel: gpt-3.5-turbo defaultProvider: myOpenai
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: openai-api-keys models: - name: models/granite-7b-redhat-lab name: rhelai type: rhelai_vllm url: <URL> 1 ols: defaultProvider: rhelai defaultModel: models/granite-7b-redhat-lab
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: openai-api-keys models: - name: granite-8b-code-instruct-128k name: red_hat_openshift_ai type: rhoai_vllm url: <url> 1 ols: defaultProvider: red_hat_openshift_ai defaultModel: granite-8b-code-instruct-128k
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: credentials deploymentName: <azure_ai_deployment_name> models: - name: gpt-35-turbo-16k name: myAzure type: azure_openai url: <azure_ai_deployment_url> ols: defaultModel: gpt-35-turbo-16k defaultProvider: myAzure
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: myWatsonx type: watsonx credentialsSecretRef: name: credentials url: <ibm_watsonx_deployment_name> projectId: <ibm_watsonx_project_id> models: - name: ibm/granite-13b-chat-v2 ols: defaultModel: ibm/granite-13b-chat-v2 defaultProvider: myWatsonx
apiVersion: v1 kind: Secret metadata: name: credentials namespace: openshift-lightspeed type: Opaque stringData: apitoken: <api_token> 1
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: rhelai-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: rhoai-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: watsonx-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: apitoken: <api_token> kind: Secret metadata: name: azure-api-keys namespace: openshift-lightspeed type: Opaque
apiVersion: v1 data: client_id: <base64_encoded_client_id> client_secret: <base64_encoded_client_secret> tenant_id: <base64_encoded_tenant_id> kind: Secret metadata: name: azure-api-keys namespace: openshift-lightspeed type: Opaque
oc create -f /path/to/secret.yaml
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: myOpenai type: openai credentialsSecretRef: name: credentials url: https://api.openai.com/v1 models: - name: gpt-3.5-turbo ols: defaultModel: gpt-3.5-turbo defaultProvider: myOpenai
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: openai-api-keys models: - name: models/granite-7b-redhat-lab name: rhelai type: rhelai_vllm url: <URL> 1 ols: defaultProvider: rhelai defaultModel: models/granite-7b-redhat-lab additionalCAConfigMapRef: name: openshift-service-ca.crt
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: openai-api-keys models: - name: granite-8b-code-instruct-128k name: red_hat_openshift_ai type: rhoai_vllm url: <url> 1 ols: defaultProvider: red_hat_openshift_ai defaultModel: granite-8b-code-instruct-128k
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - credentialsSecretRef: name: credentials deploymentName: <azure_ai_deployment_name> models: - name: gpt-35-turbo-16k name: myAzure type: azure_openai url: <azure_ai_deployment_url> ols: defaultModel: gpt-35-turbo-16k defaultProvider: myAzure
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: llm: providers: - name: myWatsonx type: watsonx credentialsSecretRef: name: credentials url: <ibm_watsonx_deployment_name> projectId: <ibm_watsonx_project_id> models: - name: ibm/granite-13b-chat-v2 ols: defaultModel: ibm/granite-13b-chat-v2 defaultProvider: myWatsonx
oc create -f /path/to/config-cr.yaml
oc create configmap trusted-certs --from-file=caCertFileName
kind: ConfigMap apiVersion: v1 metadata: name: trusted-certs namespace: openshift-lightspeed data: caCertFileName: | 1 -----BEGIN CERTIFICATE----- . . . -----END CERTIFICATE-----
apiVersion: ols.openshift.io/v1alpha1 kind: OLSConfig metadata: name: cluster spec: ols: defaultProvider: rhelai defaultModel: models/granite-7b-redhat-lab additionalCAConfigMapRef: name: trusted-certs 1
oc apply -f <olfconfig_cr_filename>
oc logs deployment/lightspeed-app-server -c lightspeed-service-api -n openshift-lightspeed | grep Uvicorn
INFO: Uvicorn running on https://0.0.0.0:8443 (Press CTRL+C to quit)
oc adm policy add-cluster-role-to-user lightspeed-operator-query-access <user_name>
oc adm policy add-cluster-role-to-user lightspeed-operator-query-access <user_name> -o yaml --dry-run
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: creationTimestamp: null name: lightspeed-operator-query-access roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: lightspeed-operator-query-access subjects: - apiGroup: rbac.authorization.k8s.io kind: User name: <user_name> 1
oc create -f <yaml_filename>
oc adm policy add-cluster-role-to-group lightspeed-operator-query-access <group_name>
oc adm policy add-cluster-role-to-group lightspeed-operator-query-access <group_name> -o yaml --dry-run
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: creationTimestamp: null name: lightspeed-operator-query-access roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: lightspeed-operator-query-access subjects: - apiGroup: rbac.authorization.k8s.io kind: Group name: <user_group> 1
oc create -f <yaml_filename>
spec: ols: queryFilters: - name: ip-address pattern: '((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}' replaceWith: <IP_ADDRESS>
oc apply -f OLSConfig.yaml