Skip to content

feat: allow for more customization around embedding model#157

Merged
mergify[bot] merged 1 commit intoopendatahub-io:mainfrom
nathan-weinberg:custom-embed
Dec 11, 2025
Merged

feat: allow for more customization around embedding model#157
mergify[bot] merged 1 commit intoopendatahub-io:mainfrom
nathan-weinberg:custom-embed

Conversation

@nathan-weinberg
Copy link
Copy Markdown
Collaborator

@nathan-weinberg nathan-weinberg commented Dec 9, 2025

What does this PR do?

make embedding dimension, model_id, and provider_model_id configurable fields. prev hardcoded values are now defaults.

update TrustyAI config to use TRUSTYAI_EMBEDDING_MODEL instead of EMBEDDING_MODEL

Summary by CodeRabbit

  • Chores

    • Renamed the environment variable selecting the TrustyAI embedding model for clarity (now TRUSTYAI_EMBEDDING_MODEL).
    • Made embedding configuration environment-driven: embedding dimension, default model ID, and provider model ID now configurable via environment variables.
    • Minor configuration formatting adjustments to align related settings.
  • Documentation

    • Updated distribution README to reflect the new environment variable name and environment-driven defaults.

✏️ Tip: You can customize this high-level summary in your review settings.

@nathan-weinberg nathan-weinberg requested a review from a team December 9, 2025 18:51
@nathan-weinberg nathan-weinberg added the do-not-merge Apply to PRs that should not be merged (yet) label Dec 9, 2025
@nathan-weinberg
Copy link
Copy Markdown
Collaborator Author

holding for signoff from RAG and TrustyAI teams

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Environment variable references updated: EMBEDDING_MODELTRUSTYAI_EMBEDDING_MODEL in TrustyAI eval entries; several embedding-related fields in distribution/run.yaml were parameterized to use environment variables with defaults (embedding dimension, model_id, provider_model_id).

Changes

Cohort / File(s) Summary
Docs & README update
distribution/README.md
Replaced EMBEDDING_MODEL with TRUSTYAI_EMBEDDING_MODEL for the inline::trustyai_ragas entry.
Runtime configuration updates
distribution/run.yaml
Switched eval/provider embedding model references from ${env.EMBEDDING_MODEL} to ${env.TRUSTYAI_EMBEDDING_MODEL} (affecting trustyai_lmeval and trustyai_ragas inline & remote). Parameterized previously hard-coded model metadata to env vars with defaults: metadata.embedding_dimension${env.EMBEDDING_DIMENSION:=768}, model_id${env.EMBEDDING_MODEL:=granite-embedding-125m-english}, provider_model_id${env.EMBEDDING_PROVIDER_MODEL_ID:=ibm-granite/granite-embedding-125m-english}. Minor indentation alignment in trustyai_lmeval block.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify all TrustyAI eval blocks (trustyai_lmeval, trustyai_ragas inline & remote) consistently reference TRUSTYAI_EMBEDDING_MODEL.
  • Confirm env var defaults (EMBEDDING_DIMENSION:=768, EMBEDDING_MODEL:=granite-embedding-125m-english, EMBEDDING_PROVIDER_MODEL_ID:=ibm-granite/...) match deployment requirements.
  • Check README and run.yaml remain synchronized and indentation changes preserve YAML semantics.

Poem

🐰 I nibbled strings in config light,
Swapped a name and set defaults right,
TRUSTYAI now finds its tune,
Embeddings hum beneath the moon. ✨

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 PR title 'feat: allow for more customization around embedding model' accurately summarizes the main change: making embedding-related configurations (dimension, model_id, provider_model_id) configurable via environment variables instead of hardcoded values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 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 d2ac45e and 7b5e788.

📒 Files selected for processing (2)
  • distribution/README.md (1 hunks)
  • distribution/run.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • distribution/README.md
⏰ 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 (3)
distribution/run.yaml (3)

125-126: ✓ Indentation formatting corrected.

The trustyai_lmeval configuration fields are now properly indented under the config: block, improving YAML structure consistency.


127-127: Verify embedding model environment variable renaming doesn't break external documentation or tooling.

The PR updates TrustyAI embedding references from EMBEDDING_MODEL to TRUSTYAI_EMBEDDING_MODEL. Lines 127 (provider activation), 131, and 136 (embedding_model references) now use the new variable name. Confirm that:

  1. All documentation (README, deployment guides, examples) has been updated to reflect TRUSTYAI_EMBEDDING_MODEL
  2. Any automation, tests, or CI/CD pipelines using EMBEDDING_MODEL in TrustyAI contexts have been updated accordingly

