Repository navigation
Conversation
Adds EMBEDDINGS_PROVIDER=voyage on top of langchain-voyageai (official voyageai SDK). Supports the voyage-4, voyage-3.x, code, finance, law and voyage-context models. EMBEDDINGS_MODEL is required (no default) and validated, EMBEDDINGS_DIMENSIONS is checked per model, truncation is off, and a vector/text count mismatch from auto-chunking is rejected.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The RAG API can embed with OpenAI, Azure, Hugging Face, Ollama, Bedrock and Google, but not with Voyage AI. This adds
EMBEDDINGS_PROVIDER=voyage, built onlangchain-voyageai(which calls the officialvoyageaiSDK), the same way the other providers wrap their LangChain integrations.voyage-4-large,voyage-4,voyage-4-lite,voyage-code-4,voyage-3-large,voyage-3.5,voyage-3.5-lite,voyage-code-3,voyage-finance-2,voyage-law-2.voyage-context-4,voyage-context-3, run with auto-chunking (chunk_size=32000) in document mode and without chunking for queries.EMBEDDINGS_MODELmust name one of the models above, otherwise the app stops at startup.EMBEDDINGS_DIMENSIONSis checked per model (256/512/1024/2048, or only 1024 forvoyage-finance-2andvoyage-law-2).VOYAGE_API_KEY(orRAG_VOYAGE_API_KEY, which takes precedence, like the otherRAG_*keys).Rerank and multimodal embeddings are not part of this change: the project has neither.
Testing
pytest: 333 passed;pytest -m integration: 35 passed./query) for every model with its native dimension, 256 and 2048 (1024 forvoyage-finance-2/voyage-law-2), and checked the stored vector sizes.