forked from cline/cline
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Deepinfra "encoding_format": "float" embedding fix
#8971
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
Open
zadzanl
wants to merge
9
commits into
RooCodeInc:main
Choose a base branch
from
zadzanl:feature/deepinfra-embedding-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+332
−25
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update branch to latest - 31 Oct 2025
…ld index
Added support for DeepInfra-hosted embedding models and fix a critical bug where
the 'type' field index was missing in Qdrant, causing "Bad Request" errors
during code search operations.
Changes:
- Added DeepInfra provider detection in OpenAICompatibleEmbedder
* Detect DeepInfra URLs (deepinfra.com)
* Use 'float' encoding format for DeepInfra, 'base64' for other standard
providers
* Handle both float array and base64 string embedding responses
* Added validation for embedding values (NaN/Infinity checking)
- Fix missing Qdrant payload index for 'type' field
* Non-existing `type` field causes "Bad Request" during `codebase_search`
tool invocation
* Create keyword index for 'type' field to support metadata filtering
* Resolves "Index required but not found for 'type' field" error
- Added 7 DeepInfra embedding model profiles:
* Qwen/Qwen3-Embedding-0.6B (1024 dims)
* Qwen/Qwen3-Embedding-4B (2560 dims)
* Qwen/Qwen3-Embedding-8B (4096 dims)
* intfloat/multilingual-e5-large-instruct (1024 dims)
* google/embeddinggemma-300m (768 dims)
* BAAI/bge-m3 (1024 dims)
* BAAI/bge-large-en-v1.5 (1024 dims)
- Added some test coverage for DeepInfra
* Provider validation
* Encoding format tests
* Float array and base64 response handling tests
* Configuration validation tests
Tested with: embeddinggemma-300m, text-embedding-004, multilingual-e5-large
|
Review complete - no new issues found. This merge from main is clean and maintains the DeepInfra embedding fix functionality. Mention @roomote in a comment to trigger your PR Fixer agent and make changes to this pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
PR - Needs Preliminary Review
size:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Deepinfra-compatible Embeddings Provider
Related GitHub Issue
Closes: #7199
Description
Fixes 7199 -
Adds Deepinfra embedding support via provider url detection.
Incompatibility is caused by DeepInfra returning embeddings as float arrays,
but Roo Code expect base64.
What changed?
Fixed Qdrant bug - missing 'type' field index was causing "Bad Request" errorsWhy automatic detection?
The original issue asked for a manual toggle, but url auto-detection is much simpler
for users (and i'm bad at UIs 😅) - no configuration needed, works out of the box. Also,
to my knowledge, only deepinfra uses
"encoding_format": "float"Test Procedure
Acceptance Criteria Addressed (from 7199):
Given DeepInfra provider with float array responses:
encoding_format: "float"Error Handling:
Backward Compatibility
encoding_format: "base64"encoding_format: floatUnit Tests Added:
Manual Testing:
google/embeddinggemma-300m,Qwen/Qwen3-Embedding-0.6B, andmultilingual-e5-largeerrors during code search
Pre-Submission Checklist
(see "Related GitHub Issue" above).
(if applicable).
updates (see "Documentation Updates" section below).
Contributor Guidelines.
Screenshots / Videos
N/A - This PR contains backend infrastructure changes with no UI modifications.
The changes are internal to the embedding system and vector db integration
Documentation Updates
Maybe? likely minor changes to Step 3 of RooCode Codebase Indexing to add notes when using Deepinfra
Additional Notes
Future Works:
Get in Touch
Discord: badgambit
Important
Adds automatic DeepInfra URL detection for embedding format handling and new DeepInfra models, ensuring compatibility with existing providers.
openai-compatible.tsand switches tofloatencoding.floatarrays for DeepInfra andbase64for others increateEmbeddings()and_embedBatchWithRetries().EMBEDDING_MODEL_PROFILESinembeddingModels.ts.openai-compatible.spec.ts.floatandbase64responses.QdrantVectorStoreinqdrant-client.tsto handle named vectors and improve error handling.This description was created by
for 0f21a6a. You can customize this summary. It will automatically update as commits are pushed.