Model or dataset
PrithivirajDamodaran/FlashRank avatar
PrithivirajDamodaran/FlashRank

FlashRank reranks in ONNX, and its release notes stopped in 2024

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.

1,015 stars75 forksPythonApache-2.0

At a glance

What is it?
A Python reranking library that avoids Torch and Transformers entirely, with a 4MB default cross-encoder. The install declares Python 3.6 as the floor, the newest release is 0.2.9 from November 2024, and the commit history runs to July 2026.
Who is it for?
FlashRank is for the case where you already have a retrieval stage producing candidates and cannot justify a GPU or a multi-gigabyte model to sort them. Its reason to exist is that reranking is the last leg of a pipeline, so the overhead lands on the user-facing path, and a 4MB ONNX model that runs on CPU addresses exactly that.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 127 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • PrithivirajDamodaran/FlashRank1,015 ★ · +9
Star history
Repository2026-09-122026-11-15
PrithivirajDamodaran/FlashRank1k1k

9 Stars in the last 64 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The dependency list is the whole argument

The install declaration is short enough to read in one breath: `tokenizers`, `onnxruntime`, `numpy`, `requests` and `tqdm`. No Torch, no Transformers, no model hub client, no accelerate. That is what lets the library run on CPU and in a Lambda handler without a GPU layer or a container image measured in gigabytes. The README frames the economics in serverless terms, since those platforms bill by memory and time per invocation, so a smaller package is a smaller cold start and a cheaper invocation. The declared Python floor is 3.6, which is generous for a 2020s package and says the authors have not revisited it. The payoff is a model that loads in a process you probably already have.

Seven models, and the default is the 4MB one

The model table runs from tiny to large. `ms-marco-TinyBERT-L-2-v2` is the default at roughly 4MB. `ms-marco-MiniLM-L-12-v2` at about 34MB is labelled the best cross-encoder reranker. `rank-T5-flan` at about 110MB is described as the best non cross-encoder reranker and is the one recommended for out-of-domain data. `ms-marco-MultiBERT-L-12` at roughly 150MB covers more than 100 languages. Then `ce-esci-MiniLM-L12-v2`, fine-tuned on the Amazon ESCI dataset rather than the MS MARCO queries most models use, `miniReranker_arabic_v1` as the dedicated Arabic option, and `rank_zephyr_7b_v1_full`, a 4-bit quantised GGUF at about 4GB. That last entry is three orders of magnitude larger than the default, which is worth noticing before you read it as an interchangeable option.

max_length is the performance knob, and the examples disagree

The tuning guidance is specific: set `max_length` large enough for your longest passage plus query, with room for the reserved `[CLS]` and `[SEP]` tokens, and use a tokenizer like OpenAI's tiktoken to estimate if per-token cost matters. The worked example is a 100 token passage plus a 16 token query giving 116, so `max_length = 128` is enough, and passing 512 for short passages is said to hurt response time. Yet the pairwise models are described as having a max of 512 tokens, and the first code sample on the page is `Ranker(max_length=128)`. So the guidance is that the ceiling exists and using it costs you, in a library whose stated purpose is speed. This is the single setting most worth getting right, and it is worth getting wrong deliberately if you are profiling.

Listwise rerankers cost you a pinned llama-cpp build

Installation splits in two. The default path for lightweight pairwise rerankers is:

python
pip install flashrank

The LLM based listwise ones need the extra:

python
pip install flashrank[listwise]

That extra resolves to a single entry, `llama-cpp-python==0.2.76`, pinned to an exact version rather than a range. The pin explains the 8192 token ceiling listed for listwise models and the presence of a 4GB GGUF in the table, since a local quantised model has to be loaded and run somewhere. The practical consequence is that adding listwise support to an environment drags in a pinned native build dependency, and that pin will not move on its own. If you are managing a fleet of environments, the pairwise path is the one that stays cheap.

The ranking call takes one dict per passage and an id you choose

The API surface is small. `Ranker` takes a `max_length` and optionally a `model_name` and a `cache_dir`, and `RerankRequest` carries the query and the passages. Each passage is a dict with `id` and `text`, and an optional `meta` field the README marks as optional, with the note that the id can be your database identifiers from the retrieval stage or plain numeric indices. That means reranking is a pure reordering of ids you already hold, which is the property that makes it droppable into an existing pipeline without touching your storage layer. The output mirrors the input shape, with ids in ranked order. Nothing in the visible code samples shows batch size, concurrency or error handling.

A whole model list sits commented out in the features section

