---
title: "FlashRank"
type: "tool"
slug: "prithivirajdamodaran-flashrank"
canonical_url: "https://www.graphcanon.com/tools/prithivirajdamodaran-flashrank"
github_url: "https://github.com/PrithivirajDamodaran/FlashRank"
homepage_url: null
stars: 989
forks: 70
primary_language: "Python"
license: "Apache-2.0"
categories: ["data-retrieval", "model-training"]
tags: ["ranking", "full-text-search", "cross-encoder", "lexical-search", "rag", "retrieval-augmented-generation", "hybrid-search", "reranking"]
updated_at: "2026-07-07T19:49:26.423138+00:00"
---

# FlashRank

> Lite & Super-fast re-ranking for your search & retrieval pipelines

FlashRank is an ultra-light Python library designed to enhance existing search and retrieval systems through efficient query re-ranking techniques. This repository supports both pairwise and listwise ranking methods based on advanced LLMs and cross-encoders, ensuring optimal performance with minimal resource requirements.

## Facts

- Repository: https://github.com/PrithivirajDamodaran/FlashRank
- Stars: 989 · Forks: 70 · Open issues: 10 · Watchers: 6
- Primary language: Python
- License: Apache-2.0
- Last pushed: 2026-01-01T04:47:41+00:00

## Categories

- [Data & Retrieval](/categories/data-retrieval.md)
- [Model Training](/categories/model-training.md)

## Tags

ranking, full text search, cross-encoder, lexical-search, rag, retrieval-augmented-generation, hybrid-search, reranking

## Related tools

- [transformers](/tools/huggingface-transformers.md) - 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models (★ 162,350)
- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful platform for building and deploying AI-powered agents and workflows. (★ 151,311)
- [firecrawl](/tools/firecrawl-firecrawl.md) - The API to search, scrape, and interact with the web at scale. (★ 147,150)
- [LLMs-from-scratch](/tools/rasbt-llms-from-scratch.md) - Implement a ChatGPT-like LLM in PyTorch from scratch (★ 98,715)
- [vllm](/tools/vllm-project-vllm.md) - A high-throughput and memory-efficient inference and serving engine for LLMs (★ 85,621)
- [PaddleOCR](/tools/paddlepaddle-paddleocr.md) - PaddleOCR: A powerful OCR toolkit for transforming PDFs/images into structured data (★ 84,921)
- [graphify](/tools/graphify-labs-graphify.md) - AI coding assistant skill that transforms various file types into a queryable knowledge graph (★ 79,421)
- [worldmonitor](/tools/koala73-worldmonitor.md) - Real-time global intelligence dashboard. (★ 61,522)

## README (excerpt)

```text
<p align ="center">
<img width=200 src = "./images/fr_logo.png">
</p>




<div align="center">






</div>


<div align="center">

  <p align="center">
    <b>Re-rank your search results with SoTA Pairwise or Listwise rerankers before feeding into your LLMs</b>
    <br />
  </p>
</div>


Ultra-lite &amp; Super-fast Python library to add re-ranking to your existing search &amp; retrieval pipelines. It is based on SoTA LLMs and cross-encoders, with gratitude to all the model owners. 


Supports:

- Pairwise / Pointwise rerankers. (Cross encoder based, i.e. ```Max tokens = 512```)
- Listwise LLM based rerankers. (LLM based, i.e. ```Max tokens = 8192```)
- See below for full list of supported models.

---
> Before you proceed. **Thanks to Tiger-CRM for sponsoring my work,** they source OSS developers [check it out](https://github.com/Tiger-CRM)
---

# Table of Contents  

1. [Features](#features)  
2. [Installation](#installation)
3. [Making ranking faster](#making-ranking-faster)
4. [Getting started](#getting-started)
5. [Deployment patterns](#deployment-patterns)
6. [How to Cite?](#how-to-cite)
7. [Papers citing flashrank](#papers-citing-flashrank) 


## Features

1. ⚡ **Ultra-lite**: 
    - **No Torch or Transformers** needed. Runs on CPU.
    - Boasts the **tiniest reranking model in the world, ~4MB**.
    
2. ⏱️ **Super-fast**:
    - Rerank speed is a function of **# of tokens in passages, query + model depth (layers)**
    - To give an idea, Time taken by the example (in code) using the default model is below.
    - <center><img src="./images/time.png" width=600/></center>
    - Detailed benchmarking, TBD

3. 💸 **$ concious**:
    - **Lowest $ per invocation:** Serverless deployments like Lambda are charged by memory & time per invocation*
    - **Smaller package size** = shorter cold start times, quicker re-deployments for Serverless.

4. 🎯 **Based on SoTA Cross-encoders and other models**:
    - "How good are Zero-shot rerankers?" - look at the reference section.
    

| Model Name | Description | Size | Notes |
|------------|-------------|------|-------|
| `ms-marco-TinyBERT-L-2-v2` | Default model | ~4MB | [Model card](https://huggingface.co/cross-encoder/ms-marco-TinyBERT-L-2) |
| `ms-marco-MiniLM-L-12-v2` | `Best Cross-encoder reranker`  | ~34MB | [Model card](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-12-v2) |
| `rank-T5-flan` | Best non cross-encoder reranker | ~110MB | [Model card](https://huggingface.co/bergum/rank-T5-flan) |
| `ms-marco-MultiBERT-L-12` | Multi-lingual, supports 100+ languages | ~150MB | [Supported languages](https://github.com/google-research/bert/blob/master/multilingual.md#list-of-languages) |
| `ce-esci-MiniLM-L12-v2` | Fine-tuned on Amazon ESCI dataset | - | [Model card](https://huggingface.co/metarank/ce-esci-MiniLM-L12-v2) |
| `rank_zephyr_7b_v1_full` | 4-bit-quantised GGUF | ~4GB | [Model card](https://huggingface.co/castorini/rank_zephyr_7b_v1_full) |
| `miniReranker_arabic_v1` | `Only dedicated Arabic Reranker` | - | [Model card](https://huggingface.co/prithivida/miniReranker_arabic_v1) |


   - Models in roadmap:
      * InRanker
   - Why sleeker models are preferred ? Reranking is the final leg of larger retrieval pipelines, idea is to avoid any extra overhead especially for user-facing scenarios. To that end models with really small footprint that doesn't need any specialised hardware and yet offer competitive performance are chosen. Feel free to raise issues to add support for a new models as you see fit.

## Installation:
#### If you need lightweight pairwise rerankers [default] 
```python 
pip install flashrank
```

#### If you need LLM based listwise rerankers
```python 
pip install flashrank[listwise]
```


## Making ranking faster:

```max_length``` value should be large able to accomodate your longest passage. In other words if your longest passage (100 tokens) + query (16 tokens) pair by token estimate is 116 then say setting ```max_length = 128``` is good enough
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/prithivirajdamodaran-flashrank`](/api/graphcanon/tools/prithivirajdamodaran-flashrank)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
