BAAI/bge-reranker-v2-m3

BAAI/bge-reranker-v2-m3 is a lightweight reranker model with strong multilingual capabilities. It’s easy to deploy and offers fast inference.

Model details

CategoryDetails
Model NameBAAI/bge-reranker-v2-m3
VersionOriginal
Model CategoryReranker
Size568M parameters
HuggingFace ModelBAAI/bge-reranker-v2-m3
LicenseApache 2.0

Capabilities

FeatureDetails
Azion Long-term Support (LTS)✅ / ❌
Context Length8192
Supports LoRA
Input dataText

Usage

Rerank example

This is an example of a basic rerank request using this model:

Terminal window
curl -X POST \
http://endpoint-url/rerank \
-H 'Content-Type: application/json' \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"query": "What is deep learning?",
"documents": [
"Deep learning is a subset of machine learning that uses neural networks with many layers",
"The weather is nice today",
"Deep learning enables computers to learn from large amounts of data",
"I like pizza"
]
}'

Score example

This is an example of a basic score request using this model:

Terminal window
curl -X POST \
http://endpoint-url/score \
-H 'Content-Type: application/json' \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"text_1": "What is deep learning?",
"text_2": [
"Deep learning is a subset of machine learning that uses neural networks with many layers",
"The weather is nice today",
"Deep learning enables computers to learn from large amounts of data",
"I like pizza"
]
}'

Running with Edge Functions:

This is an example of how to run this model using Edge Functions:

const modelResponse = await Azion.AI.run("baai-bge-reranker-v2-m3", {
"query": "What is deep learning?",
"documents": [
"Deep learning is a subset of machine learning that uses neural networks with many layers",
"The weather is nice today",
"Deep learning enables computers to learn from large amounts of data",
"I like pizza"
]
})

JSON schema

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"query",
"documents"
],
"properties": {
"query": {
"type": "string"
},
"documents": {
"type": "array",
"items": {
"type": "string"
}
},
"top_n": {
"type": "integer"
},
"max_tokens_per_doc": {
"type": "integer"
}
}
}