Skip to content

feat: add TrustyAI Ragas inline and remote providers#52

Merged
nathan-weinberg merged 1 commit intoopendatahub-io:mainfrom
nathan-weinberg:ragas
Oct 6, 2025
Merged

feat: add TrustyAI Ragas inline and remote providers#52
nathan-weinberg merged 1 commit intoopendatahub-io:mainfrom
nathan-weinberg:ragas

Conversation

@nathan-weinberg
Copy link
Copy Markdown
Collaborator

@nathan-weinberg nathan-weinberg commented Sep 25, 2025

Summary by CodeRabbit

  • New Features

    • Added RAG-based evaluation support with both inline and remote provider options.
  • Configuration

    • Introduced EMBEDDING_MODEL environment variable to select embeddings; exposed to build, test, and runtime.
  • Documentation

    • Updated provider listings to include the new inline and remote RAG evaluation entries.
  • Chores

    • Container build now installs the RAG evaluation provider dependency; tests and run scripts forward EMBEDDING_MODEL.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Adds installation of llama_stack_provider_ragas[remote]==0.3.0 to the container build, registers new inline and remote trustyai_ragas eval providers wired to EMBEDDING_MODEL, updates distribution docs, sets EMBEDDING_MODEL in CI, and passes EMBEDDING_MODEL into the smoke test run.

Changes

