Skip to content

fix(indexer): resolve named embedder/VLM endpoints from the hydrated registry (fail loud on embedder mismatch) #562

Description

@andyne13

Background

#560 fixed the indexer Ray actor to hydrate the DB-backed model-endpoint registry and resolve named LLM endpoints (contextualization / topic tagging). The same root cause still affects other model types at index time, because the indexer's factories are built in IndexerPool.__init__ before the lazy registry hydration.

Problem

  • Embedder — high severity (silent data corruption). _build_embedder_factory(cfg) returns None when cfg.models.embedder is empty at __init__ (it is, pre-hydration), so the factory is captured as None. _select_embedder then silently falls back to the global default embedder (cfg.embedder from env). A partition configured with a named embedder is silently ignored at index time → documents embedded with the wrong model → vectors incompatible with the query-side embedder → silently broken retrieval, with no error raised.
  • VLM — lower severity. build_indexer_pool passes no vlm_factory (only a default VLM built from env cfg.vlm), so a per-partition named VLM is ignored for index-time image captioning, and admin-UI changes to the VLM endpoint never reach the indexer.

Not affected: the reranker (retrieval-only, runs in the API process) and the query/API process in general (it hydrates at startup and invalidates client caches on every endpoint CRUD).

Fix

  • Give the embedder factory (and a new VLM factory) the same treatment the LLM factories got in fix(indexer): hydrate model-endpoint registry so admin-UI-registered LLM endpoints resolve #560: read the live cfg.models.* dict instead of capturing an empty snapshot / early-returning None at build time, and cache one client per endpoint identity (full-config hash, like _endpoint_identity) so endpoint edits propagate after a reload.
  • Embedder must fail loud, never silent-fallback: an enabled named embedder that cannot be resolved must raise and fail the file — silently embedding with a different model (wrong vectors) is worse than a failed file. (This differs from the LLM enhancement path, which intentionally skips gracefully.)
  • Wire a vlm_factory into the indexer pipeline for per-partition VLM selection.

References

Follows #560 / #554. Part of the v2.0 (refactor/hexagonal) release prep.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions