From 7763caf20dc38fdb51396a0343b46552f3df29a7 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 27 Nov 2025 15:35:20 -0500 Subject: [PATCH 1/3] v0.0.0 --- package.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..40af811 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "formatter-tools", + "private": true, + "devDependencies": { + "prettier": "^3.2.0", + "prettier-plugin-yaml": "^0.7.0" + }, + "scripts": { + "format": "prettier --write '**/*.{yaml,yml}'" + }, + "version": "0.0.0" +} From 57476020451e1e80a9d51c87b8f10a3c146cc518 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Fri, 28 Nov 2025 12:43:21 -0500 Subject: [PATCH 2/3] add Prettier for formatting and update docs Signed-off-by: Jordan Dubrick --- .github/workflows/validation.yml | 20 ++++++++++++++++++-- .gitignore | 4 +++- .prettierrc | 4 ++++ README.md | 13 +++++++++++++ package.json | 8 ++++---- yarn.lock | 8 ++++++++ 6 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 .prettierrc create mode 100644 yarn.lock diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 28cf936..f588c66 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -1,4 +1,4 @@ -name: Question Validation Sync Check +name: Validation Checks on: pull_request: @@ -18,4 +18,20 @@ jobs: - name: Setup Environment run: pip3 install -r requirements.txt - name: Validate prompt - run: python3 sync.py -t validate \ No newline at end of file + run: python3 sync.py -t validate + validate-yaml: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Use Node.js and cache dependencies + uses: actions/setup-node@v4 + with: + node-version: '22.21' + cache: 'yarn' + - name: Install dependencies + run: yarn install --immutable --frozen-lockfile + - name: Run Prettier + run: yarn verify \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2f71729..8c980a2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ vector_db values.env -.venv \ No newline at end of file +.venv + +node_modules \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..2ddc965 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "printWidth": 80 +} diff --git a/README.md b/README.md index 3d439c5..ce942d9 100644 --- a/README.md +++ b/README.md @@ -146,4 +146,17 @@ To deploy on a cluster see [DEPLOYMENT.md](./docs/DEPLOYMENT.md). ## Contributing +### Local Development Requirements + +- [Yarn](https://yarnpkg.com/) +- [Node.js >= v22](https://nodejs.org/en/about/previous-releases) + +### Updating YAML Files + +This repository implements Prettier to handle all YAML formatting. +```sh +yarn format # Runs Prettier to update the YAMl files in this repository +yarn verify # Runs Prettier to check the YAML files in this repository +``` + If you wish to try new changes with Llama Stack, you can build your own image using the `Containerfile` in the root of this repository. \ No newline at end of file diff --git a/package.json b/package.json index 40af811..3b06efa 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,11 @@ "name": "formatter-tools", "private": true, "devDependencies": { - "prettier": "^3.2.0", - "prettier-plugin-yaml": "^0.7.0" + "prettier": "^3.2.0" }, "scripts": { - "format": "prettier --write '**/*.{yaml,yml}'" + "format": "prettier --write '{run,lightspeed-stack}.{yaml,yml}'", + "verify": "prettier --check '{run,lightspeed-stack}.{yaml,yml}'" }, - "version": "0.0.0" + "version": "0.1.0" } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..9c3eb31 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +prettier@^3.2.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.1.tgz#8dfbf54c98e85a113962d3d8414ae82ff3722991" + integrity sha512-RWKXE4qB3u5Z6yz7omJkjWwmTfLdcbv44jUVHC5NpfXwFGzvpQM798FGv/6WNK879tc+Cn0AAyherCl1KjbyZQ== From bd15517bc75d9bb67f5cd5fac93a96ea20d9d1b3 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Fri, 28 Nov 2025 12:54:34 -0500 Subject: [PATCH 3/3] resolve conflict and reformat Signed-off-by: Jordan Dubrick --- lightspeed-stack.yaml | 8 +- run.yaml | 318 +++++++++++++++++++++--------------------- 2 files changed, 163 insertions(+), 163 deletions(-) diff --git a/lightspeed-stack.yaml b/lightspeed-stack.yaml index 5f9a982..419fdf5 100644 --- a/lightspeed-stack.yaml +++ b/lightspeed-stack.yaml @@ -12,10 +12,10 @@ llama_stack: # url: http://localhost:8321 # If running in cluster, use this user_data_collection: feedback_enabled: false - feedback_storage: "/tmp/data/feedback" + feedback_storage: '/tmp/data/feedback' authentication: - module: "noop" + module: 'noop' conversation_cache: - type: "sqlite" + type: 'sqlite' sqlite: - db_path: "/tmp/cache.db" \ No newline at end of file + db_path: '/tmp/cache.db' diff --git a/run.yaml b/run.yaml index 376a78c..50d203f 100644 --- a/run.yaml +++ b/run.yaml @@ -1,21 +1,21 @@ version: '2' -image_name: minimal-viable-llama-stack-configuration +image_name: redhat-ai-dev-llama-stack apis: -- agents -- datasetio -- eval -- inference -- post_training -- safety -- scoring -- telemetry -- tool_runtime -- vector_io + - agents + - datasetio + - eval + - inference + - post_training + - safety + - scoring + - telemetry + - tool_runtime + - vector_io benchmarks: [] container_image: datasets: [] -external_providers_dir: "/app-root/config/providers.d" +external_providers_dir: '/app-root/config/providers.d' inference_store: db_path: .llama/distributions/ollama/inference_store.db type: sqlite @@ -25,47 +25,47 @@ metadata_store: namespace: type: sqlite models: -- model_id: sentence-transformers/all-mpnet-base-v2 - metadata: - embedding_dimension: 768 - model_type: embedding - provider_id: sentence-transformers - provider_model_id: "/app-root/embeddings_model" + - model_id: sentence-transformers/all-mpnet-base-v2 + metadata: + embedding_dimension: 768 + model_type: embedding + provider_id: sentence-transformers + provider_model_id: '/app-root/embeddings_model' providers: agents: - - config: - persistence_store: - db_path: .llama/distributions/ollama/agents_store.db - namespace: - type: sqlite - responses_store: - db_path: .llama/distributions/ollama/responses_store.db - type: sqlite - provider_id: meta-reference - provider_type: inline::meta-reference + - config: + persistence_store: + db_path: .llama/distributions/ollama/agents_store.db + namespace: + type: sqlite + responses_store: + db_path: .llama/distributions/ollama/responses_store.db + type: sqlite + provider_id: meta-reference + provider_type: inline::meta-reference datasetio: - - config: - kvstore: - db_path: .llama/distributions/ollama/huggingface_datasetio.db - namespace: - type: sqlite - provider_id: huggingface - provider_type: remote::huggingface - - config: - kvstore: - db_path: .llama/distributions/ollama/localfs_datasetio.db - namespace: - type: sqlite - provider_id: localfs - provider_type: inline::localfs + - config: + kvstore: + db_path: .llama/distributions/ollama/huggingface_datasetio.db + namespace: + type: sqlite + provider_id: huggingface + provider_type: remote::huggingface + - config: + kvstore: + db_path: .llama/distributions/ollama/localfs_datasetio.db + namespace: + type: sqlite + provider_id: localfs + provider_type: inline::localfs eval: - - config: - kvstore: - db_path: .llama/distributions/ollama/meta_reference_eval.db - namespace: - type: sqlite - provider_id: meta-reference - provider_type: inline::meta-reference + - config: + kvstore: + db_path: .llama/distributions/ollama/meta_reference_eval.db + namespace: + type: sqlite + provider_id: meta-reference + provider_type: inline::meta-reference inference: - provider_id: ${env.ENABLE_VLLM:+vllm} provider_type: remote::vllm @@ -91,123 +91,123 @@ providers: provider_type: inline::sentence-transformers config: {} post_training: - - config: - checkpoint_format: huggingface - device: cpu - distributed_backend: - dpo_output_dir: "." - provider_id: huggingface - provider_type: inline::huggingface + - config: + checkpoint_format: huggingface + device: cpu + distributed_backend: + dpo_output_dir: '.' + provider_id: huggingface + provider_type: inline::huggingface safety: - - config: - excluded_categories: [] - provider_id: llama-guard - provider_type: inline::llama-guard - - provider_id: lightspeed_question_validity - provider_type: inline::lightspeed_question_validity - config: - model_id: ${env.VALIDATION_PROVIDER:=vllm}/${env.VALIDATION_MODEL_NAME} - model_prompt: |- - Instructions: + - config: + excluded_categories: [] + provider_id: llama-guard + provider_type: inline::llama-guard + - provider_id: lightspeed_question_validity + provider_type: inline::lightspeed_question_validity + config: + model_id: ${env.VALIDATION_PROVIDER:=vllm}/${env.VALIDATION_MODEL_NAME} + model_prompt: |- + Instructions: - You area question classification tool. You are an expert in the following categories: - - Backstage - - Red Hat Developer Hub (RHDH) - - Kubernetes - - Openshift - - CI/CD - - GitOps - - Pipelines - - Developer Portals - - Deployments - - Software Catalogs - - Software Templates - - Tech Docs + You area question classification tool. You are an expert in the following categories: + - Backstage + - Red Hat Developer Hub (RHDH) + - Kubernetes + - Openshift + - CI/CD + - GitOps + - Pipelines + - Developer Portals + - Deployments + - Software Catalogs + - Software Templates + - Tech Docs - Your job is to determine if a user's question is related to the categories you are an expert in. If the question is related to those categories, \ - or any features that may be related to those categories, you will answer with ${allowed}. + Your job is to determine if a user's question is related to the categories you are an expert in. If the question is related to those categories, \ + or any features that may be related to those categories, you will answer with ${allowed}. - If a question is not related to your expert categories, answer with ${rejected}. + If a question is not related to your expert categories, answer with ${rejected}. - You do not need to explain your answer. + You do not need to explain your answer. - Below are some example questions: - Example Question: - Why is the sky blue? - Example Response: - ${rejected} + Below are some example questions: + Example Question: + Why is the sky blue? + Example Response: + ${rejected} - Example Question: - Can you help configure my cluster to automatically scale? - Example Response: - ${allowed} + Example Question: + Can you help configure my cluster to automatically scale? + Example Response: + ${allowed} - Example Question: - How do I create import an existing software template in Backstage? - Example Response: - ${allowed} + Example Question: + How do I create import an existing software template in Backstage? + Example Response: + ${allowed} - Example Question: - How do I accomplish a task in RHDH? - Example Response: - ${allowed} + Example Question: + How do I accomplish a task in RHDH? + Example Response: + ${allowed} - Example Question: - How do I explore a component in RHDH catalog? - Example Response: - ${allowed} + Example Question: + How do I explore a component in RHDH catalog? + Example Response: + ${allowed} - Example Question: - How can I integrate GitOps into my pipeline? - Example Response: - ${allowed} + Example Question: + How can I integrate GitOps into my pipeline? + Example Response: + ${allowed} - Question: - ${message} - Response: - invalid_question_response: |- - Hi, I'm the Red Hat Developer Hub Lightspeed assistant, I can help you with questions about Red Hat Developer Hub or Backstage. - Please ensure your question is about these topics, and feel free to ask again! + Question: + ${message} + Response: + invalid_question_response: |- + Hi, I'm the Red Hat Developer Hub Lightspeed assistant, I can help you with questions about Red Hat Developer Hub or Backstage. + Please ensure your question is about these topics, and feel free to ask again! 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 + - 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 telemetry: - - config: - service_name: 'lightspeed-stack-telemetry' - sinks: sqlite - sqlite_db_path: .llama/distributions/ollama/trace_store.db - provider_id: meta-reference - provider_type: inline::meta-reference + - config: + service_name: 'lightspeed-stack-telemetry' + sinks: sqlite + sqlite_db_path: .llama/distributions/ollama/trace_store.db + provider_id: meta-reference + provider_type: inline::meta-reference tool_runtime: - - provider_id: model-context-protocol - provider_type: remote::model-context-protocol - config: {} - - provider_id: rag-runtime - provider_type: inline::rag-runtime - config: {} + - provider_id: model-context-protocol + provider_type: remote::model-context-protocol + config: {} + - provider_id: rag-runtime + provider_type: inline::rag-runtime + config: {} vector_io: - - config: - kvstore: - db_path: .llama/distributions/ollama/faiss_store.db - namespace: - type: sqlite - provider_id: faiss - provider_type: inline::faiss - - provider_id: rhdh-docs - provider_type: inline::faiss - config: - kvstore: - type: sqlite - namespace: - db_path: /app-root/vector_db/rhdh_product_docs/1.8/faiss_store.db + - config: + kvstore: + db_path: .llama/distributions/ollama/faiss_store.db + namespace: + type: sqlite + provider_id: faiss + provider_type: inline::faiss + - provider_id: rhdh-docs + provider_type: inline::faiss + config: + kvstore: + type: sqlite + namespace: + db_path: /app-root/vector_db/rhdh_product_docs/1.8/faiss_store.db scoring_fns: [] server: auth: @@ -218,14 +218,14 @@ server: tls_certfile: tls_keyfile: shields: -- shield_id: lightspeed_question_validity-shield - provider_id: lightspeed_question_validity + - shield_id: lightspeed_question_validity-shield + provider_id: lightspeed_question_validity tool_groups: -- provider_id: rag-runtime - toolgroup_id: builtin::rag - description: "Only use for questions specifically about Red Hat Developer Hub (RHDH). Searches technical documentation for RHDH installation, discovery, configuration, release, upgrade, control access, integration, observability, and extending with plugins. Do not use for any other topic outside RHDH." + - provider_id: rag-runtime + toolgroup_id: builtin::rag + description: 'Only use for questions specifically about Red Hat Developer Hub (RHDH). Searches technical documentation for RHDH installation, discovery, configuration, release, upgrade, control access, integration, observability, and extending with plugins. Do not use for any other topic outside RHDH.' vector_dbs: -- embedding_dimension: 768 - embedding_model: sentence-transformers/all-mpnet-base-v2 - provider_id: rhdh-docs - vector_db_id: rhdh-product-docs-1_8 + - embedding_dimension: 768 + embedding_model: sentence-transformers/all-mpnet-base-v2 + provider_id: rhdh-docs + vector_db_id: rhdh-product-docs-1_8