Open-Weight LLM · Private & Custom AI

bge-reranker-v2-gemma

A multilingual reranker for RAG systems and retrieval pipelines—rank passages by relevance to queries, run it privately.

BGE Reranker v2-Gemma is a 2.5B-parameter text-classification model (Gemma base) fine-tuned to score query-passage relevance. Unlike embeddings, it outputs a direct relevance score in one forward pass. For ops teams building RAG, search, or document-routing automation, it's a compact, deployable ranking layer you control end-to-end.

2.5B
Parameters
apache-2.0
License (OSI/permissive)
Unknown
Context
591.5k
Downloads

Model facts

DeveloperBAAI
Parameters2.5B
Context windowUnknown
Licenseapache-2.0 — OSI/permissive
Tasktext-classification
GatedNo
Downloads591.5k
Likes86
Updated2024-03-19
SourceBAAI/bge-reranker-v2-gemma

Private deployment

Run bge-reranker-v2-gemma in your own environment

Self-host on modest CPU/GPU infra (~5–8 GB VRAM in FP16). Load via FlagEmbedding library (pip install, wrapped inference) or raw transformers. No cloud calls, no query logging—your retrieval context stays in-house. Supports FP16/BF16 quantization for edge/lower-power deployment. Organizations handling sensitive documents, internal wikis, or regulated data get full architectural control over the ranking step.

Operational AI use cases

01

Internal Knowledge Routing & Search Automation

Ops teams ingest SOPs, runbooks, and FAQs into vector stores, then use bge-reranker-v2-gemma to rank candidate documents *after* vector retrieval. Rerank the top-100 embeddings down to the top-5 most relevant for final presentation or agent consumption. Keeps retrieval accurate in multilingual orgs; reduces noise in knowledge-base queries.

02

Support Ticket Auto-Triage & Resolution Suggestion

Score incoming support tickets against past resolutions or KB articles. Route urgent tickets correctly and surface relevant historical cases. Run reranking on-premise—no sending tickets to third-party APIs. Reduces MTTR by surfacing the most on-topic prior resolutions first.

03

Contract & Compliance Document Retrieval

Legal/Finance teams search contracts and compliance docs. Use reranker to validate that retrieved docs actually match the query intent (e.g., "payment terms") before human review. Self-hosted reranking keeps sensitive contract data off public clouds.

Custom AI

As a base for custom AI

Use as a reranking layer in a bespoke retrieval agent or knowledge application. Fine-tune it on domain-specific query-passage pairs (contract Q&A, medical records, technical docs) to improve ranking for your vertical. The Gemma backbone supports instruction-following and is small enough to retrain/adapter-tune in-house.

In the operating system

Where it fits

Sits *after* embedding retrieval (dense vector search) in a RAG or knowledge pipeline. Feed top-K candidates from FAISS/Milvus/Pinecone into the reranker; output ranked list for final display, agent context, or LLM prompt. Also works as a standalone relevance-classification layer (Yes/No: does this doc answer the query?) for workflows that don't need embeddings.

Data control & security

Private self-hosting means query-passage pairs never leave your infrastructure; no third-party reranking APIs, no logging on external servers. Useful for regulated industries (healthcare, finance, legal) where retrieval context is sensitive. Architecture is your responsibility—data protection depends on your deployment environment (network, access controls, persistence). Not a cryptographic guarantee; operational data isolation only.

Hardware footprint

**Estimate:** ~2.5B params (Gemma-2B base). FP32: ~10 GB. FP16/BF16: ~5–6 GB VRAM. Inference latency ~50–200 ms per pair (batch-dependent) on modern GPUs; CPU feasible for low-QPS offline scoring. Quantization (INT8, ONNX) can reduce footprint further but not documented in model card.

Integration

Expose via Python microservice (FastAPI/Flask) or batch process. Integrate with search engines (Elasticsearch plugins, Vespa), vector DBs (output of retrieval → reranker input → filtered results), or agent orchestrators (LangChain, LlamaIndex). Input: list of [query, passage] pairs. Output: float scores (normalize=True → [0, 1] via sigmoid). Supports batching for throughput. Tokenizer max_length 512–1024; truncate long documents.

When it's not the right fit

  • Your org requires zero-shot reranking without domain fine-tuning—BGE v2-Gemma was trained on English/Chinese pairs; out-of-domain ranking (e.g., scientific abstracts, specialized jargon) may degrade unless you adapt.
  • You need sub-50ms latency at scale—2.5B model requires non-trivial compute; embedding-only pipelines (no reranking) are faster if you can accept lower precision.
  • Context length is critical—model works best on passage pairs under 512 tokens; very long documents must be chunked, losing document-level coherence.
  • You operate in a low-connectivity environment without periodic model updates—reranker quality depends on data distribution; no built-in drift detection or active learning.

Alternatives to consider

BAAI/bge-reranker-v2-m3

Smaller (XLM-RoBERTa base), lower memory, faster inference. Better for CPU-only or edge deployment; multilingual but slightly less performant on English. No fine-tuning on LLM architecture.

Cohere Rerank (proprietary / Rerank v3)

Cloud-based, state-of-the-art, no infrastructure overhead. Trade-off: data leaves your environment, API costs scale with volume. Use if privacy is not a requirement and you want zero ops burden.

CohereForAI/jina-reranker-v2-base-multilingual

Comparable size/speed, also multilingual, Apache 2.0. Different architecture (encoder-only). Good fallback if you want to benchmark two rerankers with similar footprint.

FAQ

Can I fine-tune this model on my domain-specific queries?

Yes. Load via transformers, prepare query-passage pairs with relevance labels (binary Yes/No or scores), and fine-tune the sequence-classification head. FlagEmbedding docs include fine-tuning scripts. Keep it on-premise to avoid data egress.

What license applies to models I build with bge-reranker-v2-gemma?

Apache 2.0 (permissive). You can use it commercially, modify it, and redistribute. The *Gemma base* also has Apache 2.0 (Google). Verify that your downstream application complies with Gemma's usage policies (Google's terms). Requires review of commercial product licensing if you redistribute.

Is this better than just using embeddings and cosine similarity?

Rerankers are more accurate for relevance judgments because they see both query and passage jointly. Embeddings are fast and scale to billions; rerankers are slower but more precise. Typical workflow: embeddings for retrieval speed, reranker for precision. Both are complementary, not replacements.

Can I deploy this on-device (mobile, edge)?

With quantization (INT8, ONNX export), possibly. 2.5B is still large for most phones, but feasible on tablets/edge servers. FlagEmbedding doesn't document mobile export; you'd need to export to ONNX/TensorFlow Lite and test. Requires significant engineering.

Build a Private RAG System with BGE Reranker

Pair bge-reranker-v2-gemma with LLM.co to architect end-to-end retrieval pipelines—embedding, reranking, and LLM orchestration—all in your environment. No API calls, full data control. Let's design your custom knowledge system.