You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/byok_guide.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,9 +105,9 @@ Before implementing BYOK, ensure you have:
105
105
-**LLM Provider**: OpenAI, vLLM, or other supported inference provider
106
106
107
107
### Knowledge Sources
108
-
-**Directly supported**: Markdown (.md) and plain text (.txt) files
109
-
-**Requires conversion**: PDFs, AsciiDoc, HTML, and other formats must be converted to markdown or TXT
110
-
- Documentation, manuals, FAQs, knowledge bases (after format conversion)
108
+
-**Directly supported**: Markdown (`.md`), plain text (`.txt`), PDF (`.pdf`), and HTML (`.html`/`.htm`) files. PDF and HTML are converted to Markdown automatically by [`rag-content`](https://github.com/lightspeed-core/rag-content) (via docling) — no manual pre-conversion step is needed. See the rag-content README's [Supported Input Formats](https://github.com/lightspeed-core/rag-content#supported-input-formats) section.
109
+
-**Requires conversion**: AsciiDocand other formats must be converted to Markdown or plain text first.
110
+
- Documentation, manuals, FAQs, knowledge bases
111
111
112
112
---
113
113
@@ -116,11 +116,10 @@ Before implementing BYOK, ensure you have:
116
116
### Step 1: Prepare Your Knowledge Sources
117
117
118
118
1.**Collect your documents**: Gather all knowledge sources you want to include
119
-
2.**Convert formats**: Convert non-supported formats to markdown (.md) or plain text (.txt)
120
-
-**PDF conversion**: Use tools like [docling](https://github.com/DS4SD/docling) to convert PDFs to markdown
121
-
-**Adoc conversion**: Use [custom scripts](https://github.com/openshift/lightspeed-rag-content/blob/main/scripts/asciidoctor-text/convert-it-all.py) to convert AsciiDoc to plain text
122
-
3.**Organize content**: Structure your converted documents for optimal indexing
123
-
4.**Format validation**: Ensure all documents are in supported formats (.md or .txt)
119
+
2.**Markdown, text, PDF, and HTML ingest directly**: Place `.md`, `.txt`, `.pdf`, and `.html` files in your input directory and pass them to `rag-content` with the matching document type (`-t pdf` or `-t html`). `rag-content` converts PDF and HTML to Markdown for you via docling — no manual pre-conversion step is required.
120
+
-**PDF note**: Scanned / image-only PDFs are out of scope (OCR is disabled); they index as empty and `rag-content` logs a warning naming the file. Run such PDFs through a separate OCR step first.
121
+
-**AsciiDoc and other formats**: Convert to Markdown or plain text first — e.g. use [custom scripts](https://github.com/openshift/lightspeed-rag-content/blob/main/scripts/asciidoctor-text/convert-it-all.py) for AsciiDoc.
122
+
3.**Organize content**: Structure your documents for optimal indexing
124
123
125
124
### Step 2: Create Vector Database
126
125
@@ -150,7 +149,7 @@ class CustomMetadataProcessor(MetadataProcessor):
150
149
**Important Notes:**
151
150
- Supported formats:
152
151
- Faiss Vector-IO
153
-
- The same embedding model must be used for both creation and querying
152
+
-**The embedding model (and its dimension) used to *build* the vector store must exactly match the one configured for querying** in the `byok_rag` section (see Step 3). A mismatch does not raise an error — it silently returns no or irrelevant results, because the query vector and the stored vectors are then incomparable. The default is `sentence-transformers/all-mpnet-base-v2` (dimension `768`).
# Validates that a vector store built from a PDF by rag-content's `pdf`
5
+
# module (LCORE-2091) is consumed correctly by lightspeed-stack: the BYOK
6
+
# source is registered and a query retrieves content that exists only in the
7
+
# source PDF. The fixture store (tests/e2e/rag/pdf_kv_store.db) holds a single
8
+
# deliberately-fabricated fact, so a correct answer can only come from the
9
+
# store, not from the LLM's own knowledge.
10
+
11
+
Background:
12
+
Given The service is started locally
13
+
And The system is in default state
14
+
And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
15
+
And REST API service prefix is /v1
16
+
And the Lightspeed stack configuration directory is "tests/e2e/configuration"
17
+
And The service uses the lightspeed-stack-byok-pdf.yaml configuration
18
+
And The service is restarted
19
+
20
+
Scenario: PDF-built inline RAG source is registered
21
+
When I access REST API endpoint rags using HTTP GET method
22
+
Then The status code of the response is 200
23
+
And the body of the response has the following structure
24
+
"""
25
+
{
26
+
"rags": [
27
+
"pdf-field-notes"
28
+
]
29
+
}
30
+
"""
31
+
32
+
Scenario: Query retrieves content sourced from the PDF
33
+
When I use "query" to ask question with authorization header
34
+
"""
35
+
{"query": "According to the field notes, what is the name of the mascot of Red Hat Lightspeed?", "system_prompt": "You are an assistant. Answer only from the provided context. Write only lowercase letters", "model": "{MODEL}", "provider": "{PROVIDER}"}
36
+
"""
37
+
Then The status code of the response is 200
38
+
And The response contains following fragments
39
+
| FragmentsinLLMresponse |
40
+
| zephyr |
41
+
And The response contains non-empty rag_chunks
42
+
43
+
Scenario: Streaming query retrieves content sourced from the PDF
44
+
When I use "streaming_query" to ask question with authorization header
45
+
"""
46
+
{"query": "According to the field notes, what is the name of the mascot of Red Hat Lightspeed?", "system_prompt": "You are an assistant. Answer only from the provided context. Write only lowercase letters", "model": "{MODEL}", "provider": "{PROVIDER}"}
47
+
"""
48
+
Then The status code of the response is 200
49
+
And I wait for the response to be completed
50
+
And The streamed response contains following fragments
0 commit comments