Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ spec:
echo "CDI devices:"
nvidia-ctk cdi list || true
fi
# Install required test deps
sudo dnf -y install python3 jq diffutils
cd $HOME/rag-content
SCRIPTEOF
# Inject env vars
Expand Down
32 changes: 10 additions & 22 deletions src/lightspeed_rag_content/config_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
image_name: starter

apis:
- agents
- files
- inference
- safety
- responses
- tool_runtime
- vector_io

Expand All @@ -44,21 +43,10 @@
storage_dir: /tmp/files
provider_id: meta-reference-files
provider_type: inline::localfs
agents:
- config:
persistence:
agent_state:
namespace: agents_state
backend: kv_default
responses:
table_name: agents_responses
backend: sql_default
provider_id: meta-reference
provider_type: inline::meta-reference
tool_runtime:
- config: {{}}
provider_id: rag-runtime
provider_type: inline::rag-runtime
provider_id: file-search
provider_type: inline::file-search
vector_io:
- config:
{vector_io_cfg}
Expand Down Expand Up @@ -99,13 +87,13 @@
scoring_fns: []
benchmarks: []
tool_groups:
- toolgroup_id: builtin::rag
provider_id: rag-runtime
- toolgroup_id: builtin::file-search
provider_id: file-search
"""

OGX_VECTOR_STORES_TEMPLATE = """vector_stores:
- embedding_dimension: {dimension}
embedding_model: sentence-transformers/{model_name_or_dir}
embedding_model: {model_name}
provider_id: {vector_io_provider_id}
vector_store_id: {vector_store_id}"""

Expand Down Expand Up @@ -169,8 +157,8 @@
db_path: ${{env.RAG_DB_PATH:={db_path}}}

rag:
# inline:
# - {index_id}
inline:
- {index_id}
tool:
- {index_id}
"""
Expand All @@ -189,8 +177,8 @@
password: ${{env.POSTGRES_PASSWORD}}

rag:
# inline:
# - {index_id}
inline:
- {index_id}
tool:
- {index_id}
"""
8 changes: 4 additions & 4 deletions src/lightspeed_rag_content/document_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ async def _insert_prechunked_documents( # pylint: disable=R0914
name=index,
extra_body={
"provider_id": index,
"embedding_model": f"sentence-transformers/{self.model_name_or_dir}",
"embedding_model": self.config.model_name,
"embedding_dimension": self.config.embedding_dimension,
},
)
Expand Down Expand Up @@ -543,7 +543,7 @@ async def upload_file(chunk_indices: list[int]) -> str:
# Compute embeddings
LOG.info("Computing embeddings for %d chunks...", len(self.documents))
chunks_to_insert = []
embedding_model = f"sentence-transformers/{self.model_name_or_dir}"
embedding_model = self.config.model_name

for idx, doc in enumerate(self.documents):
if isinstance(doc, dict):
Expand Down Expand Up @@ -587,7 +587,7 @@ async def _upload_and_process_files( # noqa: C901 # pylint: disable=R0912,R091
name=index,
extra_body={
"provider_id": index,
"embedding_model": f"sentence-transformers/{self.model_name_or_dir}",
"embedding_model": self.config.model_name,
"embedding_dimension": self.config.embedding_dimension,
},
)
Expand Down Expand Up @@ -726,7 +726,7 @@ def _update_yaml_config(self, cfg_file: str, index: str, vector_store_id: str) -
"""Update the config file with the created vector_store_id."""
vector_stores_section = self.VECTOR_STORES_TEMPLATE.format(
dimension=self.config.embedding_dimension,
model_name_or_dir=self.model_name_or_dir,
model_name=self.config.model_name,
vector_io_provider_id=index,
vector_store_id=vector_store_id,
)
Expand Down
37 changes: 13 additions & 24 deletions tests/integration-konflux/config/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ version: 2
image_name: starter

apis:
- agents
- files
- inference
- safety
- responses
- tool_runtime
- vector_io

Expand All @@ -27,26 +26,18 @@ providers:
storage_dir: /tmp/files
provider_id: meta-reference-files
provider_type: inline::localfs
safety:
- config:
excluded_categories: []
provider_id: llama-guard
provider_type: inline::llama-guard
agents:
responses:
- config:
persistence:
agent_state:
namespace: agents_state
backend: kv_default
responses:
table_name: agents_responses
backend: sql_default
provider_id: meta-reference
provider_type: inline::meta-reference
table_name: responses
provider_id: builtin-responses
provider_type: inline::builtin
tool_runtime:
- config: {}
provider_id: rag-runtime
provider_type: inline::rag-runtime
provider_id: file-search
provider_type: inline::file-search
vector_io: []

server:
Expand All @@ -70,6 +61,9 @@ storage:
conversations:
table_name: openai_conversations
backend: sql_default
responses:
table_name: responses
backend: sql_default

registered_resources:
models:
Expand All @@ -79,17 +73,12 @@ registered_resources:
provider_model_id: /embeddings
metadata:
embedding_dimension: 768
shields:
- shield_id: llama-guard
provider_id: llama-guard
provider_shield_id: openai/gpt-4o-mini
shields: []
vector_stores: []
tool_groups:
- toolgroup_id: builtin::rag
provider_id: rag-runtime
- toolgroup_id: builtin::file-search
provider_id: file-search

safety:
default_shield_id: llama-guard
vector_stores:
default_provider_id: faiss
default_embedding_model:
Expand Down
1 change: 1 addition & 0 deletions tests/integration-konflux/pipeline-konflux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ podman run -d --name lightspeed-stack-e2e \
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
-e RAG_DB_PATH=/opt/app-root/src/.llama/storage/rag/faiss_store.db \
-e HF_HOME=/embeddings \
-e OTEL_SDK_DISABLED=true \
${HF_TOKEN:+-e HF_TOKEN="$HF_TOKEN"} \
"$LIGHTSPEED_STACK_IMAGE"

Expand Down
22 changes: 5 additions & 17 deletions tests/test_document_processor_ogx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
image_name: starter

apis:
- agents
- files
- inference
- safety
- responses
- tool_runtime
- vector_io

Expand All @@ -50,21 +49,10 @@
storage_dir: /tmp/files
provider_id: meta-reference-files
provider_type: inline::localfs
agents:
- config:
persistence:
agent_state:
namespace: agents_state
backend: kv_default
responses:
table_name: agents_responses
backend: sql_default
provider_id: meta-reference
provider_type: inline::meta-reference
tool_runtime:
- config: {{}}
provider_id: rag-runtime
provider_type: inline::rag-runtime
provider_id: file-search
provider_type: inline::file-search
vector_io:
- config:
persistence:
Expand Down Expand Up @@ -107,8 +95,8 @@
scoring_fns: []
benchmarks: []
tool_groups:
- toolgroup_id: builtin::rag
provider_id: rag-runtime
- toolgroup_id: builtin::file-search
provider_id: file-search
"""


Expand Down
Loading