diff --git a/artifacts/attributes.adoc b/artifacts/attributes.adoc index 0d3281d975..8647b308d7 100644 --- a/artifacts/attributes.adoc +++ b/artifacts/attributes.adoc @@ -53,8 +53,8 @@ :odf-name: OpenShift Data Foundation :osd-brand-name: Red Hat OpenShift Dedicated :osd-short: OpenShift Dedicated -:rcs-name: Road-Core Service -:rcs-short: RCS +:lcs-name: Lightspeed Core Service +:lcs-short: LCS :rhacs-brand-name: Red Hat Advanced Cluster Security :rhacs-short: Advanced Cluster Security :rhacs-very-short: ACS diff --git a/assemblies/assembly-customizing-developer-lightspeed.adoc b/assemblies/assembly-customizing-developer-lightspeed.adoc index ee82abb321..f3b54ef7d0 100644 --- a/assemblies/assembly-customizing-developer-lightspeed.adoc +++ b/assemblies/assembly-customizing-developer-lightspeed.adoc @@ -4,9 +4,7 @@ [id="{context}"] = Customizing {ls-short} -You can customize {ls-short} functionalities, such as, question validation, gathering feedback, and storing chat history in PostgreSQL. - -include::modules/developer-lightspeed/proc-using-question-validation.adoc[leveloffset=+1] +You can customize {ls-short} functionalities such as gathering feedback, storing chat history in PostgreSQL, and {model-context-protocol-link}#proc-configure-mcp-tools-for-developer-lightspeed_assembly-model-context-protocol-tools[configuring Model Context Protocol (MCP) tools]. include::modules/developer-lightspeed/proc-gathering-feedback.adoc[leveloffset=+1] diff --git a/assemblies/assembly-developer-lightspeed.adoc b/assemblies/assembly-developer-lightspeed.adoc index 33d581a58d..99013ad668 100644 --- a/assemblies/assembly-developer-lightspeed.adoc +++ b/assemblies/assembly-developer-lightspeed.adoc @@ -8,7 +8,7 @@ include::modules/developer-lightspeed/con-about-developer-lightspeed.adoc[levelo include::modules/developer-lightspeed/con-supported-architecture.adoc[leveloffset=+1] -include::modules/developer-lightspeed/con-about-road-core-service.adoc[leveloffset=+2] +include::modules/developer-lightspeed/con-about-lightspeed-stack-and-llama-stack.adoc[leveloffset=+2] include::modules/developer-lightspeed/con-rag-embeddings.adoc[leveloffset=+1] diff --git a/assemblies/assembly-using-developer-lightspeed.adoc b/assemblies/assembly-using-developer-lightspeed.adoc index 7bfa027f84..d0c604fefd 100644 --- a/assemblies/assembly-using-developer-lightspeed.adoc +++ b/assemblies/assembly-using-developer-lightspeed.adoc @@ -13,6 +13,15 @@ endif::[] {ls-brand-name} is designed to support you when performing various tasks during your development workflow. +[NOTE] +==== +The `Question Validation` feature is enabled by default if you are using the `quay.io/redhat-ai-dev/llama-stack` image without overriding the `run.yaml` configuration file in the image. To disable `Question Validation`, you must mount a `run.yaml` file to the container with the following sections removed: + +* `Safety` +* `Shields` +* `External_providers_dir` set to `null` +==== + With `Question Validation` enabled, you can ask {ls-short} the following types of questions: * “Tell me about {product}.” diff --git a/images/rhdh-plugins-reference/developer-lightspeed-1-8-0.png b/images/rhdh-plugins-reference/developer-lightspeed-1-8-0.png new file mode 100644 index 0000000000..c1c2598748 Binary files /dev/null and b/images/rhdh-plugins-reference/developer-lightspeed-1-8-0.png differ diff --git a/images/rhdh-plugins-reference/developer-lightspeed-architecture-1-8-0.png b/images/rhdh-plugins-reference/developer-lightspeed-architecture-1-8-0.png new file mode 100644 index 0000000000..3b98f57ec9 Binary files /dev/null and b/images/rhdh-plugins-reference/developer-lightspeed-architecture-1-8-0.png differ diff --git a/images/rhdh-plugins-reference/developer-lightspeed.png b/images/rhdh-plugins-reference/developer-lightspeed.png deleted file mode 100644 index bf15e9773f..0000000000 Binary files a/images/rhdh-plugins-reference/developer-lightspeed.png and /dev/null differ diff --git a/modules/developer-lightspeed/con-about-bring-your-own-model.adoc b/modules/developer-lightspeed/con-about-bring-your-own-model.adoc index a427616a43..7bde3adc85 100644 --- a/modules/developer-lightspeed/con-about-bring-your-own-model.adoc +++ b/modules/developer-lightspeed/con-about-bring-your-own-model.adoc @@ -3,7 +3,7 @@ [id="con-about-bring-your-own-model_{context}"] = About Bring Your Own Model -{ls-short} does not provide its own inference services, but uses a _Bring Your Own Model_ approach. This means that you can configure the {rcs-name} to talk to the inference server or service of your choice. This also means that you are responsible for ensuring that the configured service meets your particular company policies and legal requirements, including any applicable terms with the third-party model provider. +{ls-short} does not provide its own inference services, but uses a _Bring Your Own Model_ approach. This means that you can configure the {lcs-name} to talk to the inference server or service of your choice. This also means that you are responsible for ensuring that the configured service meets your particular company policies and legal requirements, including any applicable terms with the third-party model provider. //Add the cross reference to "Bring your own model" The only technical requirements for inference services are: diff --git a/modules/developer-lightspeed/con-about-developer-lightspeed.adoc b/modules/developer-lightspeed/con-about-developer-lightspeed.adoc index fb440177e3..a7b73ffe1c 100644 --- a/modules/developer-lightspeed/con-about-developer-lightspeed.adoc +++ b/modules/developer-lightspeed/con-about-developer-lightspeed.adoc @@ -14,7 +14,7 @@ This early access program enables customers to share feedback on the user experi You can experience {ls-short} Developer Preview by installing the Developer Lightspeed for {product} plugin within an existing {product-very-short} instance. Alternatively, if you prefer to test it locally first, you can try {ls-short} using {product-local-very-short}. -image::rhdh-plugins-reference/developer-lightspeed.png[] +image::rhdh-plugins-reference/developer-lightspeed-1-8-0.png[] .Additional resources -* link:https://github.com/redhat-developer/rhdh-local/blob/main/README.md[{product-local-very-short}] +* link:https://github.com/redhat-developer/rhdh-local/blob/main/README.md[{product-local-very-short}] \ No newline at end of file diff --git a/modules/developer-lightspeed/con-about-lightspeed-stack-and-llama-stack.adoc b/modules/developer-lightspeed/con-about-lightspeed-stack-and-llama-stack.adoc new file mode 100644 index 0000000000..99f009fb71 --- /dev/null +++ b/modules/developer-lightspeed/con-about-lightspeed-stack-and-llama-stack.adoc @@ -0,0 +1,33 @@ +:_mod-docs-content-type: CONCEPT + +[id="con-about-lightspeed-stack-and-llama-stack_{context}"] += About {lcs-name} and Llama Stack + +The {lcs-name} and Llama Stack deploy together as sidecar containers to augment {product-very-short} functionality. + +The Llama Stack delivers the augmented functionality by integrating and managing core components, which include: + +* Large language model (LLM) inference providers + +* Model Context Protocol (MCP) or Retrieval Augmented Generation (RAG) tool runtime providers + +* Safety providers + +* Vector database settings + +The {lcs-name} serves as the Llama Stack service intermediary. It manages the operational configuration and key data, specifically: + +* User feedback collection + +* MCP server configuration + +* Conversation history + +Llama Stack provides the inference functionality that {lcs-short} uses to process requests. For more information, see https://llamastack.github.io/docs#what-is-llama-stack[What is Llama Stack]. + +The {ls-brand-name} plugin in {product-very-short} sends prompts and receives LLM responses through the {lcs-short} sidecar. {lcs-short} then uses the Llama Stack sidecar service to perform inference and MCP or RAG tool calling. + +[NOTE] +==== +{ls-brand-name} is a Developer Preview release. You must manually deploy the {lcs-name} and Llama Stack sidecar containers, and install the {ls-brand-name} plugin on your {product-very-short} instance. +==== \ No newline at end of file diff --git a/modules/developer-lightspeed/con-about-road-core-service.adoc b/modules/developer-lightspeed/con-about-road-core-service.adoc deleted file mode 100644 index 615529bd5d..0000000000 --- a/modules/developer-lightspeed/con-about-road-core-service.adoc +++ /dev/null @@ -1,11 +0,0 @@ -:_mod-docs-content-type: CONCEPT - -[id="con-about-rcs_{context}"] -= About {rcs-name} - -The {rcs-name} ({rcs-short}) acts as an intermediary and service layer for interfacing with LLM providers. {rcs-short} handles LLM provider setup, authentication, and includes functionalities such as question validation, feedback, and Retrieval Augmented Generation (RAG). The {ls-short} plugin within {product-very-short} communicates with the {rcs-short} sidecar to send prompts and receives responses from the configured LLM service. The {rcs-short} sidecar is used to centralize the LLM interaction logic and configuration alongside your {product-very-short} instance. - -[NOTE] -==== -{ls-brand-name} is a Developer Preview release. You must manually deploy the {rcs-name} as a sidecar container, and then install the {ls-short} plugin on your {product-very-short} instance. -==== diff --git a/modules/developer-lightspeed/con-llm-requirements.adoc b/modules/developer-lightspeed/con-llm-requirements.adoc index 6ecffddcfd..da5360622c 100644 --- a/modules/developer-lightspeed/con-llm-requirements.adoc +++ b/modules/developer-lightspeed/con-llm-requirements.adoc @@ -5,11 +5,10 @@ {ls-short} follows a _Bring Your Own Model_ approach. This model means that to function, {ls-short} requires access to a large language model (LLM) which you must provide. An LLM is a type of generative AI that interprets natural language and generates human-like text or audio responses. When an LLM is used as a virtual assistant, the LLM can interpret questions and provide answers in a conversational manner. -LLMs are usually provided by a service or server. Since {ls-short} does not provide an LLM for you, you must configure your preferred LLM provider during installation. -You can use {ls-short} with a number of LLM providers that offer the OpenAI API interface including the following LLMS: +LLMs are usually provided by a service or server. Because {ls-short} does not provide an LLM for you, you must configure your preferred LLM provider during installation. You can configure the underlying Llama Stack server to integrate with a number of LLM `providers` that offer compatibility with the OpenAI API including the following inference providers: * OpenAI (cloud-based inference service) -* Red Hat OpenShift AI (enterprise model builder & inference server) -* Red Hat Enterprise Linux AI (enterprise inference server) +* {rhoai-brand-name} (enterprise model builder and inference server) +* {rhel} AI (enterprise inference server) * Ollama (popular desktop inference server) * vLLM (popular enterprise inference server) diff --git a/modules/developer-lightspeed/con-rag-embeddings.adoc b/modules/developer-lightspeed/con-rag-embeddings.adoc index 854c47078a..9084e17383 100644 --- a/modules/developer-lightspeed/con-rag-embeddings.adoc +++ b/modules/developer-lightspeed/con-rag-embeddings.adoc @@ -1,6 +1,8 @@ :_mod-docs-content-type: CONCEPT [id="con-rag-embeddings_{context}"] -= Retrieval Augmented Generation embeddings += Retrieval augmented generation (RAG) embeddings -The {product} documentation set has been added to the {rcs-name} as a RAG embedding. +The {product} documentation serves as the Retrieval-Augmented Generation (RAG) data source. + +RAG initialization occurs through an initialization container, which copies the RAG data to a shared volume. The Llama Stack sidecar then mounts this shared volume to access the RAG data. The Llama Stack service uses the resulting RAG embeddings in the vector database as a reference. This allows the service to provide citations to production documentation during the inference process. \ No newline at end of file diff --git a/modules/developer-lightspeed/con-supported-architecture.adoc b/modules/developer-lightspeed/con-supported-architecture.adoc index f217e6fd93..ecb43c36a0 100644 --- a/modules/developer-lightspeed/con-supported-architecture.adoc +++ b/modules/developer-lightspeed/con-supported-architecture.adoc @@ -3,13 +3,11 @@ [id="con-supported-architecture_{context}"] = Supported architecture for {ls-brand-name} -{ls-short} is available as a plugin on all platforms that host {product-very-short}, and it requires the use of {rcs-name} ({rcs-short}) as a sidecar container. +{ls-short} is available as a plugin on all platforms that host {product-very-short}. It requires two sidecar containers: the {lcs-name} ({lcs-short}) and the Llama Stack service. +The {lcs-short} container acts as the intermediary layer, which interfaces with and manages the Llama Stack service. -[NOTE] -==== -Currently, the provided {rcs-short} image is built for x86 platforms. To use other platforms (for example, arm64), ensure that you enable emulation. -==== +image::rhdh-plugins-reference/developer-lightspeed-architecture-1-8-0.png[] .Additional resources -* link:https://access.redhat.com/support/policy/updates/developerhub[{product} Life Cycle and supported platforms] +* link:https://access.redhat.com/support/policy/updates/developerhub[{product} Life Cycle and supported platforms] \ No newline at end of file diff --git a/modules/developer-lightspeed/proc-changing-your-llm-provider.adoc b/modules/developer-lightspeed/proc-changing-your-llm-provider.adoc index dee81aabbe..5e4d6b8313 100644 --- a/modules/developer-lightspeed/proc-changing-your-llm-provider.adoc +++ b/modules/developer-lightspeed/proc-changing-your-llm-provider.adoc @@ -3,66 +3,25 @@ [id="proc-changing-your-llm-provider_{context}"] = Changing your LLM provider in {ls-short} -{ls-short} operates on a {developer-lightspeed-link}#con-about-bring-your-own-model_appendix-about-user-data-security[_Bring Your Own Model_] approach, meaning you must provide and configure access to your preferred Large Language Model (LLM) provider for the service to function. The Road-Core Service (RCS) acts as an intermediary layer that handles the configuration and setup of these LLM providers. - -[IMPORTANT] -==== -The LLM provider configuration section includes a mandatory dummy provider block. Due to limitations of Road Core, this dummy provider must remain present when working with Lightspeed. This block is typically marked with comments (# Start: Do not remove this block and # End: Do not remove this block) and must not be removed from the configuration file. -==== - -.Prerequisites - -* The path to the file containing your API token must be accessible by the RCS container, requiring the file to be mounted to the RCS container. +{ls-short} operates on a {developer-lightspeed-link}#con-about-bring-your-own-model_appendix-about-user-data-security[_Bring Your Own Model_] approach, meaning you must provide and configure access to your preferred large language model (LLM) provider for the service to function. Llama Stack acts as an intermediary layer that handles the configuration and setup of these LLM providers. .Procedure -You can define additional LLM providers using either of following methods: - -* Recommended: In your Developer Lightspeed plugin configuration (the `lightspeed` section within the `lightspeed-app-config.yaml` file), define the new provider or providers under the `lightspeed.servers` key as shown in the following code: -+ -[source,yaml] ----- -lightspeed: - servers: - - id: __ - url: __ - token: __ ----- -+ -[NOTE] -==== -In Developer preview, only one LLM server is supported at a time. -==== -** Optional: You can set the `id`, `url`, and `token` values in a Kubernetes Secret and reference them as environment variables using the `envFrom` section. -[source,yaml] ----- -containers: - - name: my-container - image: my-image - envFrom: - - secretRef: - name: my-secret ----- - -* You can add new LLM providers by updating the `rcsconfig.yaml` file. -.. In the `llm_providers` section within your `rcsconfig.yaml` file, add your new provider configuration below the mandatory dummy provider block as shown in the following code: +* You can define additional LLM providers by updating your Llama Stack app config (`llama-stack`) file. In the `inference` section within your `llama-stack.yaml` file, add your new provider configuration as shown in the following example: + [source,yaml] ---- -llm_providers: - # Start: Do not remove this block - - name: dummy - type: openai - url: https://dummy.com - models: - - name: dummymodel - # END: Do not remove this block - - name: __ - type: openai - url: __ - credentials_path: path/to/token - disable_model_check: true ----- -.. If you need to define a new provider in `rcsconfig.yaml`, you must configure the following critical parameters: -** `credentials_path`: Specifies the path to a `.txt` file that contains your API token. This file must be mounted and accessible by the RCS container. -** `disable_model_check`: Set this field to `true` to allow the RCS to locate models through the `/v1/models` endpoint of the provider. When you set this field to `true`, you avoid the need to define model names explicitly in the configuration. \ No newline at end of file + #START - Adding your LLM provider + inference: + - provider_id: vllm + provider_type: remote::vllm + config: + url: ${env.VLLM_URL} + api_token: ${env.VLLM_API_KEY} + max_tokens: ${env.VLLM_MAX_TOKENS:=4096} + tls_verify: ${env.VLLM_TLS_VERIFY:=true} + - provider_id: sentence-transformers + provider_type: inline::sentence-transformers + config: {} +#END - Adding your LLM provider +---- \ No newline at end of file diff --git a/modules/developer-lightspeed/proc-customizing-the-chat-history-storage.adoc b/modules/developer-lightspeed/proc-customizing-the-chat-history-storage.adoc index a7f7321f89..23db06e13e 100644 --- a/modules/developer-lightspeed/proc-customizing-the-chat-history-storage.adoc +++ b/modules/developer-lightspeed/proc-customizing-the-chat-history-storage.adoc @@ -3,20 +3,18 @@ [id="proc-customizing-the-chat-history-storage_{context}"] = Customizing the chat history storage in {ls-short} -By default, the {rcs-short} service stores chat history using an in-memory database. This means that if you restart the Pod containing the server, the chat history is lost. You can manually configure {ls-short} to store the chat history persistently as a long-term backup with PostgreSQL by any of the following methods: - -* {product-very-short} Operator -* {product-very-short} Helm chart +By default, the {ls-short} service stores chat history in a non-persistent local SQL database within in the {lcs-short} container. This means that chat history is lost if you create and use a new {lcs-short} sidecar. You can manually configure {ls-short} to store the chat history persistently as a long-term backup with PostgreSQL by updating your {lcs-short} service configuration. + [WARNING] ==== -If you configure {ls-short} to store chat history using PostgreSQL, prompts and responses are recorded and can be reviewed by your platform administrators. If any of your user's chat history contains any private, sensitive, or confidential information, this might have data privacy and security implications that you need to assess. For users that wish to have their chat data removed, they must request their respective platform administrator to perform this action. {company-name} does not collect (or have access to) any of this chat history data. +Configuring {ls-short} to use PostgreSQL records prompts and responses, which platform administrators can review. You must assess any data privacy and security implications if user chat history contains private, sensitive, or confidential information. For users that wish to have their chat data removed, they must request their respective platform administrator to perform this action. {company-name} does not collect or access this chat history data. ==== .Procedure -* When you are using {ls-short} on an Operator-installed {product-very-short} instance, in your {product-very-short} instance ConfigMap, update the `conversation-cache` field as shown in the following example: -+ +. Configure the chat history storage type in the {lcs-short} configuration file (`lightspeed-stack.yaml`) using any of the relevant options: +** To enable persistent storage with PostgreSQL, add the following configuration: ++ [source,yaml] ---- conversation_cache: @@ -24,24 +22,18 @@ If you configure {ls-short} to store chat history using PostgreSQL, prompts and postgres: host: __ port: __ - dbname: __ - user: __ - password_path: postgres_password.txt - ca_cert_path: postgres_cert.crt - ssl_mode: "require" + db: __ + user: __ + password: __ ---- - -* When you are using {ls-short} on a Helm-installed {product-very-short} instance, in your {product-very-short} instance `values.yaml` file, update the `conversation-cache` field as shown in the following example: +* To retain the default, non-persistent SQLite storage, make sure the configuration is set as shown in the following example: + [source,yaml] ---- - conversation_cache: - type: postgres - postgres: - host: __ - port: __ - dbname: __ - user: __ - password_path: postgres_password.txt - ca_cert_path: postgres_cert.crt +conversation_cache: + type: "sqlite" + sqlite: + db_path: "/tmp/cache.db" ---- + +. Restart your {lcs-short} service to apply the new configuration. \ No newline at end of file diff --git a/modules/developer-lightspeed/proc-gathering-feedback.adoc b/modules/developer-lightspeed/proc-gathering-feedback.adoc index d8693da449..49de7ea7ae 100644 --- a/modules/developer-lightspeed/proc-gathering-feedback.adoc +++ b/modules/developer-lightspeed/proc-gathering-feedback.adoc @@ -3,19 +3,21 @@ [id="proc-gathering-feedback_{context}"] = Gathering feedback in {ls-short} -Feedback collection is an optional feature configured on the {rcs-short}. This feature gathers user feedback by providing thumbs-up/down ratings and text comments directly from the chat window. {rcs-short} gathers the feedback, along with the user's query and the response of the model, and stores it as a JSON file within the local file system of the Pod for later collection and analysis by the platform administrator. This can be useful for assessing model performance and improving your users' experience. The collected feedback is stored in the cluster where {product-very-short} and {rcs-short} are deployed, and as such, is only accessible by the platform administrators for that cluster. For users that intend to have their data removed, they must request their respective platform administrator to perform that action as {company-name} does not collect (or have access to) any of this data. +Feedback collection is an optional feature configured on the {lcs-short}. This feature gathers user feedback by providing thumbs-up/down ratings and text comments directly from the chat window. + +{lcs-short} collects the feedback, the user's query, and the response of the model, storing the data as a JSON file on the local file system of the Pod. A platform administrator must later collect and analyze this data to assess model performance and improve the user experience. + +The collected data resides in the cluster where {product-very-short} and {lcs-short} are deployed, making it accessible only to platform administrators for that cluster. For data removal, users must request this action from their platform administrator, as {company-name} neither collects nor accesses this data. .Procedure -* To enable or disable feedback, in your {rcs-short} configuration file, add the following settings: +. To enable or disable feedback collection, in the {lcs-short} configuration file (`lightspeed-stack.yaml`), add the following settings: + [source,yaml] ---- -llm_providers: - ....... -ols_config: - ...... user_data_collection: - feedback_disabled: - feedback_storage: "/app-root/tmp/data/feedback" + feedback_enabled: true + feedback_storage: "/tmp/data/feedback" + transcripts_enabled: true + transcripts_storage: "/tmp/data/transcripts" ---- diff --git a/modules/developer-lightspeed/proc-installing-and-configuring-lightspeed.adoc b/modules/developer-lightspeed/proc-installing-and-configuring-lightspeed.adoc index 449e8d9c7c..c2c8dc1235 100644 --- a/modules/developer-lightspeed/proc-installing-and-configuring-lightspeed.adoc +++ b/modules/developer-lightspeed/proc-installing-and-configuring-lightspeed.adoc @@ -3,516 +3,392 @@ [id="proc-installing-and-configuring-lightspeed_{context}"] = Installing and configuring {ls-brand-name} -You must install and configure both the {ls-short} and the {rcs-short} sidecar container manually. +{ls-short} consists of several components which work together to deliver virtual assistant (chat) functionality to your developers. The following list main components: + +* *Llama stack server (container sidecar):* This service (based on open source https://github.com/llamastack/llama-stack[Llama Stack]) operates as the main gateway to your LLM inferencing provider for chat services. It also allows you to integrate other services such as Model Context Protocol (MCP) thanks to its modular nature. You must integrate your LLM provider with the Llama Stack server in order to support the chat functionality of {ls-short}. We call this dependency on external LLM providers _Bring Your Own Model_ or BYOM. + +* *{lcs-name} ({lcs-short}) (container sidecar):* This service (based on the open source https://github.com/lightspeed-core[Lightspeed Core]) enables additional features in addition to those that the Llama Stack server provides, such as maintaining your chat history and gathering user feedback. + +* *{ls-brand-name} (dynamic plugins):* These plugins are required to enable the {ls-short} user interface within your {product-very-short} instance. + +Configuring these components to initialise correctly and communicate with each other is essential in order to provide {ls-short} to your users. + +[NOTE] +==== +If you have already installed the previous {ls-short} Developer Preview with Road-Core Service, you must remove the previous {ls-short} configurations and settings and reinstall. + +This step is necessary as {ls-short} has a new architecture. In the previous release, {ls-short} required the use of the Road-Core Service as a sidecar container for interfacing with LLM providers. The updated architecture removes and replaces {rcs-short} with the new {lcs-name} and Llama Stack server, and requires new configurations for the plugins, volumes, containers, and secrets. +==== .Prerequisites -* You are logged into your {ocp-short} account. -* You have an {product-very-short} instance installed either of the following ways: -** {installing-on-ocp-book-link}#assembly-install-rhdh-ocp-operator[Using the Operator] -** {installing-on-ocp-book-link}#assembly-install-rhdh-ocp-helm[Using the Helm chart] + +* You are logged in to your {ocp-short} account. +* You have an {product-very-short} instance installed using either the Operator or the Helm chart. +* You have created a {installing-and-viewing-plugins-book-link}##rhdh-installing-rhdh-plugins_title-plugins-rhdh-about[custom dynamic plugins ConfigMap]. .Procedure -. Create the {rcs-short} ConfigMap. -.. In the {ocp-short} web console, go to your {product-very-short} instance and select the *ConfigMaps* tab. +You must manually install and configure the {ls-short} plugin, the {lcs-name} ({lcs-short}) sidecar container, and the Llama Stack sidecar container. + +. Create the {lcs-name} ({lcs-short}) ConfigMap: The {lcs-short} ConfigMap stores the configuration for the {lcs-name} and is mounted to the {lcs-short} container. + +.. In the {ocp-short} web console, navigate to your {product-very-short} instance and select the *ConfigMaps* tab. .. Click *Create ConfigMaps*. -.. From the *Create ConfigMap* page, select the *YAML view* option in *Configure via*, and edit the file as shown in the following example: +.. From the *Create ConfigMap* page, select the *YAML view* option and edit the file using the following structure. This example demonstrates the configuration for the {lcs-short} ConfigMap, typically named `lightspeed-stack`, which connects to the Llama Stack service locally on port `8321`: + [source,yaml] ---- kind: ConfigMap apiVersion: v1 metadata: - name: rcsconfig - namespace: __ # Enter your namespace (For example, `rhdh`) + name: lightspeed-stack data: - rcsconfig.yaml: | - llm_providers: - # Start: Do not remove this block - - name: dummy - type: openai - url: https://dummy.com - models: - - name: dummymodel - # End: Do not remove this block - ols_config: + lightspeed-stack.yaml: | + name: Lightspeed Core Service (LCS) + service: + host: 0.0.0.0 + port: ${LIGHTSPEED_SERVICE_PORT} + auth_enabled: false + workers: 1 + color_log: true + access_log: true + llama_stack: + use_as_library_client: false + url: http://localhost:8321 user_data_collection: - log_level: "DEBUG" - feedback_disabled: false - feedback_storage: "/tmp/feedback" - reference_content: - product_docs_index_path: "./vector_db/rhdh_product_docs/1.7" - product_docs_index_id: rhdh-product-docs-1_7 - embeddings_model_path: "./embeddings_model" - conversation_cache: - type: memory - memory: - max_entries: 1000 - logging_config: - app_log_level: info - lib_log_level: warning - uvicorn_log_level: info - suppress_metrics_in_log: false - suppress_auth_checks_warning_in_log: false - authentication_config: + feedback_enabled: true + feedback_storage: "/tmp/data/feedback" + transcripts_enabled: true + transcripts_storage: "/tmp/data/transcripts" + authentication: module: "noop" - default_provider: dummy - default_model: dummymodel - query_validation_method: disabled - dev_config: - enable_dev_ui: false - disable_auth: false - disable_tls: true - enable_system_prompt_override: true - user_data_collector_config: - user_agent: "example-user-agent" - ingress_url: "https://example.ingress.com/upload" + conversation_cache: + type: "sqlite" + sqlite: + db_path: "./lcs_cache.db" + mcp_servers: + - name: mcp::backstage + provider_id: model-context-protocol + url: https:///api/mcp-actions/v1 ---- + -[IMPORTANT] +where: + +`{product-very-short}_HOST`:: Enter the hostname for {product-very-short}. ++ +[NOTE] ==== -Do not remove the block in the `llm_providers` section. This requirement is crucial when working with {ls-short} because of limitations discovered in Road Core. If you decide to use an alternative LLM provider, you should refer to additional information in the guide. For more information, see {developer-lightspeed-link}#proc-changing-your-llm-provider_customizing-developer-lightspeed[Changing your LLM provider]. +The {lcs-short} ConfigMap can optionally include configuration for `mcp_servers` to enable MCP integration. ==== -.. Optional: Configure the number of workers that scale the REST API by specifying the following example to the `ols_config.max_workers` parameter in the {rcs-short} ConfigMap. + +.. Click *Create*. + +. Create an MCP_TOKEN. +.. https://backstage.io/docs/auth/service-to-service-auth/#static-tokens[Generate the external static token]. +.. Create a secret file as shown in the following example: + [source,yaml] ---- -ols_config: - max_workers: __ +apiVersion: v1 +kind: Secret +metadata: + name: lightspeed-secrets + namespace: <_your_namespace_> +type: Opaque +stringData: + MCP_TOKEN: <_your_static_token> ---- -.. Click *Create*. -. Create the {ls-short} ConfigMap. -+ -[NOTE] -==== -Create a dedicated {ls-short} ConfigMap instead of adding an additional section to your existing {product-very-short} custom application configuration file (for example, `lightspeed-app-config.yaml`). Creating two files prevents the entire {product-very-short} ConfigMap from being loaded into {rcs-short}. -==== -.. In the {ocp-short} web console, go to your {product-very-short} instance and select the *ConfigMaps* tab. +. Create the {ls-short} ConfigMap: Create a dedicated {ls-short} ConfigMap (`lightspeed-app-config`) to hold specific plugin configurations. +.. In the {ocp-short} web console, navigate to your {product-very-short} instance and select the *ConfigMaps* tab. .. Click *Create ConfigMap*. -.. From the *Create ConfigMap* page, select the *YAML view* option in *Configure via*, and add the following example: +.. From the *Create ConfigMap* page, select the *YAML view* option and add the following example: + -[source,yaml,subs="+attributes"] +[source,yaml] ---- kind: ConfigMap apiVersion: v1 metadata: name: lightspeed-app-config - namespace: <__namespace__> # Enter your {product-very-short} instance namespace + namespace: <__namespace__> # Enter your RHDH instance namespace data: app-config.yaml: |- backend: csp: - upgrade-insecure-requests: false - img-src: + upgrade-insecure-requests: false + img-src: - "'self'" - "data:" - https://img.freepik.com - https://cdn.dribbble.com - https://avatars.githubusercontent.com # This is to load GitHub avatars in the UI - script-src: - - "'self'" - - https://cdn.jsdelivr.net + script-src: + - "'self'" + - https://cdn.jsdelivr.net lightspeed: - # REQUIRED: Configure LLM servers with OpenAI API compatibility - servers: - - id: ${LLM_SERVER_ID} - url: ${LLM_SERVER_URL} - token: ${LLM_SERVER_TOKEN} - - # OPTIONAL: Enable/disable question validation (default: true) - # When enabled, restricts questions to RHDH-related topics for better security - questionValidation: true + mcpServers: + - name: mcp::backstage + token: ${MCP_TOKEN} # OPTIONAL: Custom users prompts displayed to users # If not provided, the plugin uses built-in default prompts prompts: - - title: 'Getting Started with {product}' + - title: `Getting Started with Red Hat Developer Hub` message: Can you guide me through the first steps to start using {product-short} as a developer, like exploring the Software Catalog and adding my service? # OPTIONAL: Port for lightspeed service (default: 8080) # servicePort: ${LIGHTSPEED_SERVICE_PORT} # OPTIONAL: Override default RHDH system prompt - # systemPrompt: "You are a helpful assistant focused on {product} development." + # systemPrompt: "You are a helpful assistant focused on Red Hat Developer Hub development." ---- -. Create {ls-short} secret file. + +.. Click *Create*. + +. Create Llama Stack Secret file: This Secret file holds sensitive configuration data for your LLM provider and Llama Stack environment variables. This secret is typically named `llama-stack-secrets`. + .. In the {ocp-short} web console, go to *Secrets*. -.. Click *Create > Key/value secret*. -.. In the *Create key/value secret* page, select the *YAML view* option in *Configure via*, and add the following example: +.. Click *Create* -> *Key/value secret*. +.. In the *Create key/value secret* page, select the *YAML view* option and add the following example: + [source,yaml] ---- -kind: Secret apiVersion: v1 +kind: Secret metadata: - name: lightspeed-secrets - namespace: __ # Enter your rhdh instance namespace -stringData: - LLM_SERVER_ID: __ # Enter your server ID (for example, `ollama` or `granite`) - LLM_SERVER_TOKEN: __ # Enter your server token value - LLM_SERVER_URL: __ # Enter your server URL + name: llama-stack-secrets type: Opaque +stringData: + VLLM_URL: "" + VLLM_API_KEY: "" + VLLM_MAX_TOKENS: "" + VLLM_TLS_VERIFY: "" + OLLAMA_URL: "" + OPENAI_API_KEY: "" + VALIDATION_PROVIDER: "" + VALIDATION_MODEL_NAME: "" ---- ++ +where: + +`VLLM_URL`:: Set this if you are using the `redhat-ai-dev` Llama Stack image +`VLLM_API_KEY`:: Set this if you are using the `redhat-ai-dev` Llama Stack image +`VLLM_MAX_TOKENS`:: Optional +`VLLM_TLS_VERIFY`:: Optional +`OLLAMA_URL`:: Set this if you altered the `run.yaml` file +`OPENAI_API_KEY`:: Set this if you altered the `run.yaml` file +`VALIDATION_PROVIDER`:: Set this as `vllm`, `ollama`, `openai`, depending on the key you have set in this configuration file +`VALIDATION_MODEL_NAME`:: Set the name of the model you want to use for validation + .. Click *Create*. -. To your existing dynamic plugins ConfigMap (for example, `dynamic-plugins-rhdh.yaml`), add the {ls-short} plugin image as shown in the following example: -+ -[source,yaml,subs="+attributes"] ----- -includes: - - dynamic-plugins.default.yaml - plugins: - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed:bs_1.39.1__0.5.7!red-hat-developer-hub-backstage-plugin-lightspeed - disabled: false - pluginConfig: - lightspeed: - # OPTIONAL: Custom users prompts displayed to users - # If not provided, the plugin uses built-in default prompts - prompts: - - title: 'Getting Started with {product}' - message: Can you guide me through the first steps to start using {product-short} - as a developer, like exploring the Software Catalog and adding my - service? - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-lightspeed: - appIcons: - - name: LightspeedIcon - module: LightspeedPlugin - importName: LightspeedIcon - dynamicRoutes: - - path: /lightspeed - importName: LightspeedPage - module: LightspeedPlugin - menuItem: - icon: LightspeedIcon - text: Lightspeed - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed-backend:bs_1.39.1__0.5.7!red-hat-developer-hub-backstage-plugin-lightspeed-backend - disabled: false - pluginConfig: - lightspeed: - # REQUIRED: Configure LLM servers with OpenAI API compatibility - servers: - - id: ${LLM_SERVER_ID} - url: ${LLM_SERVER_URL} - token: ${LLM_SERVER_TOKEN} - - # OPTIONAL: Port for lightspeed service (default: 8080) - # servicePort: ${LIGHTSPEED_SERVICE_PORT} ----- - -. Update your deployment configuration based on your installation method: -.. For an Operator-installed {product-very-short} instance, update your {product-custom-resource-type} custom resource (CR). -... In the `spec.application.appConfig.configMaps` section, add the {ls-short} custom app configuration as shown in the following example: +. Update the dynamic plugins ConfigMap: Add the {ls-short} plugin image to your existing dynamic plugins ConfigMap (`dynamic-plugins-rhdh`). + [source,yaml] ---- - appConfig: - configMaps: - - name: lightspeed-app-config - mountPath: /opt/app-root/src +includes: +- dynamic-plugins.default.yaml +plugins: +- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed:next__1.0.1!red-hat-developer-hub-backstage-plugin-lightspeed + disabled: false + pluginConfig: + lightspeed: + # OPTIONAL: Custom users prompts displayed to users + prompts: + - title: 'Getting Started with Red Hat Developer Hub' + message: Can you guide me through the first steps to start using Developer Hub as a developer, like exploring the Software Catalog and adding my service? + dynamicPlugins: + frontend: + red-hat-developer-hub.backstage-plugin-lightspeed: + appIcons: + - name: LightspeedIcon + module: LightspeedPlugin + importName: LightspeedIcon + dynamicRoutes: + - path: /lightspeed + importName: LightspeedPage + module: LightspeedPlugin + menuItem: + icon: LightspeedIcon + text: Lightspeed +- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed-backend:next__1.0.1!red-hat-developer-hub-backstage-plugin-lightspeed-backend + disabled: false ---- -... Update the `extraVolumes` specification to include the {rcs-short} ConfigMap as shown in the following example: + +. Update your deployment configuration: Update the deployment configuration based on how your {product-very-short} instance was installed. You must add two sidecar containers: `llama-stack` and `lightspeed-core`. + +** For an Operator-installed {product-very-short} instance (Update {backstage} Custom Resource (CR)): + +... In the `spec.application.appConfig.configMaps` section of your {backstage} CR, add the {ls-short} custom app configuration: + [source,yaml] ---- - volumes: - - configMap: - name: rcsconfig - name: rcsconfig + appConfig: + configMaps: + - name: lightspeed-app-config ---- -... Update the `volumeMounts` specification to mount the {rcs-short} ConfigMap as shown in the following example: +... Update the `spec.deployment.patch.spec.template.spec.volumes` specification to include volumes for {lcs-short} configuration (`lightspeed-stack`), shared storage for feedback (`shared-storage`), and RAG data (`rag-data-volume`): + [source,yaml] ---- - volumeMounts: - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig - subPath: rcsconfig.yaml - - mountPath: /app-root/config/app-config-rhdh.yaml - name: lightspeed-app-config - subPath: app-config.yaml ----- -... Add the {ls-short} Secret file as shown in the following example: -+ + volumes: + - configMap: + name: lightspeed-stack + name: lightspeed-stack + - emptyDir: {} + name: shared-storage + - emptyDir: {} + name: rag-data-volume +---- +... Add the `initContainers` section to initialize RAG data: [source,yaml] ++ ---- - envFrom: - - secretRef: - name: lightspeed-secrets + initContainers: + - name: init-rag-data + image: 'quay.io/redhat-ai-dev/rag-content:release-1.7-lcs' + command: + - "sh" + - "-c" + - "echo 'Copying RAG data...'; cp -r /rag/vector_db/rhdh_product_docs /data/ && cp -r /rag/embeddings_model /data/ && echo 'Copy complete.'" + volumeMounts: + - mountPath: /data + name: rag-data-volume ---- -... In your `deployment.patch.spec.template.spec.containers.env` section, set the {rcs-short} environment variables as shown in the following example: +... Add the Llama Stack, {lcs-short} containers, and the MCP_TOKEN secret file to the `spec.deployment.patch.spec.template.spec.containers` section: + [source,yaml] ---- - - name: PROJECT - value: rhdh - - name: RCS_CONFIG_FILE - value: /app-root/config/rcsconfig.yaml - - name: RHDH_CONFIG_FILE - value: /app-root/config/app-config-rhdh.yaml + spec: + application: + - extraEnvs: + secrets: + - name: lightspeed-secrets + containers: + # ... Your existing RHDH container definition ... + - envFrom: + - secretRef: + name: llama-stack-secrets + image: 'quay.io/redhat-ai-dev/llama-stack:0.1.0' # Llama Stack image + name: llama-stack + volumeMounts: + - mountPath: /app-root/.llama + name: shared-storage + - mountPath: /app-root/embeddings_model + name: rag-data-volume + subPath: embeddings_model + - mountPath: /app-root/vector_db/rhdh_product_docs + name: rag-data-volume + subPath: rhdh_product_docs + - image: 'quay.io/lightspeed-core/lightspeed-stack:dev-20251021-ee9f08f' # Lightspeed Core Service image + name: lightspeed-core + volumeMounts: + - mountPath: /app-root/lightspeed-stack.yaml + name: lightspeed-stack + subPath: lightspeed-stack.yaml + - mountPath: /tmp/data/feedback + name: shared-storage ---- -+ -[NOTE] -==== -Your {product-very-short} container is typically already present in your CR. You are adding the second container definition `road-core-sidecar` as the {rcs-short} sidecar. -==== ... Click *Save*. The Pods are automatically restarted. -+ -.Example of a Backstage CR with the {rcs-short} container -[source,yaml,subs=+attributes] ----- -apiVersion: rhdh.redhat.com/v1alpha3 -kind: Backstage -metadata: - name: backstage - namespace: __ # your {product-very-short} instance namespace -spec: - application: - appConfig: - configMaps: -# Adding the Developer Lightspeed custom app config file - - name: lightspeed-app-config - mountPath: /opt/app-root/src - dynamicPluginsConfigMapName: dynamic-plugins-rhdh - extraEnvs: -# Adding the Developer Lightspeed secrets file - secrets: - - name: lightspeed-secrets - replicas: 1 - extraFiles: - mounthPath: /opt/app-root/src - replicas: 1 - route: - enabled: true - database: - enableLocalDb: true - deployment: - patch: - spec: - template: - spec: - containers: - - env: - - name: PROJECT - value: rhdh -# Mounting the RCS sidecar to your {product-very-short} instance - - name: RCS_CONFIG_FILE - value: /app-root/config/rcsconfig.yaml -# Your existing {product-very-short} ConfigMap - - name: RHDH_CONFIG_FILE - value: /app-root/config/app-config-rhdh.yaml - envFrom: - - secretRef: - name: lightspeed-secrets - image: 'quay.io/redhat-ai-dev/road-core-service:rcs-06302025-rhdh-1.7' - name: road-core-sidecar - ports: - - containerPort: 8080 - name: rcs-backend - protocol: TCP - volumeMounts: -# Mounting the RCS sidecar to your {product-very-short} instance - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig - subPath: rcsconfig.yaml -# Mounting the Lightspeed app config file to your RCS container - - mountPath: /app-root/config/app-config-rhdh.yaml - name: lightspeed-app-config - subPath: app-config.yaml - volumes: - - configMap: - name: rcsconfig - name: rcsconfig - ----- -.. For a Helm-installed {product-very-short} instance, update your Helm chart. -... Add your dynamic plugins configuration in the`global.dynamic` property as shown in the following example: -+ -[source,yaml,subs="+attributes"] ----- -global: -dynamic: - includes: - - dynamic-plugins.default.yaml - plugins: - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed:bs_1.39.1__0.5.7!red-hat-developer-hub-backstage-plugin-lightspeed - disabled: false - pluginConfig: - lightspeed: - # OPTIONAL: Custom users prompts displayed to users - # If not provided, the plugin uses built-in default prompts - prompts: - - title: 'Getting Started with {product}' - message: Can you guide me through the first steps to start using {product-short} - as a developer, like exploring the Software Catalog and adding my - service? - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-lightspeed: - appIcons: - - name: LightspeedIcon - module: LightspeedPlugin - importName: LightspeedIcon - dynamicRoutes: - - path: /lightspeed - importName: LightspeedPage - module: LightspeedPlugin - menuItem: - icon: LightspeedIcon - text: Lightspeed - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed-backend:bs_1.39.1__0.5.7!red-hat-developer-hub-backstage-plugin-lightspeed-backend - disabled: false - pluginConfig: - lightspeed: - # REQUIRED: Configure LLM servers with OpenAI API compatibility - servers: - - id: ${LLM_SERVER_ID} - url: ${LLM_SERVER_URL} - token: ${LLM_SERVER_TOKEN} - # OPTIONAL: Port for lightspeed service (default: 8080) - # servicePort: ${LIGHTSPEED_SERVICE_PORT} ----- -... Add your {ls-short} custom app config file as shown in the following example: + +** For a Helm-installed {product-very-short} instance (Update Helm Chart): + +... Add your dynamic plugins configuration in the `global.dynamic` property. +... Add your {ls-short} custom app config file to `extraAppConfig`: + [source,yaml] ---- - extraAppConfig: + extraAppConfig: - configMapRef: lightspeed-app-config filename: app-config.yaml ---- -... Update the `extraVolumes` section to include the {rcs-short} ConfigMap as shown in the following example: +... Add the Llama Stack Secret file to `extraEnvVarsSecrets`: + [source,yaml] ---- -extraVolumes: - - configMap: - name: rcsconfig - name: rcsconfig + extraEnvVarsSecrets: + - llama-stack-secrets ---- -... Update the `extraVolumeMounts` section to mount the {rcs-short} ConfigMap as shown in the following example: +... Update the `extraVolumes` section to include the {lcs-short} ConfigMap (`lightspeed-stack`), shared storage, and RAG data volume: + [source,yaml] ---- - extraVolumeMounts: - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig ----- -... Add the {ls-short} Secret file as shown in the following example: + extraVolumes: + - configMap: + name: lightspeed-stack + name: lightspeed-stack + - emptyDir: {} + name: shared-storage + - emptyDir: {} + name: rag-data-volume +---- +... Update the `initContainers` section (if supported by your Helm chart structure) to initialize RAG data. + [source,yaml] ---- - extraEnvVarsSecrets: - - lightspeed-secrets ----- -... Add the {rcs-short} image as shown in the following example: -+ -[source,yaml,subs="+attributes"] ----- - extraContainers: - - env: - - name: PROJECT - value: rhdh - - name: RCS_CONFIG_FILE - value: /app-root/config/rcsconfig.yaml - - name: RHDH_CONFIG_FILE - value: /app-root/config/lightspeed-app-config.yaml - envFrom: - - secretRef: - name: lightspeed-secrets - image: 'quay.io/redhat-ai-dev/road-core-service:rcs-06302025-rhdh-1.7' - name: road-core-sidecar - ports: - - containerPort: 8080 - name: rcs-backend - protocol: TCP + initContainers: + - name: init-rag-data + image: 'quay.io/redhat-ai-dev/rag-content:release-1.7-lcs' + command: + - "sh" + - "-c" + - "echo 'Copying RAG data...'; cp -r /rag/vector_db/rhdh_product_docs /data/ && cp -r /rag/embeddings_model /data/ && echo 'Copy complete.'" volumeMounts: - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig - subPath: rcsconfig.yaml - - mountPath: /app-root/config/lightspeed-app-config.yaml - name: lightspeed-app-config - subPath: app-config.yaml + - mountPath: /data + name: rag-data-volume ---- +... Add the Llama Stack and {lcs-short} container definitions to `extraContainers` + [NOTE] ==== -Your {product-very-short} container is typically already present in your Helm chart. You are adding the second container definition `road-core-sidecar` as the {rcs-short} sidecar. +If you have Road-Core Service installed from the previous {ls-brand-name} configuration, you must replace the older single container configuration found in source with the two sidecars. ==== -... Click *Save*. -... Click *Helm upgrade*. + -.Example of a Helm chart with the RCS container -[source,yaml,subs="+attributes"] ----- -global: - ... -upstream: - backstage: - appConfig: - ... - args: - ... - extraAppConfig: - - configMapRef: lightspeed-app-config - filename: app-config.yaml - extraContainers: - - env: - - name: PROJECT - value: rhdh - - name: RCS_CONFIG_FILE - value: /app-root/config/rcsconfig.yaml - - name: RHDH_CONFIG_FILE - value: /app-root/config/lightspeed-app-config.yaml - envFrom: - - secretRef: - name: lightspeed-secrets - image: 'quay.io/redhat-ai-dev/road-core-service:rcs-06302025-rhdh-1.7' - name: road-core-sidecar - ports: - - containerPort: 8080 - name: rcs-backend - protocol: TCP - volumeMounts: - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig - subPath: rcsconfig.yaml - - mountPath: /app-root/config/lightspeed-app-config.yaml - name: lightspeed-app-config - subPath: lightspeed-app-config.yaml - extraEnvVars: - ... - extraEnvVarsSecrets: - - lightspeed-secrets - extraVolumeMounts: - - mountPath: /app-root/config/rcsconfig.yaml - name: rcsconfig - extraVolumes: - - configMap: - name: rcsconfig - name: rcsconfig - ... - image: - ... - initContainers: - ... ----- - -. Define permissions and roles for your users who are not administrators by completing the following steps: -.. Configure the required RBAC permission by defining an `rbac-policies.csv` file as shown in the following example: +[source, yaml] +---- + extraContainers: + # Llama Stack Container + - envFrom: + - secretRef: + name: llama-stack-secrets + image: 'quay.io/redhat-ai-dev/llama-stack:0.1.0' + name: llama-stack + volumeMounts: + - mountPath: /app-root/.llama + name: shared-storage + - mountPath: /app-root/embeddings_model + name: rag-data-volume + subPath: embeddings_model + - mountPath: /app-root/vector_db/rhdh_product_docs + name: rag-data-volume + subPath: rhdh_product_docs + # Lightspeed Core Service Container + - image: 'quay.io/lightspeed-core/lightspeed-stack:dev-20251021-ee9f08f' + name: lightspeed-core + volumeMounts: + - mountPath: /app-root/lightspeed-stack.yaml + name: lightspeed-stack + subPath: lightspeed-stack.yaml + - mountPath: /tmp/data/feedback + name: shared-storage +---- +... Click *Save* and then Helm upgrade. + +. Optional: Manage authorization (RBAC): If you have users who are not administrators, you must {authorization-book-link}##enabling-and-giving-access-to-rbac[define permissions and roles] for them to use {ls-short}. The Lightspeed Backend plugin uses {backstage} RBAC for authorization. + +** For an Operator-installed {product-very-short} instance: + +... Configure the required RBAC permission by defining an `rbac-policies.csv` file, including `lightspeed.chat.read`, `lightspeed.chat.create`, and `lightspeed.chat.delete` permissions: + -[source,yaml] +[source,csv] ---- p, role:default/__, lightspeed.chat.read, read, allow p, role:default/__, lightspeed.chat.create, create, allow p, role:default/__, lightspeed.chat.delete, delete, allow - g, user:default/__, role:default/__ ---- -.. Upload your `rbac-policies.csv` and `rbac-conditional-policies.yaml` files to an `rbac-policies` config map in your {ocp-short} project containing {product-very-short}. -.. Update your {product-custom-resource-type} custom resource to mount in the {product-very-short} filesystem your files from the `rbac-policies` ConfigMap: +... Upload your `rbac-policies.csv` file to an `rbac-policies` ConfigMap in your {ocp-short} project containing {product-very-short} and update your Backstage CR: + [source,yaml] ---- @@ -525,11 +401,33 @@ spec: configMaps: - name: rbac-policies ---- -For detailed information, see {authorization-book-link}managing-authorizations-by-using-external-files[Managing authorizations by using external files]. + +** For a Helm-installed {product-very-short} instance: + +... Configure the required RBAC permission by defining an `rbac-policies.csv` file: ++ +[source,csv] +---- +p, role:default/__, lightspeed.chat.read, read, allow +p, role:default/__, lightspeed.chat.create, create, allow +p, role:default/__, lightspeed.chat.delete, delete, allow +g, user:default/__, role:default/__ +---- +... Optional: Declare policy administrators by editing your custom {product-very-short} ConfigMap (`app-config.yaml`) and adding the following code to enable selected authenticated users to configure RBAC policies through the REST API or Web UI: ++ +[source,yaml] +---- + permission: + enabled: true + rbac: + policies-csv-file: /opt/app-root/src/rbac-policies.csv + policyFileReload: true + admin: + users: + - name: user:default/ +---- .Verification . Log in to your {product-very-short} instance. -. In your {product} navigation menu, you are able to see and access the *Lightspeed* menu item. Clicking this menu takes you to the {ls-short} screen. - -image::rhdh-plugins-reference/developer-lightspeed.png[] +. In your {product-very-short} navigation menu, you are able to see and access the *Lightspeed* menu item. Clicking this menu item takes you to the {ls-short} screen. \ No newline at end of file diff --git a/modules/developer-lightspeed/proc-updating-the-system-prompt.adoc b/modules/developer-lightspeed/proc-updating-the-system-prompt.adoc index 79859cda51..16d8809608 100644 --- a/modules/developer-lightspeed/proc-updating-the-system-prompt.adoc +++ b/modules/developer-lightspeed/proc-updating-the-system-prompt.adoc @@ -13,7 +13,7 @@ You can override the default system prompt that {ls-short} uses to better frame ---- lightspeed: # ... other lightspeed configurations - systemPrompt: "You are a helpful assistant focused on {product} development." + systemPrompt: "You are a helpful assistant focused on Red Hat Developer Hub development." ---- Set `systemPrompt` to prefix all queries sent by {ls-short} to the LLM with this instruction, guiding the model to generate more tailored responses. diff --git a/modules/developer-lightspeed/proc-using-developer-lightspeed-to-start-a-chat-for-the-first-time.adoc b/modules/developer-lightspeed/proc-using-developer-lightspeed-to-start-a-chat-for-the-first-time.adoc index 4060c9149e..cca792576a 100644 --- a/modules/developer-lightspeed/proc-using-developer-lightspeed-to-start-a-chat-for-the-first-time.adoc +++ b/modules/developer-lightspeed/proc-using-developer-lightspeed-to-start-a-chat-for-the-first-time.adoc @@ -5,7 +5,7 @@ You can start a chat with {ls-short} for quick answers on a number of topics depending on your settings. You can manually start a chat with the {ls-short} or use the following sample prompts we have provided to help you get started: -* *Getting Started with {product-custom-resource-type}* +* *Getting Started with Red Hat Developer Hub* * *Deploy with Tekton* * *Create an OpenShift Deployment* @@ -23,7 +23,7 @@ You can start a chat with {ls-short} for quick answers on a number of topics dep + [NOTE] ==== -The following file types are supported: `yaml`, `json`, `txt`, and `xml`. +The following file types are supported: `yaml`, `json`, and `txt`. ==== *** Click *Open*. ** To start a chat using the existing prompts, in the {ls-short} virtual assistant interface, click any of the relevant prompt tiles. diff --git a/modules/developer-lightspeed/proc-using-question-validation.adoc b/modules/developer-lightspeed/proc-using-question-validation.adoc deleted file mode 100644 index 0d2c7271e4..0000000000 --- a/modules/developer-lightspeed/proc-using-question-validation.adoc +++ /dev/null @@ -1,20 +0,0 @@ -:_mod-docs-content-type: PROCEDURE - -[id="proc-using-question-validation_{context}"] -= Using Question Validation in {ls-short} - -{ls-short} utilizes *Question Validation* to validate the query to check if it relates to {product}. - -When a user asks a question that falls outside of these restricted topics, {ls-short} provides a general response to notify the user that the question is out of scope. -If you want to disable the *Question Validation* feature to allow for broader questioning, you can set `questionValidation` to `false` in your {ls-short} app config file. - -.Procedure - -* To disable the *Question Validation* feature, in your {ls-short} `{my-app-config-file}` file, add the following example: -+ -[source,yaml] ----- -lightspeed: - # ... other lightspeed configurations - questionValidation: false -----