Skip to content

Commit afeaf11

Browse files
committed
Update path to llama_stack_configuration module
Using the module this way seems like a major anti-pattern that needs refactoring.
1 parent 7bef68f commit afeaf11

12 files changed

Lines changed: 23 additions & 23 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ start-llama-stack-container: build-llama-stack-image ## Start llama-stack contai
7070
-v $(PWD)/$(LLAMA_STACK_CONFIG):/opt/app-root/run.yaml:z \
7171
-v $(PWD)/$(CONFIG):/opt/app-root/lightspeed-stack.yaml:ro,z \
7272
-v $(PWD)/scripts/llama-stack-entrypoint.sh:/opt/app-root/enrich-entrypoint.sh:ro,z \
73-
-v $(PWD)/src/llama_stack_configuration.py:/opt/app-root/llama_stack_configuration.py:ro,z \
73+
-v $(PWD)/src/lightspeed_stack/llama_stack_configuration.py:/opt/app-root/llama_stack_configuration.py:ro,z \
7474
-e OPENAI_API_KEY \
7575
-e BRAVE_SEARCH_API_KEY \
7676
-e TAVILY_SEARCH_API_KEY \
@@ -129,7 +129,7 @@ clean-llama-stack: remove-llama-stack-container ## Remove container and image
129129
fi
130130

131131
run-llama-stack: ## Start Llama Stack with enriched config (for local service mode)
132-
uv run src/llama_stack_configuration.py -c $(CONFIG) -i $(LLAMA_STACK_CONFIG) -o $(LLAMA_STACK_CONFIG) && \
132+
uv run src/lightspeed_stack/llama_stack_configuration.py -c $(CONFIG) -i $(LLAMA_STACK_CONFIG) -o $(LLAMA_STACK_CONFIG) && \
133133
uv run llama stack run $(LLAMA_STACK_CONFIG)
134134

135135
test-unit: ## Run the unit tests

deploy/llama-stack/test.containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN mkdir -p /opt/app-root/src/.llama/storage \
4040
chmod -R 775 /opt/app-root
4141

4242
# Copy enrichment scripts for runtime config enrichment
43-
COPY src/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
43+
COPY src/lightspeed_stack/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
4444
COPY scripts/llama-stack-entrypoint.sh /opt/app-root/enrich-entrypoint.sh
4545
RUN chmod +x /opt/app-root/enrich-entrypoint.sh && \
4646
chown 1001:0 /opt/app-root/enrich-entrypoint.sh /opt/app-root/llama_stack_configuration.py

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- ./run.yaml:/opt/app-root/run.yaml:z
1616
# Host copies so `docker compose up` picks up script changes without rebuilding llama-stack
1717
- ./scripts/llama-stack-entrypoint.sh:/opt/app-root/enrich-entrypoint.sh:ro,z
18-
- ./src/llama_stack_configuration.py:/opt/app-root/llama_stack_configuration.py:ro,z
18+
- ./src/lightspeed_stack/llama_stack_configuration.py:/opt/app-root/llama_stack_configuration.py:ro,z
1919
- ${GCP_KEYS_PATH:-./tmp/.gcp-keys-dummy}:/opt/app-root/.gcp-keys:ro
2020
- ./lightspeed-stack.yaml:/opt/app-root/lightspeed-stack.yaml:ro,z
2121
- llama-storage:/opt/app-root/src/.llama/storage

docs/design/llama-stack-config-merge/llama-stack-config-merge-spike.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ configuration model. (Full design: the spec doc.)
442442
- Add the unified-vs-legacy `@model_validator` to the **root**
443443
`Configuration` model (it spans top-level `inference.providers` and
444444
`llama_stack.*`).
445-
- New functions in `src/llama_stack_configuration.py`:
445+
- New functions in `src/lightspeed_stack/llama_stack_configuration.py`:
446446
`synthesize_configuration`, `deep_merge_list_replace`,
447447
`apply_high_level_inference`, `load_default_baseline`, `synthesize_to_file`.
448448
- A shipped default baseline at `src/data/default_run.yaml`.
@@ -468,7 +468,7 @@ Read the "Architecture" and "Implementation Suggestions" sections of
468468
docs/design/llama-stack-config-merge/llama-stack-config-merge.md.
469469
Key files to create or modify:
470470
src/models/config.py (new classes; modify LlamaStackConfiguration)
471-
src/llama_stack_configuration.py (synthesize_configuration + helpers)
471+
src/lightspeed_stack/llama_stack_configuration.py (synthesize_configuration + helpers)
472472
src/data/default_run.yaml (new)
473473
src/client.py (library-mode wiring)
474474
To verify: run a unified-mode config end-to-end via `uv run lightspeed-stack -c <config>` and confirm /v1/query succeeds.
@@ -486,7 +486,7 @@ that produces a unified single-file config from an existing
486486

487487
**Scope**:
488488

489-
- `migrate_config_dumb()` function in `src/llama_stack_configuration.py`.
489+
- `migrate_config_dumb()` function in `src/lightspeed_stack/llama_stack_configuration.py`.
490490
- `--migrate-config`, `--run-yaml`, `--migrate-output` flags in
491491
`src/lightspeed_stack.py`.
492492
- Round-trip test: migrate → synthesize → byte-identical to original
@@ -504,7 +504,7 @@ that produces a unified single-file config from an existing
504504

505505
```text
506506
Read "Migration / backwards compatibility" and "Appendix A — Worked example: legacy → unified migration" in docs/design/llama-stack-config-merge/llama-stack-config-merge.md.
507-
Key files: src/lightspeed_stack.py, src/llama_stack_configuration.py,
507+
Key files: src/lightspeed_stack.py, src/lightspeed_stack/llama_stack_configuration.py,
508508
tests/unit/test_llama_stack_synthesize.py.
509509
To verify: migrate the repo's root run.yaml + lightspeed-stack.yaml, then
510510
start LCORE with the output; confirm /v1/query works.
@@ -946,7 +946,7 @@ Two files:
946946
(inference, safety, tool_runtime, vector_io, agents, ...), `storage`,
947947
`registered_resources`, `vector_stores`, `safety`.
948948

949-
**Existing enrichment** (`src/llama_stack_configuration.py`):
949+
**Existing enrichment** (`src/lightspeed_stack/llama_stack_configuration.py`):
950950

951951
- LCORE already enriches an input `run.yaml` with dynamic values from
952952
`lightspeed-stack.yaml`: Azure Entra ID tokens (side-effect to `.env`),
@@ -1136,7 +1136,7 @@ Relative to `upstream/main`:
11361136
| File | Purpose |
11371137
|---|---|
11381138
| `src/models/config.py` | New classes: `UnifiedInferenceProvider`, `UnifiedInferenceSection`, `UnifiedLlamaStackConfig`; modified `LlamaStackConfiguration` (adds `config` field + mutual-exclusion validator). _PoC layout; the implementation follows Decision S5 — `inference.providers` on the top-level `InferenceConfiguration`, validator on the root `Configuration` model, no `UnifiedInferenceSection` (see the schema JIRA)._ |
1139-
| `src/llama_stack_configuration.py` | New: `synthesize_configuration`, `deep_merge_list_replace`, `apply_high_level_inference`, `load_default_baseline`, `synthesize_to_file`, `migrate_config_dumb`. CLI `main()` auto-detects unified vs legacy. |
1139+
| `src/lightspeed_stack/llama_stack_configuration.py` | New: `synthesize_configuration`, `deep_merge_list_replace`, `apply_high_level_inference`, `load_default_baseline`, `synthesize_to_file`, `migrate_config_dumb`. CLI `main()` auto-detects unified vs legacy. |
11401140
| `src/data/default_run.yaml` | Built-in default baseline (copied from repo root `run.yaml` for the PoC — implementation JIRA should slim it down; see PoC surprise about `EXTERNAL_PROVIDERS_DIR`) |
11411141
| `src/client.py` | Library-mode path picks synthesis for unified configs, enrichment for legacy |
11421142
| `src/lightspeed_stack.py` | `--migrate-config`, `--run-yaml`, `--migrate-output` flags |

docs/design/llama-stack-config-merge/llama-stack-config-merge.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| | |
44
|--------------------|----------------------------------------------------------------------------------|
55
| **Date** | 2026-04-23 |
6-
| **Component** | Lightspeed Core Stack (src/models/config.py, src/llama_stack_configuration.py, src/client.py, src/lightspeed_stack.py, scripts/llama-stack-entrypoint.sh) |
6+
| **Component** | Lightspeed Core Stack (src/models/config.py, src/lightspeed_stack/llama_stack_configuration.py, src/client.py, src/lightspeed_stack.py, scripts/llama-stack-entrypoint.sh) |
77
| **Authors** | Maxim Svistunov |
88
| **Feature** | [LCORE-836](https://redhat.atlassian.net/browse/LCORE-836) |
99
| **Spike** | [llama-stack-config-merge-spike.md](llama-stack-config-merge-spike.md) |
@@ -328,7 +328,7 @@ class Configuration(ConfigurationBase):
328328
### API changes
329329

330330
None at the REST API surface. Internal API additions in
331-
`src/llama_stack_configuration.py`:
331+
`src/lightspeed_stack/llama_stack_configuration.py`:
332332

333333
- `synthesize_configuration(lcs_config, config_file_dir, default_baseline)
334334
-> dict` — the synthesis pipeline.
@@ -430,7 +430,7 @@ September 2026.
430430
| File | What to do |
431431
|---|---|
432432
| `src/models/config.py` | Add `UnifiedInferenceProvider`. Extend the existing `InferenceConfiguration` with `providers: list[UnifiedInferenceProvider]`. Add `UnifiedLlamaStackConfig` (`baseline`/`profile`/`native_override`) and a `config` field on `LlamaStackConfiguration`. Put the unified-vs-legacy `model_validator` on the **root** `Configuration` model (spans `inference.providers` + `llama_stack.*`). |
433-
| `src/llama_stack_configuration.py` | Add `synthesize_configuration`, `deep_merge_list_replace`, `apply_high_level_inference`, `load_default_baseline`, `synthesize_to_file`, `migrate_config_dumb`, `PROVIDER_TYPE_MAP`, `DEFAULT_BASELINE_RESOURCE`. Update `main()` to auto-detect unified vs legacy. |
433+
| `src/lightspeed_stack/llama_stack_configuration.py` | Add `synthesize_configuration`, `deep_merge_list_replace`, `apply_high_level_inference`, `load_default_baseline`, `synthesize_to_file`, `migrate_config_dumb`, `PROVIDER_TYPE_MAP`, `DEFAULT_BASELINE_RESOURCE`. Update `main()` to auto-detect unified vs legacy. |
434434
| `src/data/default_run.yaml` | New file — a thinner baseline than today's repo-root `run.yaml`. Notably do **not** reference `${env.EXTERNAL_PROVIDERS_DIR}` without a default (see "Findings discovered during PoC" in the spike doc). |
435435
| `src/client.py` | In `_load_library_client`: branch on `config.config` presence. Add `_synthesize_library_config()` that calls the synthesizer and writes to the deterministic path (R10). Keep `_enrich_library_config` for legacy. |
436436
| `src/lightspeed_stack.py` | Add `--migrate-config`, `--run-yaml`, `--migrate-output`, `--synthesized-config-output` flags. Add an early-exit branch in `main()` that dispatches to `migrate_config_dumb` when `--migrate-config` is set. Clean up stale docstring. |

docs/devel_doc/container_orchestration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Container logs:
459459
3. **Test config enrichment:**
460460
```bash
461461
# Run enrichment script manually to check for errors
462-
uv run src/llama_stack_configuration.py \
462+
uv run src/lightspeed_stack/llama_stack_configuration.py \
463463
-c lightspeed-stack.yaml \
464464
-i run.yaml \
465465
-o /tmp/enriched-run.yaml
@@ -685,7 +685,7 @@ When the llama-stack container starts, it automatically enriches the `run.yaml`
685685

686686
1. **Entrypoint script** (`scripts/llama-stack-entrypoint.sh`) is mounted at `/opt/app-root/enrich-entrypoint.sh`
687687
2. **Script runs** `/opt/app-root/.venv/bin/python3 /opt/app-root/llama_stack_configuration.py`
688-
3. **Enrichment logic** (`src/llama_stack_configuration.py`) reads both configs and merges them
688+
3. **Enrichment logic** (`src/lightspeed_stack/llama_stack_configuration.py`) reads both configs and merges them
689689
4. **Output** is written to `/tmp/enriched-run.yaml` inside the container
690690
5. **Llama Stack starts** with the enriched config
691691

@@ -699,7 +699,7 @@ When the llama-stack container starts, it automatically enriches the `run.yaml`
699699

700700
```bash
701701
# Run enrichment locally to see output
702-
uv run src/llama_stack_configuration.py \
702+
uv run src/lightspeed_stack/llama_stack_configuration.py \
703703
-c lightspeed-stack.yaml \
704704
-i run.yaml \
705705
-o enriched-run.yaml
@@ -717,7 +717,7 @@ The container uses these volume mounts:
717717
| `$(PWD)/run.yaml` | `/opt/app-root/run.yaml` | rw | Llama Stack config (enriched version written here) |
718718
| `$(PWD)/lightspeed-stack.yaml` | `/opt/app-root/lightspeed-stack.yaml` | ro | LCORE config (read for enrichment) |
719719
| `$(PWD)/scripts/llama-stack-entrypoint.sh` | `/opt/app-root/enrich-entrypoint.sh` | ro | Entrypoint script with enrichment logic |
720-
| `$(PWD)/src/llama_stack_configuration.py` | `/opt/app-root/llama_stack_configuration.py` | ro | Python enrichment script |
720+
| `$(PWD)/src/lightspeed_stack/llama_stack_configuration.py` | `/opt/app-root/llama_stack_configuration.py` | ro | Python enrichment script |
721721

722722
**SELinux labels:**
723723
- `:z`: Relabels for sharing between host and container (read-write)

src/lightspeed_stack/data/default_run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This file is the starting point when a unified `lightspeed-stack.yaml`
44
# selects `llama_stack.config.baseline: default` (the default) and does not
5-
# point at a `profile:`. The synthesizer (src/llama_stack_configuration.py)
5+
# point at a `profile:`. The synthesizer (src/lightspeed_stack/llama_stack_configuration.py)
66
# layers enrichment, high-level `inference.providers`, and `native_override`
77
# on top of this baseline to produce the final run.yaml handed to Llama Stack.
88
#

tests/e2e-prow/rhoai/manifests/lightspeed/llama-stack-openai.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
exit 1
8888
fi
8989
cp -f /opt/app-root/.e2e-rag-seed/kv_store.db /opt/app-root/src/.llama/storage/rag/kv_store.db
90-
cp /opt/app-root/src/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
90+
cp /opt/app-root/src/lightspeed_stack/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
9191
chmod -R 775 /opt/app-root && chown -R 1001:0 /opt/app-root
9292
volumeMounts:
9393
- name: app-root

tests/e2e-prow/rhoai/manifests/lightspeed/llama-stack-prow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ spec:
150150
if [[ -f "$LIGHTSPEED_CONFIG" ]]; then
151151
echo "Enriching llama-stack config..."
152152
ENRICHMENT_FAILED=0
153-
/opt/app-root/.venv/bin/python3 /opt/app-root/src/llama_stack_configuration.py \
153+
/opt/app-root/.venv/bin/python3 /opt/app-root/src/lightspeed_stack/llama_stack_configuration.py \
154154
-c "$LIGHTSPEED_CONFIG" \
155155
-i "$INPUT_CONFIG" \
156156
-o "$ENRICHED_CONFIG" 2>&1 || ENRICHMENT_FAILED=1

tests/unit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Unit tests for the degraded mode tracker.
2222
Unit tests for functions defined in src/lightspeed_stack.py.
2323

2424
## [test_llama_stack_configuration.py](test_llama_stack_configuration.py)
25-
Unit tests for src/llama_stack_configuration.py.
25+
Unit tests for src/lightspeed_stack/llama_stack_configuration.py.
2626

2727
## [test_llama_stack_synthesize.py](test_llama_stack_synthesize.py)
2828
Unit tests for unified-mode Llama Stack configuration synthesis (LCORE-2336).

0 commit comments

Comments
 (0)