llm config_error ai_generated true

ValueError: shapes (1,1536) and (1,768) not aligned

ID: llm/embedding-dimension-mismatch

Also available as: JSON · Markdown
90%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active
any active

Root Cause

Embedding dimensions do not match between query and stored vectors.

generic

Workarounds

  1. 95% success Ensure same embedding model is used for indexing and querying
    Store model name alongside vectors; reindex if model changes
  2. 90% success Re-embed all documents when switching embedding models
    Create new vector index with new model; migrate in batch

Dead Ends

Common approaches that don't work:

  1. Truncate or pad vectors to match dimensions 92% fail

    Destroys semantic meaning of the embedding.

  2. Average multiple embeddings to reduce dimension 85% fail

    Averaging across dimensions loses directional information.