-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
App Version
3.19.5
API Provider
Ollama via OpenAI-Compatible Embedding API
Model Used
snowflake-arctic-embed2
🔁 Steps to Reproduce
Holy smokes there's so many bugs with the Codebase Indexing support I am not even sure where to start.
First of all, the embedding provider config does not reliably save itself and resets both the provider choice and random config param values, so if you try to reproduce this, make sure it actually saved your settings by checking back to it a few times...
I finally did get codebase indexing working with a fix to the OpenAI-Compatible provider. I was previously blocked by this: #1935, which is why I am using OpenAI-Compatible for ollama instead of native ollama support.
Steps to reproduce this current bug:
0. Run ollama pull snowflake-arctic-embed2
- Run
docker run -p 6333:6333 qdrant/qdrant - Enable Codebase Indexing checkbox in Roo Experimental Settings (flask icon)
- Set OpenAI-Compatible as embeddings provider
- Set Base URL to
http://127.0.0.1:11434/v1 - Set API Key to
whatever - Set embedding model to
snowflake-arctic-embed2 - Set embeddings dimension to
1024 - Leave qdrant url as
http://localhost:6333.
Click Save and Done. Restart vscode, make sure these settings applied. Set them again. Restart again.
Do this a few times until all settings actually save. They will not save properly the first time.
Once they finally have saved such that they are the same after a restart, click "index"
Watch your qdrant docker container logs. it will have the error:
WARN collection::shards::replica_set::update: Failed to update shard ws-ee207033c79ae4df:0 on peer 4059754735917558, error: Wrong input: Vector dimension error: expected dim: 1024, got 256
This is because the OpenAI typescript package has some deep dark code that misparses the embeddings array. Maybe a mismatch with OpenAI's actual API's encoding mechanisms? Probably sabotage, though 😜.
I have a patch here: https://github.com/dflatline/Roo-Code/tree/embed_dimfix2.
As soon as the bot finishes giving me useless advice, I will post an MR and instructions on getting it working with ollama (there's also a batch size problem to hack around, which also degrades embedding quality and causes coverage loss: ollama/ollama#6262).
💥 Outcome Summary
Expected useless advice from the auto-reply bot. Got useless advice from the useless auto-reply bot.
I have a fix though! I finally got codebase indexing working! Will provide instructions and a patch after the bot spams us with nonsense.
📄 Relevant Logs or Errors (Optional)
The qdrant log to watch for is:
`WARN collection::shards::replica_set::update: Failed to update shard ws-ee207033c79ae4df:0 on peer 4059754735917558, error: Wrong input: Vector dimension error: expected dim: 1024, got 256`
But only if you specify an embedding dimension. If you don't I bet the OpenAI sabotage succeeds and you see nothing; you just store truncated embeddings (which are less accurate, of course, making you want to pay for their official API and give them a copy of all your data).Metadata
Metadata
Assignees
Labels
Type
Projects
Status