Skip to content

feat: fully switch to external provider module method#37

Merged
leseb merged 1 commit intoopendatahub-io:mainfrom
cdoern:modules
Sep 16, 2025
Merged

feat: fully switch to external provider module method#37
leseb merged 1 commit intoopendatahub-io:mainfrom
cdoern:modules

Conversation

@cdoern
Copy link
Copy Markdown
Collaborator

@cdoern cdoern commented Sep 15, 2025

What does this PR do?

delete providers.d and depend on module for build and run. also delete external_provider_dir from both build and run yaml.

this forces build.py to only install

uv pip install llama_stack_provider_lmeval==0.2.4
uv pip install llama_stack_provider_trustyai_fms==0.2.2

rather than also grabbing dependencies like kubernetes

Summary by CodeRabbit

  • Refactor

    • Consolidated provider configuration into the main distribution; removed use of an external providers directory and no longer populating a separate providers folder in builds.
  • Chores

    • Bundled safety provider pinned to 0.2.2 and evaluation provider pinned to 0.2.4 in the distribution runtime.
  • Removals

    • Removed standalone adapter registrations for the Trustyai LMEval and Trustyai FMS providers; provided via bundled modules.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

Removed top-level external_providers_dir from build/run configs, deleted two Trustyai remote adapter registration files, and added explicit module version pins for trustyai_fms and trustyai_lmeval in distribution/run.yaml. No public APIs changed.

Changes

Cohort / File(s) Summary
External providers dir removal
distribution/build.yaml, distribution/run.yaml
Removed the top-level external_providers_dir configuration entries.
Remote adapter configurations deleted
distribution/providers.d/remote/eval/trustyai_lmeval.yaml, distribution/providers.d/remote/safety/trustyai_fms.yaml
Deleted adapter registration files for Trustyai LMEval (eval) and Trustyai FMS (safety), removing their adapter blocks and dependency declarations.
Container image / packaging changes
distribution/Containerfile, distribution/Containerfile.in
Stopped creating/copying ${HOME}/.llama/providers.d; simplified directory creation to ${HOME}/.llama and ${HOME}/.cache.
Explicit module/version pins added
distribution/run.yaml
Added module entries: providers.safety.trustyai_fmsllama_stack_provider_trustyai_fms==0.2.2; providers.eval.trustyai_lmevalllama_stack_provider_lmeval==0.2.4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibbled at YAML beneath moonlight,
Snipping old paths to make configs bright,
Plugged two gems with versions tight,
Cleared the burrow, tidy and light,
Hops of joy — the build sleeps right. 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: fully switch to external provider module method" accurately and concisely captures the primary change in the changeset: removal of providers.d/external_providers_dir and switching to provider modules (adding module fields and installing provider packages), so it reflects the PR objectives and is clear for reviewers scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • 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 8a794a2 and 280f967.

📒 Files selected for processing (6)
  • distribution/Containerfile (1 hunks)
  • distribution/Containerfile.in (1 hunks)
  • distribution/build.yaml (0 hunks)
  • distribution/providers.d/remote/eval/trustyai_lmeval.yaml (0 hunks)
  • distribution/providers.d/remote/safety/trustyai_fms.yaml (0 hunks)
  • distribution/run.yaml (2 hunks)
💤 Files with no reviewable changes (3)
  • distribution/providers.d/remote/eval/trustyai_lmeval.yaml
  • distribution/build.yaml
  • distribution/providers.d/remote/safety/trustyai_fms.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • distribution/run.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.in
  • 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). (1)
  • GitHub Check: build-test-push (linux/amd64)
🔇 Additional comments (2)
distribution/Containerfile.in (1)

7-7: Template change is correct (${{HOME}} escapes to ${HOME}); providers.d removal consistent with module-based flow.

No issues. Keep this in sync with the generator to avoid drift.

If not already the case, ensure these pins are derived from the same source of truth as run.yaml to prevent version skew between the generated Containerfile and run.yaml.

distribution/Containerfile (1)

48-48: Switch to module-based providers looks correct; confirm runtime user can write to $HOME/.cache.

  • distribution/run.yaml — verified: no external_providers_dir; contains modules llama_stack_provider_trustyai_fms==0.2.2 and llama_stack_provider_lmeval==0.2.4.
  • distribution/Containerfile (line 48) — creates ${HOME}/.llama and ${HOME}/.cache but does not set USER/chown/chmod; confirm the runtime user from the base image can write to ${HOME}/.cache.

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.

@cdoern
Copy link
Copy Markdown
Collaborator Author

