{"data":{"slug":"prithivirajdamodaran-flashrank","name":"FlashRank","tagline":"Ultra-lite & Super-fast Python library for re-ranking search results.","github_url":"https://github.com/PrithivirajDamodaran/FlashRank","owner":"PrithivirajDamodaran","repo":"FlashRank","owner_avatar_url":"https://avatars.githubusercontent.com/u/7071019?v=4","primary_language":"Python","stars":989,"forks":70,"topics":["cross-encoder","full-text-search","hybrid-search","lexical-search","rag","ranking","reranking","retrieval-augmented-generation","semantic-search","vector-database","vector-search"],"archived":false,"github_pushed_at":"2026-01-01T04:47:41+00:00","url":"https://www.graphcanon.com/tools/prithivirajdamodaran-flashrank","markdown_url":"https://www.graphcanon.com/tools/prithivirajdamodaran-flashrank.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/prithivirajdamodaran-flashrank","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=prithivirajdamodaran-flashrank","description":"Lite & Super-fast re-ranking for your search & retrieval pipelines.  Supports SoTA Listwise and Pairwise reranking based on LLMs and  cross-encoders and more.  Created by Prithivi Da, open for PRs & Collaborations.","homepage_url":null,"license":"Apache-2.0","open_issues":10,"watchers":6,"ai_summary":"FlashRank is a lightweight, fast library for enhancing existing search and retrieval systems with pairwise or listwise re-ranking techniques based on both cross-encoders and large language models (LLMs).","readme_excerpt":"<p align =\"center\">\n<img width=200 src = \"./images/fr_logo.png\">\n</p>\n\n\n\n\n<div align=\"center\">\n\n\n\n\n\n\n</div>\n\n\n<div align=\"center\">\n\n  <p align=\"center\">\n    <b>Re-rank your search results with SoTA Pairwise or Listwise rerankers before feeding into your LLMs</b>\n    <br />\n  </p>\n</div>\n\n\nUltra-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. \n\n\nSupports:\n\n- Pairwise / Pointwise rerankers. (Cross encoder based, i.e. ```Max tokens = 512```)\n- Listwise LLM based rerankers. (LLM based, i.e. ```Max tokens = 8192```)\n- See below for full list of supported models.\n\n---\n> Before you proceed. **Thanks to Tiger-CRM for sponsoring my work,** they source OSS developers [check it out](https://github.com/Tiger-CRM)\n---\n\n# Table of Contents  \n\n1. [Features](#features)  \n2. [Installation](#installation)\n3. [Making ranking faster](#making-ranking-faster)\n4. [Getting started](#getting-started)\n5. [Deployment patterns](#deployment-patterns)\n6. [How to Cite?](#how-to-cite)\n7. [Papers citing flashrank](#papers-citing-flashrank) \n\n\n## Features\n\n1. ⚡ **Ultra-lite**: \n    - **No Torch or Transformers** needed. Runs on CPU.\n    - Boasts the **tiniest reranking model in the world, ~4MB**.\n    \n2. ⏱️ **Super-fast**:\n    - Rerank speed is a function of **# of tokens in passages, query + model depth (layers)**\n    - To give an idea, Time taken by the example (in code) using the default model is below.\n    - <center><img src=\"./images/time.png\" width=600/></center>\n    - Detailed benchmarking, TBD\n\n3. 💸 **$ concious**:\n    - **Lowest $ per invocation:** Serverless deployments like Lambda are charged by memory & time per invocation*\n    - **Smaller package size** = shorter cold start times, quicker re-deployments for Serverless.\n\n4. 🎯 **Based on SoTA Cross-encoders and other models**:\n    - \"How good are Zero-shot rerankers?\" - look at the reference section.\n    \n\n| Model Name | Description | Size | Notes |\n|------------|-------------|------|-------|\n| `ms-marco-TinyBERT-L-2-v2` | Default model | ~4MB | [Model card](https://huggingface.co/cross-encoder/ms-marco-TinyBERT-L-2) |\n| `ms-marco-MiniLM-L-12-v2` | `Best Cross-encoder reranker`  | ~34MB | [Model card](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-12-v2) |\n| `rank-T5-flan` | Best non cross-encoder reranker | ~110MB | [Model card](https://huggingface.co/bergum/rank-T5-flan) |\n| `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) |\n| `ce-esci-MiniLM-L12-v2` | Fine-tuned on Amazon ESCI dataset | - | [Model card](https://huggingface.co/metarank/ce-esci-MiniLM-L12-v2) |\n| `rank_zephyr_7b_v1_full` | 4-bit-quantised GGUF | ~4GB | [Model card](https://huggingface.co/castorini/rank_zephyr_7b_v1_full) |\n| `miniReranker_arabic_v1` | `Only dedicated Arabic Reranker` | - | [Model card](https://huggingface.co/prithivida/miniReranker_arabic_v1) |\n\n\n   - Models in roadmap:\n      * InRanker\n   - 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.\n\n## Installation:\n#### If you need lightweight pairwise rerankers [default] \n```python \npip install flashrank\n```\n\n#### If you need LLM based listwise rerankers\n```python \npip install flashrank[listwise]\n```\n\n\n## Making ranking faster:\n\n```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","github_created_at":"2023-12-04T14:23:44+00:00","created_at":"2026-07-07T17:44:46.436515+00:00","updated_at":"2026-07-07T20:14:25.75574+00:00","categories":[{"slug":"data-retrieval","name":"Data & Retrieval","url":"https://www.graphcanon.com/categories/data-retrieval","markdown_url":"https://www.graphcanon.com/categories/data-retrieval.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/data-retrieval"}],"tags":[{"slug":"ranking","name":"ranking"},{"slug":"full-text-search","name":"full-text-search"},{"slug":"cross-encoder","name":"cross-encoder"},{"slug":"lexical-search","name":"lexical-search"},{"slug":"rag","name":"rag"},{"slug":"retrieval-augmented-generation","name":"retrieval-augmented-generation"},{"slug":"hybrid-search","name":"hybrid-search"},{"slug":"reranking","name":"reranking"}]}}