Skip to content

Commit bee6d08

Browse files
authored
chore: migrate to single config model (#54)
* chore: migrate inference providers temporarily to native_override to utilize single-file config Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * update lcore image Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add okp compose file Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * fix numbering Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add deprecatio notice to llama stack config dir Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * update rag section with new schema Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * set empty default for tokens Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * update lcore image Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * use byo-llm baseline to adopt unified config (single-file) Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove llama config and rag content from local compose Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove native override for inference Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add back transformers Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> --------- Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent 8235f4e commit bee6d08

11 files changed

Lines changed: 120 additions & 37 deletions

File tree

.github/workflows/ci-compose-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: make get-rag CONTAINER_ENGINE=docker
3838

3939
- name: Strip OKP config for smoke test
40-
run: yq -i 'del(.rag) | del(.okp)' lightspeed-core-configs/lightspeed-stack.yaml
40+
run: yq -i 'del(.rag)' lightspeed-core-configs/lightspeed-stack.yaml
4141

4242
- name: Start services
4343
run: docker compose --env-file env/default-values.env -f compose/compose.yaml up -d --wait --wait-timeout 120

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ENV_FILES += --env-file env/values.env
2323
endif
2424

2525
LOCAL_COMPOSE_FILES := -f compose/compose.yaml
26+
OKP_COMPOSE_FILES := -f compose/compose.yaml -f compose/compose-okp.yaml
2627

2728
LIGHTSPEED_STACK_CONFIG := lightspeed-core-configs/lightspeed-stack.yaml
2829
ifneq ($(wildcard lightspeed-core-configs/lightspeed-stack.local.yaml),)
@@ -48,12 +49,16 @@ get-skills: ## Fetch RHDH skills from GitHub into the skills/ directory
4849
bash scripts/fetch-skills.sh
4950

5051
.PHONY: local-up
51-
local-up:
52+
local-up: ## Start local compose services
5253
$(COMPOSE) $(ENV_FILES) $(LOCAL_COMPOSE_FILES) up -d
5354

55+
.PHONY: local-up-okp
56+
local-up-okp: ## Start local compose services with OKP
57+
$(COMPOSE) $(ENV_FILES) $(OKP_COMPOSE_FILES) up -d
58+
5459
.PHONY: local-down
55-
local-down:
56-
$(COMPOSE) $(ENV_FILES) $(LOCAL_COMPOSE_FILES) down
60+
local-down: ## Stop local compose services (including OKP if it was started)
61+
$(COMPOSE) $(ENV_FILES) $(OKP_COMPOSE_FILES) down --remove-orphans
5762

5863
.PHONY: help
5964
help: ## Show this help screen

compose/compose-okp.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Overlay: merged only when `make local-up-okp`.
18+
# Starts OKP first, then Lightspeed Core.
19+
services:
20+
okp:
21+
image: ${OKP_IMAGE:-registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latest}
22+
ports:
23+
# Host 8081 so localhost does not clash with LCORE's host 8080.
24+
# OKP still listens on 8080 inside its container.
25+
- "8081:8080"
26+
- "8443:8443"
27+
environment:
28+
- ACCESS_KEY=${OKP_ACCESS_KEY:-}
29+
healthcheck:
30+
test:
31+
[
32+
"CMD-SHELL",
33+
"curl -fsS http://127.0.0.1:8080/",
34+
]
35+
interval: 5s
36+
timeout: 3s
37+
retries: 20
38+
start_period: 30s
39+
lightspeed-core:
40+
depends_on:
41+
okp:
42+
condition: service_healthy
43+
extra_hosts:
44+
# rhokp_url is also the clickable source link, so it must be a
45+
# host-reachable address. This makes `localhost` inside LCORE mean
46+
# the host (healthchecks still use 127.0.0.1 and are unaffected).
47+
- "localhost:host-gateway"
48+
environment:
49+
- OKP_SERVICE_URL=http://localhost:8081

compose/compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ services:
2121
volumes:
2222
- ../${LIGHTSPEED_STACK_CONFIG:-lightspeed-core-configs/lightspeed-stack.yaml}:/app-root/lightspeed-stack.yaml:Z
2323
- ../lightspeed-core-configs/rhdh-profile.py:/app-root/rhdh-profile.py:Z
24-
- ../llama-stack-configs/config.yaml:/app-root/config.yaml:Z
25-
- ../rag-content:/rag-content:Z
2624
- ../skills:/app-root/skills:Z,ro
2725
# Only used when the vertexai provider is configured. Falls back to a
2826
# harmless empty placeholder so the mount doesn't fail otherwise.
2927
- ${GOOGLE_APPLICATION_CREDENTIALS_HOST_PATH:-../env/gcp-credentials-placeholder.json}:/app-root/gcp-credentials.json:Z,ro
3028
environment:
3129
- SERVICE_HOST=0.0.0.0
30+
- KV_STORE_PATH=${KV_STORE_PATH:-/tmp/kvstore.db}
31+
- SQL_STORE_PATH=${SQL_STORE_PATH:-/tmp/sql_store.db}
32+
- SQLITE_STORE_DIR=${SQLITE_STORE_DIR:-/tmp/llama-stack-files}
3233
env_file:
3334
- ../env/values.env
3435
healthcheck:

docs/CONTRIBUTING.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
To configure inference providers without editing the git-tracked `lightspeed-stack.yaml`, copy `lightspeed-core-configs/lightspeed-stack.yaml` to `lightspeed-core-configs/lightspeed-stack.local.yaml` and make your edits there. `make local-up` mounts the `.local.yaml` file automatically when it's present, otherwise it falls back to `lightspeed-stack.yaml`. `lightspeed-stack.local.yaml` is gitignored, so it's safe to leave provider config there permanently.
2525

26-
The tracked `lightspeed-stack.yaml` contains commented stubs for `vllm`, `openai`, and `vertexai`. Copy it to `lightspeed-stack.local.yaml` and uncomment the provider block(s) you need. For GitOps/production, [scripts/generate-gitops-manifests.sh](../scripts/generate-gitops-manifests.sh) uncomments those three providers and adds production `allowed_models`. Ollama (if needed) is added manually in `.local.yaml` — see [docs/PROVIDERS.md](./PROVIDERS.md).
26+
The tracked `lightspeed-stack.yaml` uses the `byo-llm` baseline and contains commented stubs for `vllm`, `openai`, and `vertexai` under `inference.providers`. Copy it to `lightspeed-stack.local.yaml` and uncomment the provider block(s) you need. Providers do not belong under `llama_stack.config.native_override`. For GitOps/production, [scripts/generate-gitops-manifests.sh](../scripts/generate-gitops-manifests.sh) uncomments those three providers and adds production `allowed_models`. Ollama (if needed) is added manually in `.local.yaml` — see [docs/PROVIDERS.md](./PROVIDERS.md).
2727

2828
2. Pull the RAG content:
2929

@@ -39,26 +39,33 @@ make get-skills
3939

4040
4. The production config (`lightspeed-stack.yaml`) sets `host: 127.0.0.1` so the service only binds to loopback — reachable exclusively by containers in the same Pod on Kubernetes. The compose file overrides this with `SERVICE_HOST=0.0.0.0` so the container port mapping works and you can reach the API at `localhost:8080` from your host.
4141

42-
1. Start the local API stack:
42+
5. Start the local API stack:
4343

4444
```sh
4545
make local-up
4646
```
4747

48-
This starts Lightspeed Core using the mounted config/content below.
48+
This starts Lightspeed Core using the mounted config/content below. To also start the Offline Knowledge Portal (OKP) and wait until it is healthy before Lightspeed Core starts:
49+
50+
```sh
51+
make local-up-okp
52+
```
53+
54+
Set `OKP_ACCESS_KEY` in `env/values.env` when using `make local-up-okp`. `make local-down` stops OKP even if you started it with the overlay.
55+
56+
To obtain `OKP_ACCESS_KEY` navigate to the [access key generator](https://access.redhat.com/offline/access/).
4957

5058
Lightspeed Core uses mounted config/content in local compose:
5159

5260
- `lightspeed-core-configs/lightspeed-stack.yaml` (or `lightspeed-stack.local.yaml`, if present) -> `/app-root/lightspeed-stack.yaml`
5361
- `lightspeed-core-configs/rhdh-profile.py` -> `/app-root/rhdh-profile.py`
54-
- `llama-stack-configs/config.yaml` -> `/app-root/config.yaml`
5562
- `rag-content/` -> `/rag-content`
5663

5764
Question validation is not enabled automatically. If you want it, set `ENABLE_VALIDATION=question_validity`, `VALIDATION_PROVIDER`, and `VALIDATION_MODEL_NAME` in `env/values.env`, along with any env vars required by the selected inference provider.
5865

5966
See [Configuring Validation](#configuring-validation) for example configurations.
6067

61-
4. Stop services:
68+
6. Stop services:
6269

6370
```sh
6471
make local-down
@@ -107,7 +114,7 @@ Paste that value into `byok_rag[].vector_db_id`. Keep `embedding_model` as the d
107114

108115
`notebooks` is separate: it is dynamic create capacity under `vector_store` (local FAISS; GitOps rewrites it to pgvector). It is not a second `byok_rag` corpus.
109116

110-
If you use a gitignored `lightspeed-stack.local.yaml` for local providers, copy the same `byok_rag` / `rag` / `vector_store` / `shields` sections from the committed file when they change.
117+
If you use a gitignored `lightspeed-stack.local.yaml`, copy the same `byok_rag` / `rag` / `vector_store` / `shields` sections from the committed file when they change.
111118

112119
## Configuring Skills
113120

@@ -204,7 +211,8 @@ make validate-yaml
204211
| `get-rag` | Pull and unpack RAG content into `./rag-content` (replaces existing contents). Optional: `RAG_CONTENT_IMAGE=<image>`. |
205212
| `get-skills` | Optional. Fetch RHDH skills into `./skills` for skills consumption (replaces existing contents). Optional: `RHDH_SKILLS_REPO=<url>`, `RHDH_SKILLS_REF=<ref>`. |
206213
| `local-up` | Start local compose services. Validation is controlled entirely through env vars in `env/values.env`. |
207-
| `local-down` | Stop local compose services. |
214+
| `local-up-okp` | Start local compose services with OKP (`compose/compose-okp.yaml`). Set `OKP_ACCESS_KEY` in `env/values.env`. |
215+
| `local-down` | Stop local compose services, including OKP if it was started. |
208216
| `sync-images` | Sync image values from `images.yaml` into `env/default-values.env`. Requires `yq`. |
209217
| `validate-images` | Validate that `images.yaml` and `env/default-values.env` are in sync. Requires `yq`. |
210218
| `validate-yaml` | Validate YAML formatting/syntax. |

docs/PROVIDERS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Each inference has its own environment variables. You can include all of these i
1212
> You will notice the `api_key_env` field is not wrapped in curly-braces `{}`. This is due to Lightspeed Core wrapping them internally to curate a proper `{env.xyz}` to pass through to Llama Stack so the keys are not exposed internally.
1313
1414
> [!NOTE]
15-
> Commented provider stubs for `vllm`, `openai`, and `vertexai` live in [lightspeed-stack.yaml](../lightspeed-core-configs/lightspeed-stack.yaml). For local development, copy that file to `lightspeed-core-configs/lightspeed-stack.local.yaml` (gitignored, auto-mounted by `make local-up` when present — see [CONTRIBUTING.md](./CONTRIBUTING.md)), uncomment the block(s) you need, and set the required env vars.
15+
> Commented provider stubs for `vllm`, `openai`, and `vertexai` live under `inference.providers` in [lightspeed-stack.yaml](../lightspeed-core-configs/lightspeed-stack.yaml). The `byo-llm` baseline means these stay at that top-level section — do not add them to `llama_stack.config.native_override`. For local development, copy that file to `lightspeed-core-configs/lightspeed-stack.local.yaml` (gitignored, auto-mounted by `make local-up` when present — see [CONTRIBUTING.md](./CONTRIBUTING.md)), uncomment the block(s) you need, and set the required env vars.
1616
>
1717
> For GitOps/production, [scripts/generate-gitops-manifests.sh](../scripts/generate-gitops-manifests.sh) uncomments those three providers, then adds production `allowed_models` for `openai` and `vertexai`.
1818
>
@@ -143,10 +143,9 @@ service:
143143
llama_stack:
144144
use_as_library_client: true
145145
config:
146-
profile: /app-root/config.yaml
146+
baseline: byo-llm
147147
inference:
148148
providers:
149-
- type: sentence_transformers
150149
- type: openai
151150
id: openai
152151
api_key_env: OPENAI_API_KEY
@@ -184,4 +183,4 @@ mcp_servers:
184183
url: 'http://localhost:7007/api/mcp-actions/v1'
185184
authorization_headers:
186185
Authorization: 'client'
187-
```
186+
```

env/default-values.env

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
# You do not need to set them all if they will go unused.
33

44
# Service Images
5-
LIGHTSPEED_CORE_IMAGE=quay.io/lightspeed-core/lightspeed-stack:dev-20260811-0da4b12
5+
LIGHTSPEED_CORE_IMAGE=quay.io/lightspeed-core/lightspeed-stack:dev-20260824-cbd182b
66
RAG_CONTENT_IMAGE=quay.io/redhat-ai-dev/rag-content:release-1.10-lls-0.5.0-8c231a3b5177f12fff9db042dfa4091d8f2f26b3
77

8+
# Llama Stack storage (default_run.yaml). Matches llama-stack-configs/config.yaml.
9+
KV_STORE_PATH=/tmp/kvstore.db
10+
SQL_STORE_PATH=/tmp/sql_store.db
11+
SQLITE_STORE_DIR=/tmp/llama-stack-files
12+
813
# vLLM Inference Settings
914
VLLM_URL=
1015
VLLM_API_KEY=
@@ -37,6 +42,9 @@ ENABLE_VALIDATION=
3742
VALIDATION_PROVIDER=
3843
VALIDATION_MODEL_NAME=
3944

45+
# Offline Knowledge Portal (used by `make local-up-okp`)
46+
OKP_ACCESS_KEY=
47+
4048
# Other
4149
LLAMA_STACK_LOGGING=
4250

images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
lightspeed-core:
1717
llama_version: 0.6.0
18-
image: quay.io/lightspeed-core/lightspeed-stack:dev-20260811-0da4b12
18+
image: quay.io/lightspeed-core/lightspeed-stack:dev-20260824-cbd182b
1919
latest_release: v0.6.0rc2 # using v prefix in catalog now it seems
2020
rag-content:
2121
llama_version: 0.5.0

lightspeed-core-configs/lightspeed-stack.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ service:
2424
llama_stack:
2525
use_as_library_client: true
2626
config:
27-
profile: /app-root/config.yaml
27+
baseline: byo-llm
2828
native_override:
2929
vector_stores:
3030
annotation_prompt_params:
@@ -147,9 +147,11 @@ mcp_servers:
147147
authorization_headers:
148148
Authorization: 'client'
149149
rag:
150-
tool:
151-
- okp
152-
okp:
153-
rhokp_url: '${env.OKP_SERVICE_URL:=http://localhost:8080}'
154-
offline: true
155-
chunk_filter_query: 'product:*developer_hub*'
150+
okp:
151+
rhokp_url: '${env.OKP_SERVICE_URL:=http://localhost:8080}'
152+
offline: true
153+
chunk_filter_query: 'product:*developer_hub*'
154+
retrieval:
155+
tool:
156+
sources:
157+
- okp

llama-stack-configs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Llama Stack Configuration Files
22

3+
> [!IMPORTANT]
4+
> This directory is set to be deleted/archived in favour of a lightspeed-stack.yaml only implementation
5+
>
6+
37
This directory stores the Llama Stack config for the single active release tracked on `main`.
48

59
- `config.yaml` is the unified config. The question-validation shield is conditionally enabled via `ENABLE_VALIDATION` and uses the `VALIDATION_PROVIDER` and `VALIDATION_MODEL_NAME` env vars you supply (see [CONTRIBUTING.md](../docs/CONTRIBUTING.md#configuring-validation)).

0 commit comments

Comments
 (0)