v3.6.2 HN-4 — assert that the query-time embedder model matches the
HNSW index's build-time model. Standalone helper so the check is
unit-testable in isolation from embeddingsSearch (which depends on
loading the real ONNX embedder runtime).
Throws a clear, actionable error on mismatch instead of letting the
caller compute cosine distances between vectors from two different
vector spaces (which would silently return garbage similarities).
Parameters
embedderAlias: string
The alias of the embedder being used at search
time (typically embedder.model.alias after loadEmbedder(...)).
hnswAlias: string
The alias the HNSW index was built with (stored
on the HnswSearchContext at server boot).
v3.6.2 HN-4 — assert that the query-time embedder model matches the HNSW index's build-time model. Standalone helper so the check is unit-testable in isolation from
embeddingsSearch(which depends on loading the real ONNX embedder runtime).Throws a clear, actionable error on mismatch instead of letting the caller compute cosine distances between vectors from two different vector spaces (which would silently return garbage similarities).