-
Notifications
You must be signed in to change notification settings - Fork 86
LCORE-836 spike: merge run.yaml into lightspeed-stack.yaml #1580
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
max-svistunov
wants to merge
9
commits into
lightspeed-core:main
Choose a base branch
from
max-svistunov:lcore-836-spike-llama-stack-config-merge
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
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3fbfe5a
LCORE-836 spike: unified mode PoC — schema, synthesizer, migration tool
max-svistunov 06ef987
LCORE-836 spike: design docs and PoC evidence
max-svistunov 6e0a95b
LCORE-836 spike: add e2e-kickoff JIRA (feature files first, no implem…
max-svistunov 0a32029
LCORE-836 spike: rename poc-evidence/ → poc-results/
max-svistunov 579c28d
LCORE-836 spike: clarity revisions to spike and spec docs
max-svistunov 6bc7a72
LCORE-836 spike: address CodeRabbit feedback on secrets-on-disk and a…
max-svistunov 1983f1f
LCORE-836 spike: fix MD031 (blanks around fenced code blocks)
max-svistunov de734e7
LCORE-836 spike: add Decision S5 (backend-agnostic key location)
max-svistunov 8b85c4a
LCORE-836 spike: Pydantic AI research; vacuous-shield finding
max-svistunov 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
717 changes: 717 additions & 0 deletions
717
docs/design/llama-stack-config-merge/llama-stack-config-merge-spike.md
Large diffs are not rendered by default.
Oops, something went wrong.
502 changes: 502 additions & 0 deletions
502
docs/design/llama-stack-config-merge/llama-stack-config-merge.md
Large diffs are not rendered by default.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
docs/design/llama-stack-config-merge/poc-evidence/library-mode/README.md
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,26 @@ | ||
| # Library-mode PoC evidence | ||
|
|
||
| Command: | ||
| ```bash | ||
| export OPENAI_API_KEY=<redacted> | ||
| export E2E_OPENAI_MODEL=gpt-4o-mini | ||
| uv run lightspeed-stack -c docs/design/llama-stack-config-merge/poc-evidence/lightspeed-stack-unified-library.yaml | ||
| ``` | ||
|
|
||
| ## What the unified config does | ||
|
|
||
| - `llama_stack.config.profile: /abs/path/to/tests/e2e/configs/run-ci.yaml` — baseline loaded from the CI profile | ||
| - `llama_stack.config.native_override.safety.default_shield_id: llama-guard` — override proves merge works | ||
|
|
||
| ## Evidence | ||
|
|
||
| - `synthesized-run.yaml` — the full run.yaml LCORE produced from the unified config | ||
| - `query-response.json` — a successful `/v1/query` round-trip | ||
|
|
||
| ## Proves | ||
|
|
||
| - `llama_stack.library_client_config_path` was NOT used (no external run.yaml needed) | ||
| - `llama_stack.config.profile` was used as the synthesis baseline (path resolution works with absolute paths) | ||
| - `llama_stack.config.native_override` was merged onto the baseline | ||
| - `AsyncLlamaStackAsLibraryClient` accepts the synthesized file path (answered item #24: file-only, not dict) | ||
| - `/v1/query` succeeded end-to-end through the synthesized stack |
1 change: 1 addition & 0 deletions
1
docs/design/llama-stack-config-merge/poc-evidence/library-mode/query-response.json
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 @@ | ||
| {"conversation_id":"976ef32527283085ba2f1d0cfb4c16d97071bf64391a8200","response":"The three primary colors are red, blue, and yellow.","rag_chunks":[],"referenced_documents":[],"truncated":false,"input_tokens":24,"output_tokens":12,"available_quotas":{},"tool_calls":[],"tool_results":[]} |
148 changes: 148 additions & 0 deletions
148
docs/design/llama-stack-config-merge/poc-evidence/library-mode/synthesized-run.yaml
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,148 @@ | ||
| apis: | ||
| - agents | ||
| - batches | ||
| - datasetio | ||
| - eval | ||
| - files | ||
| - inference | ||
| - safety | ||
| - scoring | ||
| - tool_runtime | ||
| - vector_io | ||
| benchmarks: [] | ||
| datasets: [] | ||
| image_name: starter | ||
| providers: | ||
| agents: | ||
| - config: | ||
| persistence: | ||
| agent_state: | ||
| backend: kv_default | ||
| namespace: agents_state | ||
| responses: | ||
| backend: sql_default | ||
| table_name: agents_responses | ||
| provider_id: meta-reference | ||
| provider_type: inline::meta-reference | ||
| batches: | ||
| - config: | ||
| kvstore: | ||
| backend: kv_default | ||
| namespace: batches_store | ||
| provider_id: reference | ||
| provider_type: inline::reference | ||
| datasetio: | ||
| - config: | ||
| kvstore: | ||
| backend: kv_default | ||
| namespace: huggingface_datasetio | ||
| provider_id: huggingface | ||
| provider_type: remote::huggingface | ||
| - config: | ||
| kvstore: | ||
| backend: kv_default | ||
| namespace: localfs_datasetio | ||
| provider_id: localfs | ||
| provider_type: inline::localfs | ||
| eval: | ||
| - config: | ||
| kvstore: | ||
| backend: kv_default | ||
| namespace: eval_store | ||
| provider_id: meta-reference | ||
| provider_type: inline::meta-reference | ||
| files: | ||
| - config: | ||
| metadata_store: | ||
| backend: sql_default | ||
| table_name: files_metadata | ||
| storage_dir: ~/.llama/storage/files | ||
| provider_id: meta-reference-files | ||
| provider_type: inline::localfs | ||
| inference: | ||
| - config: | ||
| allowed_models: | ||
| - ${env.E2E_OPENAI_MODEL:=gpt-4o-mini} | ||
| api_key: ${env.OPENAI_API_KEY} | ||
| provider_id: openai | ||
| provider_type: remote::openai | ||
| - config: {} | ||
| provider_id: sentence-transformers | ||
| provider_type: inline::sentence-transformers | ||
| safety: | ||
| - config: | ||
| excluded_categories: [] | ||
| provider_id: llama-guard | ||
| provider_type: inline::llama-guard | ||
| scoring: | ||
| - config: {} | ||
| provider_id: basic | ||
| provider_type: inline::basic | ||
| - config: {} | ||
| provider_id: llm-as-judge | ||
| provider_type: inline::llm-as-judge | ||
| - config: | ||
| openai_api_key: '********' | ||
| provider_id: braintrust | ||
| provider_type: inline::braintrust | ||
| tool_runtime: | ||
| - config: {} | ||
| provider_id: rag-runtime | ||
| provider_type: inline::rag-runtime | ||
| - config: {} | ||
| provider_id: model-context-protocol | ||
| provider_type: remote::model-context-protocol | ||
| vector_io: [] | ||
| registered_resources: | ||
| benchmarks: [] | ||
| datasets: [] | ||
| models: | ||
| - metadata: | ||
| embedding_dimension: 768 | ||
| model_id: all-mpnet-base-v2 | ||
| model_type: embedding | ||
| provider_id: sentence-transformers | ||
| provider_model_id: all-mpnet-base-v2 | ||
| scoring_fns: [] | ||
| shields: | ||
| - provider_id: llama-guard | ||
| provider_shield_id: openai/gpt-4o-mini | ||
| shield_id: llama-guard | ||
| tool_groups: | ||
| - provider_id: rag-runtime | ||
| toolgroup_id: builtin::rag | ||
| vector_stores: [] | ||
| safety: | ||
| default_shield_id: llama-guard | ||
| scoring_fns: [] | ||
| server: | ||
| port: 8321 | ||
| storage: | ||
| backends: | ||
| kv_default: | ||
| db_path: ${env.KV_STORE_PATH:=~/.llama/storage/kv_store.db} | ||
| type: kv_sqlite | ||
| sql_default: | ||
| db_path: ${env.SQL_STORE_PATH:=~/.llama/storage/sql_store.db} | ||
| type: sql_sqlite | ||
| stores: | ||
| conversations: | ||
| backend: sql_default | ||
| table_name: openai_conversations | ||
| inference: | ||
| backend: sql_default | ||
| max_write_queue_size: 10000 | ||
| num_writers: 4 | ||
| table_name: inference_store | ||
| metadata: | ||
| backend: kv_default | ||
| namespace: registry | ||
| prompts: | ||
| backend: kv_default | ||
| namespace: prompts | ||
| vector_stores: | ||
| default_embedding_model: | ||
| model_id: all-mpnet-base-v2 | ||
| provider_id: sentence-transformers | ||
| default_provider_id: faiss | ||
| version: 2 |
33 changes: 33 additions & 0 deletions
33
docs/design/llama-stack-config-merge/poc-evidence/lightspeed-stack-unified-library.yaml
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,33 @@ | ||
| name: Lightspeed Core Service (LCS) - Unified PoC | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| base_url: http://localhost:8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| # Unified mode: no `library_client_config_path`. Operational LS config is | ||
| # synthesized by LCORE from `llama_stack.config` below. | ||
| llama_stack: | ||
| use_as_library_client: true | ||
| config: | ||
| # Use the CI-friendly baseline via `profile` (no EXTERNAL_PROVIDERS_DIR | ||
| # env var required). Equivalent to what tests/e2e/configs/run-ci.yaml | ||
| # provides; this exercises the `profile:` path of the synthesizer. | ||
| profile: /home/msvistun/repos/lightspeed/stack/tests/e2e/configs/run-ci.yaml | ||
| # Small native_override: prove overrides take effect end-to-end. | ||
| native_override: | ||
| safety: | ||
| default_shield_id: llama-guard | ||
| user_data_collection: | ||
| feedback_enabled: false | ||
| feedback_storage: "/tmp/lcore-836-poc/feedback" | ||
| transcripts_enabled: false | ||
| transcripts_storage: "/tmp/lcore-836-poc/transcripts" | ||
| conversation_cache: | ||
| type: "sqlite" | ||
| sqlite: | ||
| db_path: "/tmp/lcore-836-poc/conversation-cache.db" | ||
| authentication: | ||
| module: "noop" |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not write the synthesized config to a fixed
/tmpfilename./tmp/llama_stack_synthesized_config.yamlis predictable and shared across processes, so concurrent instances can overwrite each other and a pre-existing symlink can redirect the write. Use a securely created file or an app-owned directory with restrictive permissions.Safer temp-file creation
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right — the PoC uses a fixed
/tmpfilename for expediency. Durable answer is in spec doc R10: persistent known path (overwritten each boot), file mode0600set via explicit create flag (not umask), and a--synthesized-config-outputCLI flag for debugging. The PoC code is scheduled for removal pre-merge; the implementation JIRA "Unifiedllama_stack.configschema + synthesizer" inherits R10's requirements.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@max-svistunov, understood — R10's requirements (persistent known path, explicitO_CREAT | O_WRONLY | O_TRUNCwith0600, and the--synthesized-config-outputdebug flag) cover the concern properly for the production implementation. Happy to resolve this comment if you'd like, just say the word.✏️ Learnings added