The Features section contains a second copy of the model list wrapped in an HTML comment, with the names, model card links and notes. The same list then appears as the visible table below it. The commented copy carries one detail the table does not: a note that the `rank_zephyr` integration supports a maximum of 20 passages in one pass and that sliding window logic is yet to be added. That is a real functional limit rather than a documentation nicety, because a reranker that only sees 20 candidates silently ignores the rest. Whether that constraint applies to the current code is not something the page settles, so treat 20 as the ceiling until you have checked the behaviour of the version you install.

Benchmarking is marked TBD, and speed is argued structurally

The performance section has an empty benchmark image where a chart should be, and the line under it reads that detailed benchmarking is TBD. What is offered instead is an argument rather than a measurement: rerank speed is a function of the number of tokens in the passages, the query, and the depth of the model in layers, and sleeker models are preferred because reranking is the final leg of a larger retrieval pipeline where any extra overhead shows up in user-facing scenarios. That is a coherent argument for small models and it is not a benchmark. If you are choosing between this and a heavier reranker, the useful comparison is token count and latency on your own passages, not this page.

Release 0.2.9 is from November 2024, commits are from July 2026

The version numbers and the dates do not line up. The setup declaration reads 0.2.9, and the newest GitHub release is 0.2.9 published 2024-11-29 with the release note as minor fixes. Before it, 0.2.4 in April 2024 introduced LLM based listwise rerankers and 0.1.64 in December 2023 added Rank T5 support, a versioning scheme that has clearly shifted since then. The last push to the repository is 2026-07-11, roughly eight months after that release, so work has continued on a branch without producing a tagged version. The repository is not archived. What that combination means practically is that `pip install flashrank` and the main branch are two different things, and the tag tells you nothing about which fixes you have.

Editorial conclusion

FlashRank is for the case where you already have a retrieval stage producing candidates and cannot justify a GPU or a multi-gigabyte model to sort them. Its reason to exist is that reranking is the last leg of a pipeline, so the overhead lands on the user-facing path, and a 4MB ONNX model that runs on CPU addresses exactly that. Two things to check before adopting it. The release train and the commit history disagree: the newest tag is 0.2.9 from 2024-11-29 and described as minor fixes, while the last push was 2026-07-11, so pin a commit rather than assume a tag tells you the current state. And the `listwise` extra pulls `llama-cpp-python==0.2.76` at an exact pin, which is the price of the LLM-based rerankers and a likely upgrade blocker. The pairwise path needs no such extra.

Frequently asked questions

What is FlashRank used for?

It is a Python library for re-ranking the results of an existing search or retrieval pipeline, using cross-encoders or LLM based listwise rerankers, before those results are fed into an LLM. It is a final ordering step, not a retrieval step.

Does FlashRank need PyTorch or a GPU?

No. The README states it needs neither Torch nor Transformers and runs on CPU, and the install declaration lists only tokenizers, onnxruntime, numpy, requests and tqdm. The default model is about 4MB.

Which FlashRank models are available?

Seven are listed: ms-marco-TinyBERT-L-2-v2 as the default at about 4MB, ms-marco-MiniLM-L-12-v2 at about 34MB, rank-T5-flan at about 110MB, ms-marco-MultiBERT-L-12 at about 150MB covering 100+ languages, ce-esci-MiniLM-L12-v2 fine-tuned on Amazon ESCI, rank_zephyr_7b_v1_full as a 4-bit GGUF at about 4GB, and miniReranker_arabic_v1 for Arabic. InRanker is named as a model in the roadmap.

How do I install the listwise rerankers in FlashRank?

Install with the extra, `pip install flashrank[listwise]`, rather than the plain package. That extra adds `llama-cpp-python==0.2.76`, an exact pin rather than a version range, which is what backs the LLM based listwise models.

Why should reranking happen in a RAG pipeline?

The project does not frame it as a RAG question specifically. Its stated reasoning is that reranking is the final leg of a larger retrieval pipeline, so extra overhead there shows up in user-facing scenarios, which is why models with a small footprint and no specialised hardware are chosen over larger ones.

What is the latest FlashRank release?

Version 0.2.9, published 2024-11-29 with the note minor fixes, and it matches the version in the package declaration. The last push to the repository is dated 2026-07-11, and the repository is not archived, so commits exist beyond that tag.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. PrithivirajDamodaran/FlashRank on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/prithivirajdamodaran-flashrank.svg)](https://hysenlabs.com/projects/prithivirajdamodaran-flashrank)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/prithivirajdamodaran-flashrank.svg)](https://hysenlabs.com/projects/prithivirajdamodaran-flashrank)

Was this useful?