cdoern commented Sep 15, 2025

docker is down :(

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: 0

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

79-79: Declare lmeval module on the eval provider (avoid hidden coupling).

llama_stack_provider_lmeval is declared on an inline::meta-reference in distribution/run.yaml while provider_id: trustyai_lmeval has no module; declare the module with the provider to make the dependency explicit (distribution/build.yaml already does this).

   - provider_id: trustyai_lmeval
     provider_type: remote::trustyai_lmeval
+    module: llama_stack_provider_lmeval==${env.LMEVAL_PROVIDER_VERSION:=0.2.4}
     config:

71-71: Parameterize FMS provider version (avoid hard pins across files).

rg found the same hard pin in three places: distribution/run.yaml:71, distribution/build.yaml:15, distribution/Containerfile:44 — centralize via a single env var (same default) so CI/CD can bump once.

Apply to run.yaml (still valid):

-      module: llama_stack_provider_trustyai_fms==0.2.2
+      module: llama_stack_provider_trustyai_fms==${env.FMS_PROVIDER_VERSION:=0.2.2}

Also update:

  • distribution/build.yaml: replace the hard pin with the same ${env.FMS_PROVIDER_VERSION:=0.2.2} form.
  • distribution/Containerfile: add a build ARG (e.g. ARG FMS_PROVIDER_VERSION=0.2.2) and use pip install llama_stack_provider_trustyai_fms==${FMS_PROVIDER_VERSION}.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80e4bf6 and e558007.

📒 Files selected for processing (4)
  • distribution/build.yaml (0 hunks)
  • distribution/providers.d/remote/eval/trustyai_lmeval.yaml (0 hunks)
  • distribution/providers.d/remote/safety/trustyai_fms.yaml (0 hunks)
  • distribution/run.yaml (1 hunks)
💤 Files with no reviewable changes (3)
  • distribution/providers.d/remote/safety/trustyai_fms.yaml
  • distribution/build.yaml
  • distribution/providers.d/remote/eval/trustyai_lmeval.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/run.yaml

Copy link
Copy Markdown
Collaborator

@nathan-weinberg nathan-weinberg left a comment

Choose a reason for hiding this comment

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

You'll need to make some changes to the Containerfile.in as well, see this failure from CI

 > [12/12] COPY distribution/providers.d/ /opt/app-root/src/.llama/providers.d/:
------
Containerfile:50
--------------------
  48 |     RUN mkdir -p ${HOME}/.llama/providers.d ${HOME}/.cache
  49 |     COPY distribution/run.yaml ${APP_ROOT}/run.yaml
  50 | >>> COPY distribution/providers.d/ ${HOME}/.llama/providers.d/
  51 |     
  52 |     ENTRYPOINT ["python", "-m", "llama_stack.core.server.server", "/opt/app-root/run.yaml"]
--------------------
ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref tob88amabijate2le42cdxuvi::m7nnnfel8kzryzflgos090pz9: "/distribution/providers.d": not found

@cdoern cdoern force-pushed the modules branch 2 times, most recently from 424c24c to 1f300a5 Compare September 15, 2025 19:36
delete `providers.d` and depend on `module` for build and run. also delete `external_provider_dir` from both build and run yaml.

this forces `build.py` to only install

uv pip install llama_stack_provider_lmeval==0.2.4
uv pip install llama_stack_provider_trustyai_fms==0.2.2

rather than also grabbing dependencies like `kubernetes`

Signed-off-by: Charlie Doern <cdoern@redhat.com>
Comment thread distribution/Containerfile.in
Copy link
Copy Markdown
Collaborator

@leseb leseb left a comment

Choose a reason for hiding this comment

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

Downstream still lacks a similar update to the run.yaml let's do that before we merge anything here. Thanks!

@nathan-weinberg nathan-weinberg added the do-not-merge Apply to PRs that should not be merged (yet) label Sep 16, 2025
Copy link
Copy Markdown
Collaborator

@nathan-weinberg nathan-weinberg left a comment

Choose a reason for hiding this comment

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

Approving from my side since everything I brought up is addressed

@leseb leseb merged commit b535695 into opendatahub-io:main Sep 16, 2025
5 checks passed
@nathan-weinberg nathan-weinberg removed the do-not-merge Apply to PRs that should not be merged (yet) label Sep 16, 2025
skamenan7 pushed a commit to skamenan7/llama-stack-distribution that referenced this pull request Jan 16, 2026
chore: bump wheel release to use 0.4.1 and fix config file path
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