Add Novita as an embeddings provider option - #75
Open
jax-novita wants to merge 1 commit into
Open
jax-novita wants to merge 1 commit into
jax-novita wants to merge 1 commit into
Conversation
Boop's embeddings wrapper tries providers in order: Voyage, then OpenAI, then falls back to a local Transformers.js model. This adds Novita's OpenAI-compatible embeddings endpoint (baai/bge-m3) as a third paid option, tried after OpenAI and before the local fallback. Novita's endpoint returns 1024-dim vectors, matching the existing Convex vector index requirement, so no schema changes are needed.
Contributor
Greptile SummaryAdds Novita as the third paid embeddings provider, using
Confidence Score: 4/5The setup flow should be updated before merging because selecting Local can retain a Novita key and continue paid embedding requests. The new provider-selection branch activates any retained Files Needing Attention: server/embeddings.ts and scripts/setup.ts
|
| Filename | Overview |
|---|---|
| server/embeddings.ts | Adds Novita request and selection logic, but the new environment-key branch is not coordinated with the interactive setup flow. |
| debug/src/components/EmbeddingBanner.tsx | Correctly extends the dashboard’s provider union and exhaustive label map for Novita. |
| .env.example | Documents the Novita key and provider order, although setup does not yet expose or consistently clear that key. |
| README.md | Updates user-facing provider documentation consistently. |
| CHANGELOG.md | Records the new provider and its 1024-dimensional model output. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
S[Embedding request] --> V{VOYAGE_API_KEY?}
V -->|Yes| Voyage[Voyage]
V -->|No| O{OPENAI_API_KEY?}
O -->|Yes| OpenAI[OpenAI]
O -->|No| N{NOVITA_API_KEY?}
N -->|Yes| Novita[Novita baai/bge-m3]
N -->|No| Local[Local BGE-large]
Reviews (1): Last reviewed commit: "Add Novita as an embeddings provider opt..." | Re-trigger Greptile
| export function activeProvider(): EmbeddingProvider { | ||
| if (process.env.VOYAGE_API_KEY) return "voyage"; | ||
| if (process.env.OPENAI_API_KEY) return "openai"; | ||
| if (process.env.NOVITA_API_KEY) return "novita"; |
Contributor
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
Adds
NOVITA_API_KEYas a third paid embeddings provider option inserver/embeddings.ts, tried after Voyage/OpenAI and before the local Transformers.js fallback.Changes
server/embeddings.ts: newembedNovita()helper (same shape asembedOpenAI()), plus oneNOVITA_API_KEYcheck each inactiveProvider(),embed(), andpreloadLocalModel(). Usesbaai/bge-m3via Novita's OpenAI-compatible/openai/v1/embeddingsendpoint, which returns 1024-dim vectors — matching the existing Convex vector index requirement, so no schema changes.debug/src/components/EmbeddingBanner.tsx: adds"novita"to theStatus["provider"]union and its label..env.example,README.md: documentsNOVITA_API_KEYalongside the existing Voyage/OpenAI options.CHANGELOG.md: adds anUnreleasedentry per CONTRIBUTING.md.Verification
npm run typecheck/npm test: same pre-existing failures before and after (missingconvex/_generated/api.js, generated byconvex dev); no new errors, no regressions in the 31 passing tests.embed()/activeProvider()directly from this repo's ownserver/embeddings.tswith onlyNOVITA_API_KEYset (no Voyage/OpenAI keys):activeProvider()returned"novita", andembed()returned a real 1024-dim vector from a live call to Novita's/openai/v1/embeddingsendpoint.