The conditional activation syntax on line 127 (using ${env.TRUSTYAI_EMBEDDING_MODEL:+trustyai_ragas_inline}) correctly enables the provider only when the variable is set.

Also applies to: 131-131, 136-136


273-276: ✓ Embedding model parameters successfully parameterized.

The embedding configuration now supports environment variable overrides for:

  • embedding_dimension (default: 768)
  • model_id (default: granite-embedding-125m-english)
  • provider_model_id (default: ibm-granite/granite-embedding-125m-english)

All defaults preserve previous hardcoded behavior, and the full model name in the defaults correctly reflects the complete HuggingFace model identifier per previous review discussion. Environment variable syntax with the env. prefix is consistent with the rest of the file.


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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d5e171 and 8dbcb31.

📒 Files selected for processing (2)
  • distribution/README.md (1 hunks)
  • distribution/run.yaml (2 hunks)
⏰ 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 (3)
distribution/README.md (1)

17-17: Documentation update correctly reflects the environment variable rename.

The change aligns with the run.yaml updates that use TRUSTYAI_EMBEDDING_MODEL for TrustyAI eval configurations.

distribution/run.yaml (2)

133-145: Verify eval provider configuration changes.

Lines 133-134 appear to be new fields added to the trustyai_lmeval provider config. Please confirm:

  1. Are use_k8s and base_url new fields required by the updated provider version?
  2. Are the environment variable defaults correct?

Additionally, the changes to lines 135 and 144 correctly switch from EMBEDDING_MODEL to TRUSTYAI_EMBEDDING_MODEL, aligning with the PR objective and README update.


281-285: Verify embedding dimension and model_id defaults are appropriate.

The externalization of embedding model metadata (lines 281-284) looks good and aligns with the PR objective. The defaults appear sensible:

  • EMBEDDING_DIMENSION:=768 (standard dimension)
  • EMBEDDING_MODEL:=granite-embedding-125m (matches previous hardcoded value)
  • EMBEDDING_PROVIDER_MODEL_ID:=ibm-granite/granite-embedding-125m-english (matches previous hardcoded value)

However, please confirm that these defaults match the previously hardcoded values and are appropriate for the distribution's use case.

Copy link
Copy Markdown
Collaborator

@skamenan7 skamenan7 left a comment

Choose a reason for hiding this comment

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

LGTM except that code rabbit pointed out at "Comment on lines R281 to R284"

Copy link
Copy Markdown
Contributor

@jgarciao jgarciao left a comment

Choose a reason for hiding this comment

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

LGTM. Let's wait until Francisco and/or Bill answer about the question of the embedding model name

@ruivieira
Copy link
Copy Markdown
Member

/lgtm

@Elbehery
Copy link
Copy Markdown
Collaborator

LGTM

I don't wanna approve till the question above has been resolved, otherwise the bot will merge it 👍🏽

@nathan-weinberg
Copy link
Copy Markdown
Collaborator Author

LGTM

I don't wanna approve till the question above has been resolved, otherwise the bot will merge it 👍🏽

Bot will not merge since I have the do-not-merge label set, so you can safely approve 😄

make embedding dimension, model_id, and provider_model_id
configurable fields. prev hardcoded values are now defaults.

update TrustyAI config to use TRUSTYAI_EMBEDDING_MODEL
instead of EMBEDDING_MODEL

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 Dec 10, 2025
module: llama_stack_provider_ragas.remote
config:
embedding_model: ${env.EMBEDDING_MODEL:=}
embedding_model: ${env.TRUSTYAI_EMBEDDING_MODEL:=}
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.

how is this model going to be served? i don't see it being optionally registered down below, is it expected?

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.

This was not happening before so AFAIK yes this is expected

@cdoern cdoern added the do-not-merge Apply to PRs that should not be merged (yet) label Dec 10, 2025
@cdoern
Copy link
Copy Markdown
Collaborator

cdoern commented Dec 10, 2025

holding for the comments.

@nathan-weinberg nathan-weinberg removed the do-not-merge Apply to PRs that should not be merged (yet) label Dec 11, 2025
@mergify mergify bot merged commit 26f30f9 into opendatahub-io:main Dec 11, 2025
6 checks passed
@nathan-weinberg nathan-weinberg deleted the custom-embed branch December 11, 2025 15:57
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.