Skip to content

CreateCollectionRequest: require explicit vector size (drop 1536 default)#27

Merged
jordanpartridge merged 1 commit into
mainfrom
remove-1536-default
Jul 7, 2026
Merged

CreateCollectionRequest: require explicit vector size (drop 1536 default)#27
jordanpartridge merged 1 commit into
mainfrom
remove-1536-default

Conversation

@jordanpartridge

Copy link
Copy Markdown
Contributor

Audit finding: the request default of 1536 (OpenAI dimension) sits in an ecosystem standardized on 1024 (bge-large everywhere — know CLI, lexi, mindkeeper, all 25 live collections). Construct the request bare and the collection silently comes out dimension-incompatible with every embedding this stack produces; first symptom is upsert failures much later.

  • $size now nullable, no default; defaultBody() throws InvalidArgumentException when neither $size nor $namedVectors is given
  • Qdrant::createCollection() already required $size, so nothing changes for client-API users
  • Tests: 181 passed (2 updated to pass size explicitly, 1 new throw case); PHPStan + pint clean

The 1536 default (OpenAI text-embedding dimension) was a footgun in an
ecosystem standardized on 1024 (bge-large): construct the request
without a size and the collection silently comes out incompatible with
every embedding this stack produces. Size is now nullable with no
default; building the body without size or namedVectors throws.
Qdrant::createCollection() already required size, so client-API users
are unaffected.

@lexi-chief-of-staff lexi-chief-of-staff Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it.

  • Removes the 1536 OpenAI default that silently produced dimension-mismatched collections against the 1024 bge-large stack.
  • defaultBody() now throws early with a clear message when neither $size nor $namedVectors is supplied.
  • Qdrant::createCollection() API unchanged.
  • All affected tests updated and new throw case covered; suite green.

@jordanpartridge
jordanpartridge merged commit da9d2f8 into main Jul 7, 2026
2 checks passed
@jordanpartridge
jordanpartridge deleted the remove-1536-default branch July 7, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant