Chapter 1. Configuring and deploying OpenShift Lightspeed
After the OpenShift Lightspeed Operator is installed, configuring and deploying Lightspeed consists of three tasks.
The instructions assume that you are installing OpenShift Lightspeed using the kubeadmin
user account. If you are using a regular user account with cluster-admin
privileges, read the section of the documentation that discusses RBAC.
First, create a credential secret using the credentials for your Large Language Model (LLM) provider. Next, create the OLSConfig
custom resource (CR) that the Operator uses to deploy the service. Finally, verify that the Lightspeed service is operating.
Starting with OpenShift Container Platform 4.19, the perspectives in the web console are unified. The Developer perspective is no longer enabled by default.
All users can interact with all OpenShift Container Platform web console features. However, if you are not the cluster owner, you might need to request permission to certain features from the cluster owner.
You can still enable the Developer perspective. On the Getting Started pane in the web console, you can take a tour of the console, find information on setting up your cluster, view a quick start for enabling the Developer perspective, and follow links to explore new features and capabilities.
1.1. Creating the credentials secret by using the web console Copy linkLink copied to clipboard!
Create a file that is associated with the API token used to access the API of your large language model (LLM) provider. Typically, you use API tokens to authenticate your LLM provider. Alternatively, Microsoft Azure also supports authentication using Microsoft Entra ID.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in to a user account that has permission to create a secret to store the Provider tokens. - You have installed the OpenShift Lightspeed Operator.
Procedure
-
Click the Quick create (
) menu in the upper-right corner of the OpenShift web console and select Import YAML.
Paste the YAML content for the LLM provider that you are using into the text area of the web console.
NoteThe YAML parameter is always
apitoken
regardless of what the LLM provider calls the access details.Credential secret for LLM provider
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
is notbase64
encoded.
Credential secret for Red Hat Enterprise Linux AI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for Red Hat OpenShift AI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for IBM watsonx
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for Microsoft Azure OpenAI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Alternatively, for Microsoft Azure OpenAI you can use Microsoft Entra ID to authenticate your LLM provider. Microsoft Entra ID users must configure the required roles for their Microsoft Azure OpenAI resource. For more information, see the official Microsoft Cognitive Services OpenAI Contributor(Microsoft Azure OpenAI Service documentation).
Credential secret for Microsoft Entra ID
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Create.
1.2. Creating the Lightspeed custom resource file by using the web console Copy linkLink copied to clipboard!
The Custom Resource (CR) file contains information that the Operator uses to deploy OpenShift Lightspeed. The specific content of the CR file is unique for each large language model (LLM) provider. To create the CR file, choose the configuration file for the LLM provider that you are using.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in to a user account that has permission to create a cluster-scoped CR file. - You have an LLM provider available for use with the OpenShift Lightspeed Service.
- You have installed the OpenShift Lightspeed Operator.
Procedure
-
Click the Quick create (
) menu in the upper-right corner of the OpenShift web console and select Import YAML.
Paste the YAML content for the LLM provider you use into the text area of the web console.
OpenAI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Enterprise Linux AI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- By default, the Red Hat Enterprise Linux AI API key requires a token as part of the request. If your Red Hat Enterprise Linux AI configuration does not require a token, you must set the token value to any valid string for the request to authenticate.
- 2
- The URL endpoint must end with
v1
to be valid. For example,https://http://3.23.103.8:8000/v1
.
Red Hat OpenShift AI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- By default, the Red Hat OpenShift AI API key requires a token as part of the request. If your Red Hat OpenShift AI configuration does not require a token, you must set the token value to any valid string for the request to authenticate.
- 2
- The URL endpoint must end with
v1
to be valid. For example,https://<model_name>.<domain_name>.com:443/v1
.
Microsoft Azure OpenAI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow IBM watsonx CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Create.
1.2.1. Configuring custom TLS certificates Copy linkLink copied to clipboard!
Configure custom TLS certificates for secure OpenShift Lightspeed service communication.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in to a user account that has permission to create or edit theOLSConfig
custom resource (CR). - You have a large language model (LLM) provider.
- You have installed the OpenShift Lightspeed Operator.
-
You have created the credentials secret and the
OLSconfig
CR.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - Select All Projects in the Project dropdown at the top of the screen.
- Click OpenShift Lightspeed Operator.
-
Click OLSConfig, then click the
cluster
configuration instance in the list. - Click the YAML tab.
Modify the
OLSconfig
CR to contain the file that contains the TLS secret.Example credentials secret and the
OLSconfig
CR fileCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.
Verification
Verify that a new pod was created in the
lightspeed-app-server
deployment by running the following command:oc get pod -n openshift-lightspeed
$ oc get pod -n openshift-lightspeed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE lightspeed-app-server-5b45d6dd99-5599w 2/2 Running 2 8h lightspeed-console-plugin-88d878686-tjt5p 1/1 Running 1 8d lightspeed-operator-controller-manager-7d7cc4588-p7442 1/1 Running 9 8d lightspeed-postgres-server-5484fcfdfc-kcpjh 1/1 Running 2 8d
NAME READY STATUS RESTARTS AGE lightspeed-app-server-5b45d6dd99-5599w 2/2 Running 2 8h lightspeed-console-plugin-88d878686-tjt5p 1/1 Running 1 8d lightspeed-operator-controller-manager-7d7cc4588-p7442 1/1 Running 9 8d lightspeed-postgres-server-5484fcfdfc-kcpjh 1/1 Running 2 8d
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Creating the credentials secret by using the CLI Copy linkLink copied to clipboard!
Create a file that is associated with the API token used to access the API of your large language model (LLM) provider. Typically, you use API tokens to authenticate your LLM provider. Alternatively, Microsoft Azure also supports authentication using Microsoft Entra ID.
Prerequisites
-
You have access to the OpenShift CLI (
oc
) as a user with thecluster-admin
role. Alternatively, you are logged in to a user account that has permission to create a secret to store the Provider tokens. - You have installed the OpenShift Lightspeed Operator.
Procedure
Create a YAML file that contains the content for the LLM provider that you are using.
NoteThe YAML parameter is always
apitoken
regardless of what the LLM provider calls the access details.Credential secret for LLM provider
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
is notbase64
encoded.
Credential secret for Red Hat Enterprise Linux AI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for Red Hat OpenShift AI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for IBM watsonx
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Credential secret for Microsoft Azure OpenAI
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
api_token
must bebase64
encoded when stored in a secret.
Alternatively, for Microsoft Azure OpenAI you can use Microsoft Entra ID to authenticate your LLM provider. Microsoft Entra ID users must configure the required roles for their Microsoft Azure OpenAI resource. For more information, see the official Microsoft Cognitive Services OpenAI Contributor(Microsoft Azure OpenAI Service documentation).
Credential secret for Microsoft Entra ID
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to create the secret:
oc create -f /path/to/secret.yaml
$ oc create -f /path/to/secret.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. Creating the Lightspeed custom resource file using the CLI Copy linkLink copied to clipboard!
The Custom Resource (CR) file contains information that the Operator uses to deploy OpenShift Lightspeed. The specific content of the CR file is unique for each large language model (LLM) provider. To create the CR file, choose the configuration file for the LLM provider that you are using.
Prerequisites
-
You have access to the OpenShift CLI (
oc
) and are logged in as a user with thecluster-admin
role. Alternatively, you are logged in to a user account that has permission to create a cluster-scoped CR file. - You have an LLM provider available for use with the OpenShift Lightspeed Service.
- You have installed the OpenShift Lightspeed Operator.
Procedure
Create an
OLSConfig
file that contains the YAML content for the LLM provider you use.OpenAI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Enterprise Linux AI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- By default, the Red Hat Enterprise Linux AI API key requires a token as part of the request. If your Red Hat Enterprise Linux AI configuration does not require a token, you must set the token value to any valid string for the request to authenticate.
- 2
- The URL endpoint must end with
v1
to be valid. For example,https://http://3.23.103.8:8000/v1
.
Red Hat OpenShift AI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- By default, the Red Hat OpenShift AI API key requires a token as part of the request. If your Red Hat OpenShift AI configuration does not require a token, you must set the token value to any valid string for the request to authenticate.
- 2
- The URL endpoint must end with
v1
to be valid. For example,https://<model_name>.<domain_name>.com:443/v1
.
Microsoft Azure OpenAI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow IBM watsonx CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command:
oc create -f /path/to/config-cr.yaml
$ oc create -f /path/to/config-cr.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The Operator deploys OpenShift Lightspeed using the information in YAML configuration file.
1.4.1. Configuring OpenShift Lightspeed with a trust provider certificate for the LLM Copy linkLink copied to clipboard!
Configure OpenShift Lightspeed with a trust provider certificate for the large language model (LLM) provider.
If the LLM provider you are using requires a trust certificate to authenticate the OpenShift Lightspeed service you must perform this procedure. If the LLM provider does not require a trust certificate to authenticate the service, you should skip this procedure.
Procedure
-
Copy the contents of the certificate file and paste it into a file called
caCertFileName
. Create a
ConfigMap
object calledtrusted-certs
by running the following command:oc create configmap trusted-certs --from-file=caCertFileName --namespace openshift-lightspeed
$ oc create configmap trusted-certs --from-file=caCertFileName --namespace openshift-lightspeed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the CA certificates required to connect to your LLM provider. You can include one or more certificates.
Update the
OLSConfig
custom resource file to include the name of theConfigMap
object you just created.Example Red Hat Enterprise Linux AI CR file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specifies the name of
ConfigMap
object.
Create the custom CR.
oc apply -f <olfconfig_cr_filename>
$ oc apply -f <olfconfig_cr_filename>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Verifying the OpenShift Lightspeed deployment Copy linkLink copied to clipboard!
After the OpenShift Lightspeed service is deployed, verify that it is operating.
Starting with OpenShift Container Platform 4.19, the perspectives in the web console are unified. The Developer perspective is no longer enabled by default.
All users can interact with all OpenShift Container Platform web console features. However, if you are not the cluster owner, you might need to request permission to certain features from the cluster owner.
You can still enable the Developer perspective. On the Getting Started pane in the web console, you can take a tour of the console, find information on setting up your cluster, view a quick start for enabling the Developer perspective, and follow links to explore new features and capabilities.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. -
You have access to the OpenShift CLI (
oc
). - You have installed the OpenShift Lightspeed Operator.
-
You have created the credentials secret and the
OLSConfig
Custom Resource configuration file.
Procedure
In the OpenShift Container Platform web console, click the Project drop-down list.
NoteFor OpenShift Container Platform 4.18 and earlier, select the Developer perspective from the drop-down list at the top of the pane to access the Project drop-down list.
- Enable the toggle switch to show default projects.
- Select openshift-lightspeed from the list.
Verify that the OpenShift Lightspeed is ready by running the following command:
oc logs deployment/lightspeed-app-server -c lightspeed-service-api -n openshift-lightspeed | grep Uvicorn
$ oc logs deployment/lightspeed-app-server -c lightspeed-service-api -n openshift-lightspeed | grep Uvicorn
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
INFO: Uvicorn running on https://0.0.0.0:8443 (Press CTRL+C to quit)
INFO: Uvicorn running on https://0.0.0.0:8443 (Press CTRL+C to quit)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6. About Lightspeed and Role Based Access Control (RBAC) Copy linkLink copied to clipboard!
Role-Based Access Control (RBAC) is a system security approach to restricting system access to authorized users who have defined roles and permissions.
OpenShift Lightspeed RBAC is binary. By default, not all cluster users have access to the OpenShift Lightspeed interface. Access must be granted by a user who can grant permissions. All users of an OpenShift cluster with OpenShift Lightspeed installed can see the Lightspeed button; however, only users with permissions can submit questions to Lightspeed.
If you want to evaluate the RBAC features of OpenShift Lightspeed, your cluster will need users other than the kubeadmin
account. The kubeadmin
account always has access to OpenShift Lightspeed.
1.6.1. Granting access to an individual user Copy linkLink copied to clipboard!
This procedure explains how to grant access to an individual user.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in as a user with the ability to grant permissions. - You have deployed the OpenShift Lightspeed service.
-
You have access to the OpenShift CLI (
oc
).
Procedure
Run the following command at the command line:
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>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use a YAML file when granting access to an individual user by using the following command:
oc adm policy add-cluster-role-to-user lightspeed-operator-query-access <user_name> -o yaml --dry-run
$ oc adm policy add-cluster-role-to-user lightspeed-operator-query-access <user_name> -o yaml --dry-run
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The terminal returns the following output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Enter the actual user name in place of
<user_name>
before creating the object.
Save the output as a YAML file, and run the following command to grant user access:
oc create -f <filename>
$ oc create -f <filename>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6.2. Granting access to a user group Copy linkLink copied to clipboard!
This procedure explains how to grant access to a user group. If your cluster has more advanced identity management configured, including user groups, you can grant all users of a specific group access to the OpenShift Lightspeed service.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in as a user with the ability to grant permissions. - You have deployed the OpenShift Lightspeed service.
- You have access to the OpenShift CLI (oc).
Procedure
Run the following command at the command line:
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>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use a YAML file when granting access to a user group by using the following command:
oc adm policy add-cluster-role-to-group lightspeed-operator-query-access <group_name> -o yaml --dry-run
$ oc adm policy add-cluster-role-to-group lightspeed-operator-query-access <group_name> -o yaml --dry-run
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The terminal returns the following output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Enter the actual user group in place of
<user_group>
before creating the object.
Save the output as a YAML file, and run the following command to grant access to the user group:
oc create -f <filename>
$ oc create -f <filename>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.7. Filtering and redacting information Copy linkLink copied to clipboard!
You can configure OpenShift Lightspeed to filter or redact information from being sent to the LLM provider. The following example shows how to modify the OLSConfig
file to redact IP addresses.
You should test your regular expressions against sample data to confirm that they are catching the information you want to filter or redact, and that they are not accidentally catching information you do not want to filter or redact. There are several third-party websites that you can use to test your regular expressions. When using third-party sites, you should practice caution with regards to sharing your private data. Alternatively, you can test the regular expressions locally using Python. In Python, it is possible to design very computationally-expensive regular expressions. Using several complex expressions as query filters can adversely impact the performance of OpenShift Lightspeed.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. -
You have access to the OpenShift CLI (
oc
). - You have installed the OpenShift Lightspeed Operator and deployed the OpenShift Lightspeed service.
Procedure
Modify the
OLSConfig
file and create an entry for each regular expression to filter. The following example redacts IP addresses:Example custom resource file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the modified OpenShift Lightspeed custom configuration:
oc apply -f OLSConfig.yaml
$ oc apply -f OLSConfig.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.8. About the BYO Knowledge tool Copy linkLink copied to clipboard!
The OpenShift Lightspeed service uses a large language model (LLM) to generate responses to questions. You can enhance the knowledge that is available to the LLM by using the BYO Knowledge tool to create a retrieval-augmented generation (RAG) database.
When you create a RAG database, you customize the OpenShift Lightspeed service for your environment. For example, a network administrator can develop a standard operating procedure (SOP) that is used to provision an OpenShift Container Platform cluster. Then, the network administrator can use the BYO Knowledge tool to enhance the knowledge available to the LLM by including information from the SOP.
To bring your own knowledge to an LLM, you complete the following steps:
- Create the custom content in Markdown format.
- Use the BYO Knowledge tool to package the content as a container image.
-
Push the container image to an image registry, such as
quay.io
. -
Update the
OLSConfig
custom resource file to list the image that you pushed to the image registry. Access the OpenShift Lightspeed virtual assistant and submit a question that is associated with the custom knowledge that you made available to the LLM.
NoteWhen you use the BYO Knowledge tool, the documents that you make available to the LLM are sent to the LLM provider.
1.8.1. Providing custom knowledge to the LLM Copy linkLink copied to clipboard!
Customize the information available to the large language model (LLM) by providing access to a container image that resides in a remote image registry. The examples in this procedure use quay.io
as the remote container image registry, and the path for the custom image is quay.io/<username>/my-byok-image:latest
.
The BYO Knowledge tool is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user account that has permission to create a cluster-scoped custom resource (CR) file, such as a user with the
cluster-admin
role. - You have an LLM provider available for use with the OpenShift Lightspeed Service.
- You have installed the OpenShift Lightspeed Operator.
-
The custom information you want to add resides as a collection of Markdown files with
.md
extensions. No other file format is supported. -
You have logged in to
registry.redhat.io
by using Podman. -
You have an account for a container image registry, such as
quay.io
.
Procedure
Specify the location of the directory with the Markdown files for the retrieval-augmented generation (RAG) database and the path for the image that the BYO Knowledge tool generates by running the following command:
podman run -it --rm --device=/dev/fuse \ -v $XDG_RUNTIME_DIR/containers/auth.json:/run/user/0/containers/auth.json:Z \ -v <dir_tree_with_markdown_files>:/markdown:Z \ -v <dir_for_image_tar>:/output:Z \ registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest
$ podman run -it --rm --device=/dev/fuse \ -v $XDG_RUNTIME_DIR/containers/auth.json:/run/user/0/containers/auth.json:Z \ -v <dir_tree_with_markdown_files>:/markdown:Z \ -v <dir_for_image_tar>:/output:Z \ registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe container image that the tool generates contains a custom RAG database. The RAG database provides additional information to the LLM.
Load the container image that the BYO Knowledge tool generated by running the following command:
podman load < <directory_for_image_tar>/<my-byok-image.tar>
$ podman load < <directory_for_image_tar>/<my-byok-image.tar>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display the podman images that are on your local computer by running the following command:
podman images
$ podman images
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
REPOSITORY TAG IMAGE ID CREATED SIZE localhost/my-byok-image latest be7d1770bf10 1 minute ago 2.37 GB ...
REPOSITORY TAG IMAGE ID CREATED SIZE localhost/my-byok-image latest be7d1770bf10 1 minute ago 2.37 GB ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Tag the local image with a name and destination so that the image can be pushed to the container image registry by running the following command:
podman tag localhost/my-byok-image:latest quay.io/<username>/my-byok-image:latest
$ podman tag localhost/my-byok-image:latest quay.io/<username>/my-byok-image:latest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Push the local container image to the container image registry by running the following command:
podman push quay.io/<username>/my-byok-image:latest
$ podman push quay.io/<username>/my-byok-image:latest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the
OLSconfig
CR to deploy the newly created RAG database alongside the existing one:-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - Select All Projects in the Project dropdown at the top of the screen.
- Click OpenShift Lightspeed Operator.
-
Click OLSConfig, then click the
cluster
configuration instance in the list. - Click the YAML tab.
Insert the
spec.ols.rag
yaml code:Example
OLSconfig
CR fileCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Where
image
specifies the tag for the image that was pushed to the image registry so that the OpenShift Lightspeed Operator can access the custom content. The OpenShift Lightspeed Operator can work with more than one RAG database that you create.
-
In the OpenShift Container Platform web console, click Operators
- Click Save.
Verification
Access the OpenShift Lightspeed virtual assistant and submit a question associated with the custom content that you provided to the LLM.
The OpenShift Lightspeed virtual assistant generates a response based on the custom content.
1.9. About cluster interaction Copy linkLink copied to clipboard!
The OpenShift Lightspeed Service uses a large language model (LLM) to generate responses to questions. You can enable the cluster interaction feature to enhance the knowledge available to the LLM with information about your OpenShift Container Platform cluster. Providing information about the Kubernetes objects that the cluster contains enables the LLM to generate highly specific responses for your environment.
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to an LLM. Using the protocol, an MCP server offers a standardized way for an LLM to increase context by requesting and receiving real-time information from external resources.
When you enable cluster interaction, the OpenShift Lightspeed Operator installs an MCP server. The MCP server provides the OpenShift Lightspeed Service with access to the OpenShift API. Through this access, the Service performs read operations to gather more context for the LLM, enabling the service to answer questions about the Kubernetes objects that reside in your OpenShift cluster.
The ability of OpenShift Lightspeed to choose and use a tool effectively is very sensitive to the large language (LLM) model. In general, a larger model with more parameters performs better, and the best performance comes from an extremely large frontier model that represents the latest AI capabilities. When using a small model, you might notice poor performance in tool selection or other aspects of cluster interaction.
To activate the cluster interaction feature in the OpenShift Lightspeed Service, tool calling must be enabled in the LLM provider.
Enabling tool calling can dramatically increase token usage. When you use public model providers, increased token usage can increase billing costs.
1.9.1. Enabling cluster interaction Copy linkLink copied to clipboard!
Modify the OLSConfig
custom resource to enable the cluster interaction feature.
The cluster interaction feature is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user with the
cluster-admin
role. Alternatively, you are logged in to a user account that has permission to create a cluster-scoped CR. - You have configured the large language model (LLM) provider.
- You have installed the OpenShift Lightspeed Operator.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - Click OpenShift Lightspeed Operator.
-
Click OLSConfig, then click the
cluster
configuration instance in the list. - Click the YAML tab.
Set the
spec.ols.introspectionEnabled
parameter totrue
to enable cluster interaction:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.
Verification
Access the OpenShift Lightspeed virtual assistant and submit a question associated with your cluster.
The OpenShift Lightspeed virtual assistant generates a highly refined response specific to your environment.
1.9.2. Enabling a custom MCP server Copy linkLink copied to clipboard!
Add an additional MCP server that interfaces with a tool in your environment so that the large language model (LLM) uses the tool to generate answers to your questions.
The cluster interaction feature is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Prerequisites
- You have installed the OpenShift Lightspeed Operator.
- You have configured a large language model provider.
-
You have configured the
OLSConfig
CR file, which automatically deploys the OpenShift Lightspeed Service.
Procedure
Open the OpenShift Lightspeed
OLSconfig
custom resource (CR) file by running the following command:oc edit olsconfig cluster
$ oc edit olsconfig cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add
MCPServer
to thespec.featureGates
specification file and include the MCP server information.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specifies the MCP server functionality.
- 2
- Specifies the name of the MCP server.
- 3
- Specifies the URL path that the MCP server uses to communicate.
- 4
- Specifies the time that the MCP server has to respond to a query. If the client does not receive a query within the time specified, the MCP server times out. In this example, the timeout is 30 seconds.
- 5
- Specifies the amount of time a client waits for new data from a Server-Sent Events (SSE) connection. If the client does not receive data within that time, the client closes the connection.
- 6
- Specifies the additional header that the HTTP request sends to the MCP server.
- 7
- When you set
enableSSE
totrue
, the MCP server establishes a one-way channel that the MCP server uses to push updates to the client whenever the server has new information. The default setting isfalse
.
Click Save.
The save operation saves the file and applies the changes so that the MCP server is available to the OpenShift Lightspeed service.
1.10. Tokens and token quota limits Copy linkLink copied to clipboard!
Tokens are small chunks of text, which can be as small as one character or as large as one word. Tokens are the units of measurement used to quantify the amount of text that the OpenShift Lightspeed service sends to, or receives from, a large language model (LLM). Every interaction with the service and the LLM is counted in tokens.
Token quota limits define the number of tokens that can be used in a certain timeframe. Implementing token quota limits helps control costs, encourage more efficient use of queries, and regulate system demands. In a multi-user configuration, token quota limits help provide equal access to all users ensuring everyone has an opportunity to submit queries.
You can define token quota limits for OpenShift clusters or OpenShift user accounts.
1.10.1. Activating token quota limits Copy linkLink copied to clipboard!
Activate token quota limits for the OpenShift Lightspeed service by defining key-value pairs in the ConfigMap
resource. The OpenShift Lightspeed pod mounts the ConfigMap
resource as a volume, enabling access to the file stored within it. The OLSConfig
custom resource (CR) references the ConfigMap
resource to obtain the quota limit information.
Prerequisites
- You have installed the the OpenShift Lightspeed Operator.
- You have configured a large language model provider.
- A PostgreSQL database is configured and the OpenShift Lightspeed service can access the database.
Procedure
Open the OpenShift Lightspeed
OLSconfig
CR file by running the following command:oc edit olsconfig cluster
$ oc edit olsconfig cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the
spec.ols.quotaHandlersConfig
specification to include token quota limit information.Example OpenShift Lightspeed
OLSConfig
CRCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specifies the token limit for user account.
- 2
- Specifies a token quota limit of 100,000 for each user over the time period specified in the
period
field. - 3
- Increases the token quota limit for the user by 1,000 at the end of the time period specified in the
period
field. - 4
- Specifies the token limit for a cluster.
- 5
- Specifies a token quota limit of 1,000,000 for each cluster over the time period specified in the
period
field. - 6
- Increases the token quota limit for the cluster by 100,000 at the end of the time period specified in the
period
field. - 7
- Defines the amount of time that the scheduler waits before the period resets or the quota limit increases.
Click Save.
The save operation saves the file and applies the changes to activate the token quota limits.
1.11. About Lightspeed and PostgreSQL persistence Copy linkLink copied to clipboard!
Using PostgreSQL persistence, you can save data, such as OpenShift Lightspeed conversation history or quota usage, to a PostgreSQL database so that the data is retained in persistent volume. With PostgreSQL persistence, the data persists if the PostgreSQL pod restarts or is rescheduled in your OpenShift Container Platform installation.
PostgreSQL persistence is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
PostgreSQL persistence is disabled by default. To enable the functionality, add the spec.ols.storage
specification to the OLSConfig
custom resource (CR).
1.11.1. Enabling PostgreSQL persistence Copy linkLink copied to clipboard!
Modify the OLSConfig
custom resource (CR) file to enable PostgreSQL persistence for the OpenShift Lightspeed service.
Prerequisites
-
You are logged in to the OpenShift Container Platform web console as a user account with permission to create a cluster-scoped CR file, such as a user with the
cluster-admin
role. - You have installed the OpenShift Lightspeed Operator.
- You have configured the large language model provider.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - Select All Projects in the Project list at the top of the screen.
- Click OpenShift Lightspeed Operator.
-
Click OLSConfig, then click the
cluster
configuration instance in the list. - Click the YAML tab.
Insert the
spec.ols.storage
YAML code.Example
OLSconfig
CR fileCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The class depends on the existing instances of the storage class in the cluster. If you leave the storage class empty, Lightspeed uses default values. The persistent volume allocated for the PostgreSQL database is 1 GB in size and uses the storage class of the default cluster. Specify empty braces for the
storage
parameter to use the default values.
If you want to change the
size
andclass
parameters, you can independently specify an explicit value for the parameter.ols: storage: size: 768Mi class: gp2-csi
ols: storage: size: 768Mi
1 class: gp2-csi
2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.