You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(embedding): optionally truncate oversized embeddings to configured dims
Matryoshka (MRL) embedding models served behind OpenAI-compatible endpoints
(llama.cpp, some vLLM builds) ignore the `dimensions=` request parameter and
always return their native dimension. Honcho then hard-fails on the dimension
mismatch, making these models unusable even though truncating an MRL vector to
a smaller size is valid.
Add an opt-in `EMBEDDING_TRUNCATE_TO_DIMENSIONS` flag. When enabled and the
provider returns a vector larger than `EMBEDDING_VECTOR_DIMENSIONS`, keep the
leading components and L2-renormalize so cosine/inner-product similarity stays
well-defined. Off by default, so a genuinely misconfigured model still fails
loudly.
Also keeps embeddings at or below pgvector's 2000-dimension HNSW index cap when
the native model dimension exceeds it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments