llamaIndex - 💡(How to fix) Fix Improve developer error message for unrecognized embedding names in `load_embed_model` [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Currently, when an invalid embedding name is provided to load_embed_model, the raised error message does not provide any guidance about supported embedding classes.

Error Message

Currently, when an invalid embedding name is provided to load_embed_model, the raised error message does not provide any guidance about supported embedding classes. Currently, LlamaIndex already validates whether an embedding name exists in RECOGNIZED_EMBEDDINGS, but the resulting error message does not expose the list of supported embedding names.

  • trial-and-error with embedding names Currently, when an invalid embedding name is provided, the error message only indicates that the name is invalid without showing the supported options. This can slow down debugging and increase confusion, particularly for: Providing the list of available embedding names directly in the exception message would: The change is also low-risk and fully backward compatible since it only improves the error message content without affecting existing functionality.

Root Cause

Currently, when an invalid embedding name is provided to load_embed_model, the raised error message does not provide any guidance about supported embedding classes.

Fix Action

Fixed

Code Example

if name not in RECOGNIZED_EMBEDDINGS:
    raise ValueError(f"Invalid Embedding name: {name}")

---

if name not in RECOGNIZED_EMBEDDINGS:
    available = ", ".join(sorted(RECOGNIZED_EMBEDDINGS.keys()))
    raise ValueError(
        f"Invalid Embedding name: {name}. "
        f"Available embeddings: {available}"
    )
RAW_BUFFERClick to expand / collapse

Feature Description

Description

Currently, when an invalid embedding name is provided to load_embed_model, the raised error message does not provide any guidance about supported embedding classes.

Current Behavior

if name not in RECOGNIZED_EMBEDDINGS:
    raise ValueError(f"Invalid Embedding name: {name}")

Suggested Change

if name not in RECOGNIZED_EMBEDDINGS:
    available = ", ".join(sorted(RECOGNIZED_EMBEDDINGS.keys()))
    raise ValueError(
        f"Invalid Embedding name: {name}. "
        f"Available embeddings: {available}"
    )

Reason

Currently, LlamaIndex already validates whether an embedding name exists in RECOGNIZED_EMBEDDINGS, but the resulting error message does not expose the list of supported embedding names.

This makes debugging configuration issues harder, especially when:

  • an embedding class name is misspelled
  • optional embedding dependencies are not installed
  • serialized configs contain outdated or invalid class names

At the moment, developers must manually inspect the source code or runtime registry contents to determine valid embedding names.

Existing approaches mainly involve:

  • checking the source implementation directly
  • printing RECOGNIZED_EMBEDDINGS.keys() manually during debugging
  • trial-and-error with embedding names

These approaches work but increase debugging friction and reduce developer experience for a relatively small validation issue.

Value of Feature

This improvement enhances the developer experience by making embedding configuration errors significantly easier to diagnose.

Currently, when an invalid embedding name is provided, the error message only indicates that the name is invalid without showing the supported options. This can slow down debugging and increase confusion, particularly for:

  • new contributors
  • users working with serialized configs
  • environments with optional embedding dependencies installed conditionally

Providing the list of available embedding names directly in the exception message would:

  • reduce debugging time
  • improve usability and clarity
  • make configuration validation more intuitive
  • reduce the need to inspect internal source code during troubleshooting

The change is also low-risk and fully backward compatible since it only improves the error message content without affecting existing functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING