-
Notifications
You must be signed in to change notification settings - Fork 25
LCORE-2436: Update rag-content to generate lightspeed-stack config together with Llama Stack config #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
are-ces
wants to merge
5
commits into
lightspeed-core:main
Choose a base branch
from
are-ces:lcore-2436-lcs-config-output-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
LCORE-2436: Update rag-content to generate lightspeed-stack config together with Llama Stack config #219
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2461bfe
LCORE-2436: Generate lightspeed-stack.yaml config alongside llama-sta…
are-ces f314022
LCORE-2436: Generate full lightspeed-stack.yaml config, not just byok…
are-ces 8b495c1
LCORE-2436: Add agents/safety APIs to llama-stack config and rag stra…
are-ces bf80786
LCORE-2436: Extract config templates to separate module
are-ces 2f640e5
LCORE-2436: Update README with full lightspeed-stack.yaml example
are-ces File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| # Copyright 2025 Red Hat, Inc. | ||
| # All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| # not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| """Configuration templates for llama-stack and Lightspeed Core Stack output.""" | ||
|
|
||
| # llama-stack configuration templates | ||
|
|
||
| LLAMA_STACK_TEMPLATE = """version: 2 | ||
| image_name: starter | ||
|
|
||
| apis: | ||
| - agents | ||
| - files | ||
| - inference | ||
| - safety | ||
| - tool_runtime | ||
| - vector_io | ||
|
|
||
| server: | ||
| port: 8321 | ||
|
|
||
| providers: | ||
| inference: | ||
| - config: {{}} | ||
| provider_id: sentence-transformers | ||
| provider_type: inline::sentence-transformers | ||
| files: | ||
| - config: | ||
| metadata_store: | ||
| table_name: files_metadata | ||
| backend: sql_default | ||
| 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 | ||
| vector_io: | ||
| - config: | ||
| {vector_io_cfg} | ||
| provider_id: {index_id} | ||
| provider_type: {provider_type_prefix}::{provider_type} | ||
| storage: | ||
| backends: | ||
| kv_rag: | ||
| type: kv_sqlite | ||
| db_path: {kv_db_path} | ||
| kv_default: | ||
| type: kv_sqlite | ||
| db_path: /tmp/kv_store.db | ||
| sql_default: | ||
| type: sql_sqlite | ||
| db_path: /tmp/sql_store.db | ||
| stores: | ||
| metadata: | ||
| namespace: registry | ||
| backend: kv_default | ||
| inference: | ||
| table_name: inference_store | ||
| backend: sql_default | ||
| conversations: | ||
| table_name: openai_conversations | ||
| backend: sql_default | ||
| registered_resources: | ||
| models: | ||
| - metadata: | ||
| embedding_dimension: {dimension} | ||
| model_id: {model_name} | ||
| provider_id: sentence-transformers | ||
| provider_model_id: {model_name_or_dir} | ||
| model_type: embedding | ||
| vector_stores: [] | ||
| shields: [] | ||
| datasets: [] | ||
| scoring_fns: [] | ||
| benchmarks: [] | ||
| tool_groups: | ||
| - toolgroup_id: builtin::rag | ||
| provider_id: rag-runtime | ||
| """ | ||
|
|
||
| LLAMA_STACK_VECTOR_STORES_TEMPLATE = """vector_stores: | ||
| - embedding_dimension: {dimension} | ||
| embedding_model: sentence-transformers/{model_name_or_dir} | ||
| provider_id: {vector_io_provider_id} | ||
| vector_store_id: {vector_store_id}""" | ||
|
|
||
| LLAMA_STACK_VECTOR_IO_CONFIG_SQLITE = """persistence: | ||
| namespace: vector_io::{provider_type} | ||
| backend: kv_rag""" | ||
|
|
||
| LLAMA_STACK_VECTOR_IO_CONFIG_PGVECTOR = """persistence: | ||
| namespace: vector_io::{provider_type} | ||
| backend: kv_default | ||
| host: ${{env.POSTGRES_HOST}} | ||
| port: ${{env.POSTGRES_PORT}} | ||
| db: ${{env.POSTGRES_DATABASE}} | ||
| user: ${{env.POSTGRES_USER}} | ||
| password: ${{env.POSTGRES_PASSWORD}}""" | ||
|
|
||
| LLAMA_STACK_CFG_FILENAME = "llama-stack.yaml" | ||
|
|
||
| # Lightspeed Core Stack configuration templates | ||
|
|
||
| LCS_CFG_FILENAME = "lightspeed-stack.yaml" | ||
|
|
||
| LCS_BASE_TEMPLATE = """\ | ||
| name: Lightspeed Core Stack (LCS) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| base_url: http://localhost:8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| llama_stack: | ||
| use_as_library_client: false | ||
| url: http://localhost:8321 | ||
| # api_key: custom-key # Uncomment if your llama-stack requires authentication | ||
| # To run llama-stack in-process (no external container needed), set: | ||
| # use_as_library_client: true | ||
| # library_client_config_path: /path/to/llama-stack.yaml | ||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| conversation_cache: | ||
| type: "sqlite" | ||
| sqlite: | ||
| db_path: "/tmp/data/conversation-cache.db" | ||
| authentication: | ||
| module: "noop" | ||
|
|
||
| """ | ||
|
|
||
| LCS_FAISS_BYOK_TEMPLATE = """\ | ||
| byok_rag: | ||
| - rag_id: {index_id} | ||
| rag_type: inline::faiss | ||
| embedding_model: {model_name} | ||
| embedding_dimension: {dimension} | ||
| vector_db_id: {vector_store_id} | ||
| db_path: {db_path} | ||
|
|
||
| rag: | ||
| inline: | ||
| - {index_id} | ||
| # tool: | ||
| # - {index_id} | ||
| """ | ||
|
|
||
| LCS_PGVECTOR_BYOK_TEMPLATE = """\ | ||
| byok_rag: | ||
| - rag_id: {index_id} | ||
| rag_type: remote::pgvector | ||
| embedding_model: {model_name} | ||
| embedding_dimension: {dimension} | ||
| vector_db_id: {vector_store_id} | ||
| host: ${{env.POSTGRES_HOST}} | ||
| port: ${{env.POSTGRES_PORT}} | ||
| db: ${{env.POSTGRES_DATABASE}} | ||
| user: ${{env.POSTGRES_USER}} | ||
| password: ${{env.POSTGRES_PASSWORD}} | ||
|
|
||
| rag: | ||
| inline: | ||
| - {index_id} | ||
| # tool: | ||
| # - {index_id} | ||
| """ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.