Skip to content

Commit ead48e8

Browse files
authored
Merge pull request lightspeed-core#1664 from tisnik/lcore-2099
LCORE-2099: Reformatted OKP docs
2 parents ee1a34f + ca2bcf4 commit ead48e8

1 file changed

Lines changed: 53 additions & 19 deletions

File tree

docs/okp_guide.md

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# OKP Deployment and Configuration Guide
22

3-
This document explains how to deploy the Offline Knowledge Portal (OKP) as a RAG source and configure Lightspeed Stack and Llama Stack to use it. You will:
3+
This document explains how to deploy the Offline Knowledge Portal (OKP) as a
4+
RAG source and configure Lightspeed Stack and Llama Stack to use it. You will:
45

56
* Deploy and verify the OKP Solr service
67
* Configure Lightspeed Stack for OKP (inline or tool RAG)
78
* Install dependencies and launch Lightspeed Stack
89
* Confirm the end-to-end stack with a sample query
910

10-
For general RAG concepts, BYOK vector stores, and manual Llama Stack configuration, see the [RAG Configuration Guide](rag_guide.md).
11+
For general RAG concepts, BYOK vector stores, and manual Llama Stack
12+
configuration, see the [RAG Configuration Guide](rag_guide.md).
1113

1214
---
1315

