# Dimension mismatch: the vector and the index disagree

## The error

Upsert or query fails with a message like: vector dimension 768 does not match the dimension of the index 1536. The request is rejected; nothing is written.

## Cause

The embedding model changed (or was never the one the index was built for). text-embedding-3-small gives 1536, text-embedding-3-large gives 3072, many open models give 768 or 1024. The index dimension was frozen at creation.

## Fix

1. Confirm both sides: `len(embedding)` from your model, and `pc.describe_index(name)` for the index dimension.
2. If the model is right and the index is wrong: create a new index with the right dimension and re-ingest. There is no alter-index.
3. If the index is right and the model is wrong: switch back to the model the index was built for.

## Never do this

Truncate or zero-pad vectors to force the fit. It silently destroys recall and the damage is invisible until someone evaluates. Dimension is a contract between the model and the index; keep it explicit in config, not inferred.