Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector Dimension Mismatch Error When Switching to gpt-4o-mini in SQLite Database #2577

Closed
rferrari opened this issue Jan 20, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@rferrari
Copy link
Contributor

Describe the bug

Using an SQLite database, after changing models to gpt-4o-mini, I encountered the following vector error:

I started using the default OpenAI models, then switched the MEDIUM and LARGE models to gpt-4o-mini and encountered this error.


To Reproduce

  1. Use an SQLite database as the storage backend.
  2. Start with the default OpenAI models.
  3. Change the MEDIUM and LARGE models to gpt-4o-mini.
  4. Attempt to start agents.

Expected behavior

The system should seamlessly support model changes without vector dimension mismatches or database errors.


Screenshots

["⛔ SqliteError: Vector dimension mismatch. First vector has 384 dimensions, while the second has 1536 dimensions."]

⛔ ERRORS
Error starting agents:
{"code":"SQLITE_ERROR"}


Additional context

It seems the SQLite database stores vectors with a specific dimension (384 in this case) that is incompatible with the gpt-4o-mini model (1536 dimensions). This may require re-indexing or updating the schema for the new vector size.

@rferrari rferrari added the bug Something isn't working label Jan 20, 2025
@veebull
Copy link

veebull commented Jan 21, 2025

get same error when switch llm from openai to another
just removed db.sqlite file in

📁 eliza/
└── 📁 agent/
           └── 📁 data/
                     └── 📄 db.sqlite

and then

pnpm start

and in my case everything works fine

@AIFlowML
Copy link
Collaborator

@rferrari the vector shape is wrong in the old DB and is correct 1536 in the request.
When you change models from local to OAI or else the embedding become 1536 standard OAI.
You have to remove the old DB that is not compliant anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants