🚀 BGE Reranker: community package now available
-
BGE Reranker: community package now availableOne-Stop Retrieval Toolkit For Search and RAG
TL;DR: A reranker scores how well each candidate passage answers a query, so you can reorder a
shortlist by true relevance and keep the best few. This package servesBAAI/bge-reranker-v2-m3(a
multilingual cross-encoder) on Hugging Face Text Embeddings Inference, with the model baked into the
image, as a privatePOST /rerankAPI. It is the reranking tier of a self-hosted retrieve-then-rerank
stack and the cheapest large quality win you can add to RAG or search. Now packaged for Cloudron and
ready to install. Built and tested on Cloudron 9.x; unofficial and community-maintained.Links
Model card: https://huggingface.co/BAAI/bge-reranker-v2-m3
Upstream model project: https://github.com/FlagOpen/FlagEmbedding- 🧱 Upstream server: https://github.com/huggingface/text-embeddings-inference (TEI)
- 🧰 Cloudron package repo: https://github.com/OrcVole/bge-reranker-cloudron
No public demo to click, this is an API you self-host. Once installed, opening the app's domain shows a
small landing page explaining what it is and how to call it, and the interactive OpenAPI docs are at
/docsbehind your Cloudron login.
How to installInstallation
- Click on the Add custom app drop down top right in the App Store and choose Community app:
- Then paste in the CloudronVersions.json URL into the box that pops up:

Community packages are not in the App Store, so install via the CLI. The published image is on GHCR and
the package ships a community versions file:# recommended: install the published community build from the versions URL cloudron install \ --versions-url https://raw.githubusercontent.com/OrcVole/bge-reranker-cloudron/main/CloudronVersions.json \ --location reranker.example.com # or pin the prebuilt image directly cloudron install --image ghcr.io/orcvole/bge-reranker-cloudron:1.0.0 --location reranker.example.com # or build it yourself from the repo git clone https://github.com/OrcVole/bge-reranker-cloudron cd bge-reranker-cloudron cloudron build cloudron install --image [your-registry]/bge-reranker-cloudron:latest --location reranker.example.comMinimums: 6 GB RAM (the model warmup peaks higher than its idle footprint; lower
RERANKER_MAX_BATCH_TOKENS
if you want it leaner), amd64 (the TEI CPU build bundles Intel MKL), addonslocalstorageandproxyAuth.First run: the API key is generated for you. Read it from the app's Terminal with
cat /app/data/.secrets/keys.envand send it asAuthorization: Bearer <key>onPOST /rerank. The
/docsSwagger UI sits behind your Cloudron login;/healthand the landing page at/are open. The
model is baked into the image, so there is no first-boot download: the app reports healthy in seconds and
serves its first rerank after a brief warmup (well under a minute).
For usersWhy try it: retrieval gets you a rough shortlist; a cross-encoder reranker reads the query and each
candidate passage together and scores how well they actually match, which is far more accurate than
first-stage similarity. Retrieve 50 candidates, rerank, keep the best 5 before you send them to the LLM.
It is the highest-leverage, lowest-effort accuracy improvement you can add to a private retrieval stack,
and your documents never leave your box.What you get out of the box:
- A reranking API (
POST /rerankwith a query and a list of texts, returns a relevance score for
each, sorted best first), CPU-only, multilingual, model baked in. - A small public landing page at
/that says what the API is and how to call it, plus interactive
OpenAPI docs at/docs(behind your Cloudron login). - Cloudron-specific wins: the API key is generated on first run,
/healthis open for monitoring,
/docssits behind Cloudron SSO, all state lives under/app/dataso backups cover the key, and
updates are one click. The key is stable across update and restore (verified).
Good fit if you want a self-hosted reranking tier for RAG and semantic search (pairs directly with the
TEI and Qdrant community packages). Probably not for you if you need GPU acceleration (this build is
CPU-only) or arm64 (the TEI CPU image is amd64-only).
🧰 For packagers: what we learned
What helped
- Baking the model with
curlfrom the pinnedresolve/<commit>URL plus asha256sum -cgate,
rather than a pip/Python download. No download cache baked into a layer: the ~5.2 GB image is all real
weight (base + the TEI binary and MKL runtime + the 2.2 GB model). Ordering the modelRUNbefore the
entrypoint copy means editing the entrypoint rebuilds in seconds without re-downloading the model. - Reusing the sibling TEI embeddings package wholesale: the Intel MKL /
libiomp5dlopen handling, the
CPU-versus-CUDA tag trap (cpu-1.9, not the bare CUDA tag), the two-surface auth split, and the port
move were already solved. The new ground was just baking the model and the memory behaviour. - Putting all state under
/app/dataso thelocalstoragebackup just works; a real update and a real
backup-then-restore both brought the key back byte-identical, with mode re-asserted to0600.
What was tricky and how we solved it
- A long model warmup makes a server restart-loop on Cloudron. TEI does not bind its HTTP port until
warmup finishes (tens of seconds on CPU), so/healthis refused during warmup and the platform kills
and restarts the container before it is ready. Local podman never caught it, because it does not
health-check during warmup; only the box did. The fix is the field guide's nginx immediate-health shim:
nginx answers/health200 from the first second and proxies everything else to TEI internally, with
TEI still the main process so a real crash still restarts. The runtime smoke now asserts/healthis
answered during warmup, so the regression cannot return silently. - nginx died on the box with
error_log /dev/stderr(EACCES, because the fd-2 target is root-owned
and the app runs unprivileged) and silently never bound its port. Use theerror_log stderrkeyword
(writes the inherited fd, noopen()). Also podman-invisible. - TEI's default
max_batch_tokensOOM-kills warmup for this 8192-token-context model (quadratic
attention scratch). Set a frugal default (4096) and cap the thread count, and bound
OMP_NUM_THREADS/MKL_NUM_THREADS, not just the framework's own thread var, or memory balloons on a
host with no per-app CPU limit.
Still rough and open questions
- Under box CPU contention the warmup stretches to ~90s. It is invisible to users (the shim keeps the app
healthy), but a faster or memory-aware warmup upstream would be welcome. - Whether 6 GiB can be trimmed with a lower default batch budget without hurting throughput for the common
reranking case.
️ For the Cloudron teamMaintenance burden: the package is a thin layer (a pinned
TEI_VERSIONbuild-arg, a pinned model
revision, and the manifest), so a rebump is a version bump and a re-run of the/reranksmoke. TEI has a
steady release cadence.Why it would suit the App Store: Apache-2.0 upstream (both the model and the server), real demand
(reranking is the missing accuracy tier for self-hosted RAG), and it completes the existing TEI and Qdrant
community stack.Friction worth knowing about: the
iconUrlfield couples to theminBoxVersion 9.1.0floor on the
versions-url channel (shared with TEI, Qdrant, Docling). And one worth a platform note: a backend that
binds its port only after a long startup warmup will restart-loop, because the health check is refused
during warmup; an immediate-health proxy works, but a documented startup grace would be friendlier.
For TEI's and the model's developersA few low-effort things that help packagers a lot:
- Bind the listener (and answer
/health) before warmup, or document that it comes up after. A
platform that health-checks during startup restart-loops the container otherwise, and the failure is a
silent refused connection. - A memory-aware default
max_batch_tokens. The current default allocates gigabytes of attention
scratch during warmup for a long-context model on CPU and OOM-kills first boot with no clear error. - Lower the log level of the ORT-backend fallback. TEI logs
ERROR ... onnx/model.onnx does not exist
before falling back to Candle for a safetensors-only model; it reads like a failure but is the normal
path. (A shippedonnx/export from BAAI would also let the faster ORT backend run.) - Inherited asks:
--hostnamedefaulting toHOSTNAMEis container-hostile, and an arm64 CPU image would
broaden where this runs.
Package source and PRs welcome here: https://github.com/OrcVole/bge-reranker-cloudron. Happy to co-maintain.
UnlocksOnce it is running, you can:
- Sharpen any RAG or search result: retrieve a shortlist, rerank, keep the best few before the LLM sees them.
- Rerank multilingually, with nothing leaving your server.
- Drop the closed Cohere or Voyage rerank APIs for an Apache-2.0 model on your own box.
SynergiesPairs nicely with other Cloudron apps:
- Reranker + TEI + Qdrant: embed with TEI, store and search in Qdrant, then rerank the shortlist here.
- Reranker + Ollama or Open WebUI: answer over the reranked context.
- Reranker + n8n or Windmill: an HTTP node or script calls
POST /rerankwith the Bearer key (both
verified end to end from their containers). - Reranker + Dify: add it as a Text Embeddings Inference rerank model in Dify's model providers.
Feedback, bug reports, and "works on my install" confirmations all welcome below.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login