Cohort / File(s) Summary
Container build deps
distribution/Containerfile
Inserts pip install llama_stack_provider_ragas[remote]==0.3.0 into the image build steps (positioned after llama_stack_provider_lmeval==0.2.4).
Distribution spec: eval providers
distribution/build.yaml
Adds an inline eval provider entry for trustyai_ragas referencing llama_stack_provider_ragas[remote]==0.3.0.
Runtime config: eval providers
distribution/run.yaml
Adds two providers: trustyai_ragas_inline (llama_stack_provider_ragas.inline) and trustyai_ragas_remote (llama_stack_provider_ragas.remote), both using EMBEDDING_MODEL. Remote provider includes a kubeflow_config mapped to KUBEFLOW_* env vars (results_s3_prefix, s3_credentials_secret_name, pipelines_endpoint, namespace, llama_stack_url, base_image).
Docs table update
distribution/README.md
Adds rows for `eval
CI workflow env
.github/workflows/redhat-distro-container.yml
Sets EMBEDDING_MODEL=granite-embedding-125m in the build-test-push job environment.
Tests / runtime env
tests/smoke.sh
Passes EMBEDDING_MODEL into the container runtime via the docker run invocation in the smoke test script.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant E as Eval Orchestrator
  participant C as Runtime Config (run.yaml)
  participant P_inline as trustyai_ragas.inline
  participant P_remote as trustyai_ragas.remote
  participant KF as Kubeflow Pipelines
  participant S3 as S3 Storage

  U->>E: Request evaluation
  E->>C: Resolve provider & env (uses EMBEDDING_MODEL)
  alt inline provider
    E->>P_inline: Run eval (embedding_model)
    P_inline-->>E: Return results
  else remote provider
    E->>P_remote: Submit job (embedding_model, kubeflow_config)
    P_remote->>KF: Launch pipeline
    KF->>S3: Store artifacts (results_s3_prefix)
    KF-->>P_remote: Job status & artifact refs
    P_remote-->>E: Return results reference
  end
  E-->>U: Return evaluation outcome
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through layers, code and straw,
A tiny wheel of package law.
Inline or remote, embeddings sing,
Pipelines wake and results take wing.
🥕 — from a rabbit who builds with spring

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change of adding both inline and remote TrustyAI Ragas providers without extraneous detail or noise.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0676c46 and d88ccca.

📒 Files selected for processing (6)
  • .github/workflows/redhat-distro-container.yml (1 hunks)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
  • tests/smoke.sh (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • distribution/README.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/redhat-distro-container.yml
  • distribution/run.yaml
  • tests/smoke.sh
  • distribution/build.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-15T14:25:54.837Z
Learnt from: nathan-weinberg
PR: opendatahub-io/llama-stack-distribution#33
File: distribution/Containerfile:17-21
Timestamp: 2025-09-15T14:25:54.837Z
Learning: In the opendatahub-io/llama-stack-distribution repository, the distribution/Containerfile is auto-generated by distribution/build.py based on configuration in build.yaml. When providers are added to build.yaml, the build script automatically regenerates the Containerfile with the required dependencies. Changes to the Containerfile should not be flagged as manual edits if they correspond to legitimate changes in the build configuration.

Applied to files:

  • distribution/Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary
🔇 Additional comments (1)
distribution/Containerfile (1)

44-45: Addition looks good.

Version pin and extras flag match the new TrustyAI Ragas provider integration, and the install stanza aligns with the surrounding RUN blocks. No issues spotted.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
distribution/run.yaml (1)

116-127: Gate remote RAGAS on Kubeflow readiness to avoid half-configured provider

Currently gated only by EMBEDDING_MODEL, so the remote provider may be included without Kubeflow settings, leading to runtime failures. Gate inclusion on a Kubeflow var (e.g., KUBEFLOW_PIPELINES_ENDPOINT) as well.

Example change:

-  - provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas_remote}
+  - provider_id: ${env.KUBEFLOW_PIPELINES_ENDPOINT:+trustyai_ragas_remote}

Optionally require both by introducing a dedicated toggle (e.g., USE_TRUSTYAI_RAGAS_REMOTE) or by documenting that both EMBEDDING_MODEL and Kubeflow vars must be set.

Please confirm which Kubeflow fields are mandatory for this provider. If both EMBEDDING_MODEL and KUBEFLOW_PIPELINES_ENDPOINT must be set, we can add a clearer toggle.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b2d68f and 0fe0c64.

📒 Files selected for processing (4)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-15T14:25:54.837Z
Learnt from: nathan-weinberg
PR: opendatahub-io/llama-stack-distribution#33
File: distribution/Containerfile:17-21
Timestamp: 2025-09-15T14:25:54.837Z
Learning: In the opendatahub-io/llama-stack-distribution repository, the distribution/Containerfile is auto-generated by distribution/build.py based on configuration in build.yaml. When providers are added to build.yaml, the build script automatically regenerates the Containerfile with the required dependencies. Changes to the Containerfile should not be flagged as manual edits if they correspond to legitimate changes in the build configuration.

Applied to files:

  • distribution/Containerfile
  • distribution/build.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary
🔇 Additional comments (4)
distribution/Containerfile (1)

44-45: Adds required RAGAS provider dependency — looks good

Version pin matches run.yaml and build.yaml.

Please confirm if 0.1.1 is the intended minimum and compatible with llama-stack==0.2.22.

distribution/README.md (2)

14-14: Docs entry for inline RAGAS added — OK

Reflects the new inline provider.


16-16: Docs entry for remote RAGAS added — OK

Reflects the new remote provider.

distribution/run.yaml (1)

111-116: Inline RAGAS provider wiring looks correct

Gates on EMBEDDING_MODEL and pins module 0.1.1. Note: build.yaml currently uses different provider_type strings; fix there for consistency.

Ensure EMBEDDING_MODEL is always set when enabling this provider to avoid invalid config.

@nathan-weinberg nathan-weinberg force-pushed the ragas branch 2 times, most recently from db1ba45 to c5e02ed Compare September 25, 2025 17:56
@nathan-weinberg nathan-weinberg added the do-not-merge Apply to PRs that should not be merged (yet) label Sep 25, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
distribution/run.yaml (2)

116-128: Gate remote RAGAS provider on Kubeflow endpoint (safer activation).

Currently it’s gated on EMBEDDING_MODEL; if Kubeflow isn’t configured, enabling a remote provider may cause startup or runtime failures. Prefer gating on KUBEFLOW_PIPELINES_ENDPOINT (or a relevant required knob).

Apply this minimal change:

-  - provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas_remote}
+  - provider_id: ${env.KUBEFLOW_PIPELINES_ENDPOINT:+trustyai_ragas_remote}

199-203: Parameterize embedding config values
Use environment variables for embedding_dimension, model_id, and provider_model_id to avoid mismatches when overriding EMBEDDING_MODEL.

-    embedding_dimension: 768
-  model_id: granite-embedding-125m
+    embedding_dimension: ${env.EMBEDDING_DIMENSION:=768}
+  model_id: ${env.EMBEDDING_MODEL:=granite-embedding-125m}
   provider_id: sentence-transformers
-  provider_model_id: ibm-granite/granite-embedding-125m-english
+  provider_model_id: ${env.EMBEDDING_PROVIDER_MODEL_ID:=ibm-granite/granite-embedding-125m-english}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe0c64 and c5e02ed.

📒 Files selected for processing (5)
  • .github/workflows/redhat-distro-container.yml (1 hunks)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-15T14:25:54.837Z
Learnt from: nathan-weinberg
PR: opendatahub-io/llama-stack-distribution#33
File: distribution/Containerfile:17-21
Timestamp: 2025-09-15T14:25:54.837Z
Learning: In the opendatahub-io/llama-stack-distribution repository, the distribution/Containerfile is auto-generated by distribution/build.py based on configuration in build.yaml. When providers are added to build.yaml, the build script automatically regenerates the Containerfile with the required dependencies. Changes to the Containerfile should not be flagged as manual edits if they correspond to legitimate changes in the build configuration.

Applied to files:

  • distribution/Containerfile
  • distribution/build.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary
🔇 Additional comments (4)
distribution/build.yaml (1)

24-27: Normalize the provider_type names to match runtime config.

distribution/run.yaml declares these providers as inline::trustyai_ragas / remote::trustyai_ragas, but here they’re registered as inline::trustyai_ragas_inline / remote::trustyai_ragas_remote. That mismatch breaks the one-to-one mapping the build tooling expects between provider types and the modules we ship, which can lead to stale docs and harder-to-track provider metadata. Please align the strings.

-    - provider_type: inline::trustyai_ragas_inline
+    - provider_type: inline::trustyai_ragas
       module: llama_stack_provider_ragas==0.1.1
-    - provider_type: remote::trustyai_ragas_remote
+    - provider_type: remote::trustyai_ragas
       module: llama_stack_provider_ragas==0.1.1
distribution/README.md (1)

14-17: Docs updated to list RAGAS providers — LGTM.

New inline and remote eval providers are reflected correctly. File is auto‑generated.

distribution/run.yaml (1)

111-116: Inline RAGAS provider addition — LGTM; ensure model exists.

Config looks correct. Just ensure the EMBEDDING_MODEL value is defined in the models section so provider resolution doesn’t fail at startup.

distribution/Containerfile (1)

44-45: Approve RAGAS provider dependency pin

0.1.1 is available on PyPI and consistently used across all distribution files.

RUN pip install \
llama_stack_provider_lmeval==0.2.4
RUN pip install \
llama_stack_provider_ragas==0.1.1
Copy link
Copy Markdown
Contributor

@dmaniloff dmaniloff Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once trustyai-explainability/llama-stack-provider-ragas#17 is merged this will need to be updated to ~ 0.2.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now llama-stack-provider-ragas==0.3.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmaniloff thanks for your effort on trustyai-explainability/llama-stack-provider-ragas#17

Just curious, if this provider is compatible with LLS 0.2.23 ?

cc @m-misiura

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce71029 and 80c0f61.

📒 Files selected for processing (6)
  • .github/workflows/redhat-distro-container.yml (1 hunks)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
  • tests/smoke.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • distribution/README.md
  • .github/workflows/redhat-distro-container.yml
  • distribution/Containerfile
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-15T14:25:54.837Z
Learnt from: nathan-weinberg
PR: opendatahub-io/llama-stack-distribution#33
File: distribution/Containerfile:17-21
Timestamp: 2025-09-15T14:25:54.837Z
Learning: In the opendatahub-io/llama-stack-distribution repository, the distribution/Containerfile is auto-generated by distribution/build.py based on configuration in build.yaml. When providers are added to build.yaml, the build script automatically regenerates the Containerfile with the required dependencies. Changes to the Containerfile should not be flagged as manual edits if they correspond to legitimate changes in the build configuration.

Applied to files:

  • distribution/build.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 2, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @nathan-weinberg please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a660202 and 464f2c5.

📒 Files selected for processing (6)
  • .github/workflows/redhat-distro-container.yml (1 hunks)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
  • tests/smoke.sh (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • distribution/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/redhat-distro-container.yml
  • distribution/Containerfile
  • distribution/build.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary

Copy link
Copy Markdown
Collaborator

@cdoern cdoern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides the question on the build yaml, this lgtm

eval:
- provider_type: remote::trustyai_lmeval
module: llama_stack_provider_lmeval==0.2.4
- provider_type: inline::trustyai_ragas
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only adds inline, right? what about remote::trustyai_ragas?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, asked the Trusty team about that in Slack

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will install the package with the additional remote deps so it will add both inline and remote providers.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about the module line? Because my concern is around the provider_type line

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 2, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @nathan-weinberg please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
distribution/README.md (1)

16-18: Document all required env vars for remote Ragas.

The remote provider still reads EMBEDDING_MODEL, so folks enabling it must set both EMBEDDING_MODEL and KUBEFLOW_LLAMA_STACK_URL. Please clarify the row to list both requirements to avoid misconfigurations.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 464f2c5 and 0676c46.

📒 Files selected for processing (6)
  • .github/workflows/redhat-distro-container.yml (1 hunks)
  • distribution/Containerfile (1 hunks)
  • distribution/README.md (1 hunks)
  • distribution/build.yaml (1 hunks)
  • distribution/run.yaml (1 hunks)
  • tests/smoke.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • distribution/build.yaml
  • .github/workflows/redhat-distro-container.yml
  • tests/smoke.sh
  • distribution/Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-push (linux/amd64)
  • GitHub Check: Summary

@nathan-weinberg
Copy link
Copy Markdown
Collaborator Author

cc @ruivieira for context

config:
use_k8s: ${env.TRUSTYAI_LMEVAL_USE_K8S:=true}
base_url: ${env.VLLM_URL:=}
- provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas_inline}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas_inline}
- provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas}

module: llama_stack_provider_ragas.inline
config:
embedding_model: ${env.EMBEDDING_MODEL:=}
- provider_id: ${env.KUBEFLOW_LLAMA_STACK_URL:+trustyai_ragas_remote}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- provider_id: ${env.KUBEFLOW_LLAMA_STACK_URL:+trustyai_ragas_remote}
- provider_id: ${env.KUBEFLOW_LLAMA_STACK_URL:+trustyai_ragas}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if both providers are enabled? Will this still work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Yes it will work, but users will not have a way to differentiate when doing client.benchmarks.register. I tested this and the provider to be added last via run.yaml will override the previous one.

Should we bring back the suffix to better support the case of both providers enabled?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I'm going to leave it in the YAML for now

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
@nathan-weinberg nathan-weinberg removed the do-not-merge Apply to PRs that should not be merged (yet) label Oct 6, 2025
@Elbehery
Copy link
Copy Markdown
Collaborator

Elbehery commented Oct 6, 2025

LGTM

actually I already adjusted downstream MR accordingly

@nathan-weinberg nathan-weinberg merged commit 5dec14f into opendatahub-io:main Oct 6, 2025
6 checks passed
@nathan-weinberg nathan-weinberg deleted the ragas branch October 6, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants