Model reference · open weights
jina-reranker-en is an open-weight embedding model from jinaai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Maker | jinaai |
|---|---|
| Type | Embedding models |
| Task | Reranker |
| Parameters (lead) | 38M |
| Context | 8k tokens |
| Runs with | transformers |
| Released | 2024-04-15 |
| Popularity | 12k downloads / month |
| Licence | Open weights |
About
This model is designed for blazing-fast reranking while maintaining competitive performance. What's more, it leverages the power of our JinaBERT model as its foundation. JinaBERT itself is a unique variant of the BERT architecture that supports the symmetric bidirectional variant of ALiBi. This allows jina-reranker-v1-turbo-en to process significantly longer sequences of text compared to other reranking models, up to an impressive 8,192 tokens.
To achieve the remarkable speed, the jina-reranker-v1-turbo-en employ a technique called knowledge distillation. Here, a complex, but slower, model (like our original jina-reranker-v1-base-en) acts as a teacher, condensing its knowledge into a smaller, faster student model. This student retains most of the teacher's knowledge, allowing it to deliver similar accuracy in a fraction of the time.
Here's a breakdown of the reranker models we provide:
| Model Name | Layers | Hidden Size | Parameters (Millions) |
|---|---|---|---|
| jina-reranker-v1-base-en | 12 | 768 | 137.0 |
| jina-reranker-v1-turbo-en | 6 | 384 | 37.8 |
| jina-reranker-v1-tiny-en | 4 | 384 | 33.0 |
Currently, the
jina-reranker-v1-base-enmodel is not available on Hugging Face. You can access it via the Jina AI Reranker API.
As you can see, the jina-reranker-v1-turbo-en offers a balanced approach with 6 layers and 37.8 million parameters. This translates to fast search and reranking while preserving a high degree of accuracy. The jina-reranker-v1-tiny-en prioritizes speed even further, achieving the fastest inference speeds with its 4-layer, 33.0 million parameter architecture. This makes it ideal for scenarios where absolute top accuracy is less crucial.
jina-reranker-v1-turbo-en is to use Jina AI's Reranker API.curl https://api.jina.ai/v1/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "jina-reranker-v1-turbo-en",
"query": "Organic skincare products for sensitive skin",
"documents": [
"Eco-friendly kitchenware for modern homes",
"Biodegradable cleaning supplies for eco-conscious consumers",
"Organic cotton baby clothes for sensitive skin",
"Natural organic skincare range for sensitive skin",
"Tech gadgets for smart homes: 2024 edition",
"Sustainable gardening tools and compost solutions",
"Sensitive skin-friendly facial cleansers and toners",
"Organic food wraps and storage solutions",
"All-natural pet food for dogs with allergies",
"Yoga mats made from recycled materials"
],
"top_n": 3
}'
sentence-transformers>=0.27.0 library. You can install it via pip:pip install -U sentence-transformers
Then, you can use the following code to interact with the model:
from sentence_transformers import CrossEncoder
# Load the model, here we use our turbo sized model
model = CrossEncoder("jinaai/jina-reranker-v1-turbo-en", trust_remote_code=True)
# Example query and documents
query = "Organic skincare products for sensitive skin"
documents = [
"Eco-friendly kitchenware for modern homes",
"Biodegradable cleaning supplies for eco-conscious consumers",
"Organic cotton baby clothes for sensitive skin",
"Natural organic skincare range for sensitive skin",
"Tech gadgets for smart homes: 2024 edition",
"Sustainable gardening tools and compost solutions",
"Sensitive skin-friendly facial cleansers and toners",
"Organic food wraps and storage solutions",
"All-natural pet food for dogs with allergies",
"Yoga mats made from recycled materials"
]
results = model.rank(query, documents, return_documents=True, top_k=3)
transformers library to interact with the model programmatically.!pip install transformers
from transformers import AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained(
'jinaai/jina-reranker-v1-turbo-en', num_labels=1, trust_remote_code=True
)
# Example query and documents
query = "Organic skincare products for sensitive skin"
documents = [
"Eco-friendly kitchenware for modern homes",
"Biodegradable cleaning supplies for eco-conscious consumers",
"Organic cotton baby clothes for sensitive skin",
"Natural organic skincare range for sensitive skin",
"Tech gadgets for smart homes: 2024 edition",
"Sustainable gardening tools and compost solutions",
"Sensitive skin-friendly facial cleansers and toners",
"Organic food wraps and storage solutions",
"All-natural pet food for dogs with allergies",
"Yoga mats made from recycled materials"
]
# construct sentence pairs
sentence_pairs = [[query, doc] for doc in documents]
scores = model.compute_score(sentence_pairs)
transformers.js library to run the model directly in JavaScript (in-browser, Node.js, Deno, etc.)!If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @xenova/transformers
Then, you can use the following code to interact with the model:
import { AutoTokenizer, AutoModelForS
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys jina-reranker-en for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (jina-reranker-en below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"jina-reranker-en","input":"text to embed"}'
Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.