feat: add Jina Embeddings v5 text-nano and text-small as alternative models#245
Open
feat: add Jina Embeddings v5 text-nano and text-small as alternative models#245
Conversation
Add jina-embeddings-v5-text-nano (239M, 768d, 8K ctx) and jina-embeddings-v5-text-small (677M, 1024d, 32K ctx) as configurable alternatives to the default embeddinggemma-300M. Format functions now auto-detect Jina v5 models and apply the correct Query:/Document: prefix format instead of the nomic-style task/title format used by embeddinggemma.
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
Add Jina Embeddings v5 as alternative embedding models, configurable via
LlamaCppConfig.embedModel.Two models available as GGUF from HuggingFace:
MMTEB scores vs model size. jina-v5-text models outperform models 2-16x their size. (source)
MTEB English v2 scores. v5-text-nano (239M) achieves 71.0, matching models with 2x+ parameters. (source)
Both v5 models use a different task prefix format (
Query:/Document:) compared to embeddinggemma's nomic-style format. The format functions auto-detect Jina v5 URIs and apply the correct prefix.Changes
JINA_V5_NANO_EMBED_MODELandJINA_V5_SMALL_EMBED_MODELconstants,isJinaV5Model()utility, model-awareformatQueryForEmbedding()/formatDocForEmbedding()embedModelUrito format functions at all embed call sitesembedModelUrito format functions at all embed/query call sitesUsage
Not changed
Default model remains embeddinggemma-300M. This is additive only.
Paper: arXiv:2602.15547 | Blog | MTEB Leaderboard