@@ -16,17 +18,22 @@ For general RAG concepts, BYOK vector stores, and manual Llama Stack configurati
1618
* [Introduction](#introduction)
1719
* [Prerequisites](#prerequisites)
1820
* [Step 1: Launch OKP](#step-1-launch-okp)
19-
* [Step 2: Setup llamamstack config environment variables](#step-2-setup-llamamstack-config-environment-variables)
21+
* [Step 2: Setup llamastack config environment variables](#step-2-setup-llamamstack-config-environment-variables)
2022
* [Step 3: Install Lightspeed Stack Dependencies](#step-3-install-lightspeed-stack-dependencies)
2123
* [Step 4: Configure Lightspeed Stack](#step-4-configure-lightspeed-stack)
22-
* [Step 5: Launch Lightspeed Stack](#step-6-launch-lightspeed-stack)
23-
* [Step 6: Verify the Stack](#step-7-verify-the-stack)
24+
* [Step 5: Launch Lightspeed Stack](#step-5-launch-lightspeed-stack)
25+
* [Step 6: Verify the Stack](#step-6-verify-the-stack)
2426

2527
---
2628

2729
## Introduction
2830

29-
OKP (Offline Knowledge Portal) provides a Solr-backed RAG source that Lightspeed Stack can use for both **Inline RAG** (context injected before the LLM request) and **Tool RAG** (context retrieved on demand via the `file_search` tool). This guide walks through deploying the OKP container, enriching your Llama Stack config from Lightspeed Stack settings, and validating that queries return referenced chunks.
31+
OKP (Offline Knowledge Portal) provides a Solr-backed RAG source that
32+
Lightspeed Stack can use for both **Inline RAG** (context injected before the
33+
LLM request) and **Tool RAG** (context retrieved on demand via the
34+
`file_search` tool). This guide walks through deploying the OKP container,
35+
enriching your Llama Stack config from Lightspeed Stack settings, and
36+
validating that queries return referenced chunks.
3037

3138
---
3239

@@ -42,7 +49,8 @@ OKP (Offline Knowledge Portal) provides a Solr-backed RAG source that Lightspeed
4249

4350
## Step 1: Launch OKP
4451

45-
> **Warning:** The image referenced below is a **prototype**. The official OKP RAG image is expected in **late March / early April** of 2026.
52+
> **Warning:** The image referenced below is a **prototype**. The official OKP
53+
> RAG image is expected in **late March / early April** of 2026.
4654
4755
Start the OKP RAG service with Podman:
4856

@@ -61,20 +69,29 @@ podman run --rm -d -p 8081:8080 registry.redhat.io/offline-knowledge-portal/rhok
6169

6270
Or visit: **http://localhost:8081**
6371

64-
> **Note:** Lightspeed stack will automatically enrich the llamastack configuration to add the necessary providers/resources for referencing OKP. This assumes your OKP instance is running on localhost:8081. If you need a different OKP url, you can set the SOLR_URL environment variable with the correct url prior to launching Lightspeed stack and that value will be used instead.
72+
> **Note:** Lightspeed stack will automatically enrich the llamastack
73+
> configuration to add the necessary providers/resources for referencing OKP.
74+
> This assumes your OKP instance is running on localhost:8081. If you need a
75+
> different OKP url, you can set the SOLR_URL environment variable with the
76+
> correct url prior to launching Lightspeed stack and that value will be used
77+
> instead.
6578
---
6679

6780
## Step 2: Setup llamastack config environment variables
6881

69-
Set the required environment variables. The external providers path must point to the `external_providers` content inside the [lightspeed-providers](https://github.com/lightspeed-core/lightspeed-providers/tree/main/lightspeed_stack_providers/) repository:
82+
Set the required environment variables. The external providers path must point
83+
to the `external_providers` content inside the
84+
[lightspeed-providers](https://github.com/lightspeed-core/lightspeed-providers/tree/main/lightspeed_stack_providers/)
85+
repository:
7086

7187
```bash
7288
export EXTERNAL_PROVIDERS_DIR=../lightspeed-providers/resources/external_providers
7389
export OPENAI_API_KEY=<your-openai-api-key>
7490
export RH_SERVER_OKP=http://localhost:8081
7591
```
7692

77-
Adjust `EXTERNAL_PROVIDERS_DIR` if your lightspeed-providers repo is in a different location relative to your lightspeed-stack directory.
93+
Adjust `EXTERNAL_PROVIDERS_DIR` if your lightspeed-providers repo is in a
94+
different location relative to your lightspeed-stack directory.
7895

7996
---
8097

@@ -90,16 +107,22 @@ uv pip install -e ../lightspeed-providers # Path to lightspeed-providers repo
90107
* **`uv sync`**: Installs project and dev/llslibdev groups so that the app and tooling run correctly.
91108
* **`uv pip install -e ../lightspeed-providers`**: Installs the lightspeed stack providers from the local clone of the repository. Adjust the directory path as needed.
92109

93-
> **Note:** Running `uv sync` will remove the lightspeed-providers dependency installed by the `uv pip install` command, so you will need to rerun the `uv pip install` command if you rerun `uv sync`.
110+
> **Note:** Running `uv sync` will remove the lightspeed-providers dependency
111+
> installed by the `uv pip install` command, so you will need to rerun the `uv
112+
> pip install` command if you rerun `uv sync`.
94113
95114
---
96115

97116
## Step 4: Configure Lightspeed Stack
98117

99118
### Enable OKP in Lightspeed Stack
100-
Edit your Lightspeed Stack config file (e.g. `lightspeed-stack.yaml`) and add the following top-level sections so that OKP is used for either inline or tool RAG:
119+
120+
Edit your Lightspeed Stack config file (e.g. `lightspeed-stack.yaml`) and add
121+
the following top-level sections so that OKP is used for either inline or tool
122+
RAG:
101123

102124
Inline RAG:
125+
103126
```yaml
104127
# RAG configuration
105128
rag:
@@ -111,6 +134,7 @@ okp:
111134
```
112135
113136
Tool RAG:
137+
114138
```yaml
115139
# RAG configuration
116140
rag:
@@ -124,19 +148,22 @@ okp:
124148
* **`rag.inline`** and **`rag.tool`**: Enable OKP as the RAG source for inline context injection and for the RAG tool. Tool rag means the LLM will be provided a search tool it can choose to invoke to find relevant content and augment the user prompt. The tool may or may not be invoked. Inline means a rag search and prompt augmentation will always occur.
125149
* **`okp.offline`**: When `true`, source URLs use `parent_id` (offline/Mimir-style). When `false`, use `reference_url` (online).
126150

127-
If you want to filter the docs to a specific product, you can include a query filter such as:
151+
If you want to filter the docs to a specific product, you can include a query
152+
filter such as:
128153

129154
```yaml
130155
okp:
131156
offline: true
132157
chunk_filter_query: "product:*openshift*"
133158
```
134159

135-
When you launch Lightspeed stack it will augment the Llamastack run.yaml with configuration for OKP.
160+
When you launch Lightspeed stack it will augment the Llamastack run.yaml with
161+
configuration for OKP.
136162

137163
### Configure Lightspeed Stack for library mode
138164

139-
For the simplest local development, configure `lightspeed-stack.yaml` to consume Llama Stack in library mode:
165+
For the simplest local development, configure `lightspeed-stack.yaml` to
166+
consume Llama Stack in library mode:
140167

141168
```yaml
142169
llama_stack:
@@ -153,13 +180,16 @@ llama_stack:
153180

154181
## Step 5: Launch Lightspeed Stack
155182

156-
Then launch Lightspeed Stack using your Lightspeed Stack config(`lightspeed-stack.yaml`) which references the provided default Llamastack config file (`run.yaml`):
183+
Then launch Lightspeed Stack using your Lightspeed Stack
184+
config(`lightspeed-stack.yaml`) which references the provided default
185+
Llamastack config file (`run.yaml`):
157186

158187
```bash
159188
make run
160189
```
161190

162-
Lightspeed Stack has launched successfully and is available when you see this log output:
191+
Lightspeed Stack has launched successfully and is available when you see this
192+
log output:
163193

164194
```log
165195
INFO 2026-03-17 11:20:31,347 uvicorn.error:62 uncategorized: Application startup complete.
@@ -170,7 +200,9 @@ INFO 2026-03-17 11:20:31,349 uvicorn.error:224 uncategorized: Uvicorn runnin
170200

171201
## Step 6: Verify the Stack
172202

173-
Confirm that the full stack (Lightspeed Stack + Llama Stack + OKP) is working by sending a query and checking that the response includes referenced chunks from OKP:
203+
Confirm that the full stack (Lightspeed Stack + Llama Stack + OKP) is working
204+
by sending a query and checking that the response includes referenced chunks
205+
from OKP:
174206

175207
```bash
176208
curl -sX POST http://localhost:8080/v1/query \
@@ -196,7 +228,9 @@ Example response excerpt:
196228
],
197229
```
198230

199-
> **Note:** The first time you query the system the response may take additional time because it must first download the necessary embedding model to perform the vector search.
231+
> **Note:** The first time you query the system the response may take
232+
> additional time because it must first download the necessary embedding model
233+
> to perform the vector search.
200234

201235
If you see no RAG context, verify:
202236

0 commit comments

Comments
 (0)