Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ratel-ai-rankers-plugin

Decision-model rankers as retrieve/rerank plugins for ratel-ai, the Ratel Python SDK.

The SDK ranks through functions you give it (retrieve_fn, reranker_fn; ADR 0027) and knows no vendor's API. This package holds the vendor clients, so the SDK stays vendor-free and a new vendor ships without an SDK release (ADR 0028).

pip install ratel-ai ratel-ai-rankers-plugin

Plugins

Each returns a RetrieverPlugin with .retrieve (for retrieve_fn, method="custom") and .rerank (for reranker_fn). Every failure raises the SDK's RetrieverError. When a reranker fails with transient=True, the search keeps the first stage's order.

from ratel_ai import ToolCatalog
from ratel_ai_rankers_plugin import ratel_jev_plugin, ratel_openai_decision_plugin

jev = ratel_jev_plugin()  # key in TYPESAFE_API_KEY
ToolCatalog(method="custom", retrieve_fn=jev.retrieve)   # Jev ranks every tool
ToolCatalog(method="bm25", reranker_fn=jev.rerank)       # Jev reranks BM25's top 50

decision = ratel_openai_decision_plugin()  # key in OPENAI_API_KEY; public beta
ToolCatalog(method="bm25", reranker_fn=decision.rerank, reranker_depth=20)
  • ratel_jev_plugin(url=None, api_key_env=None, model=None): Jev (TypeSafe AI). Defaults: https://api.typesafe.ai, TYPESAFE_API_KEY, jev-latest.
  • ratel_openai_decision_plugin(url=None, api_key_env=None, model=None): OpenAI's Decisions API (public beta). Defaults: https://api.openai.com, OPENAI_API_KEY, gpt-6-luna. The first plugin made emits a one-time ExperimentalWarning; set RATEL_EXPERIMENTAL_SILENCE=1 to silence it. A model refusal is code="Refused", which is transient.

Both plugins send the query and each candidate's searchable text to the vendor. Above 150 candidates they rank groups in parallel and put the group winners into one final question. Picks below probability 0.01 are dropped, except the best one.

Writing your own plugin

The plugin contract belongs to the SDK. This package re-exports it so a plugin can import everything from one place:

from ratel_ai_rankers_plugin import RankCandidate, RankedId, define_plugin

async def rank(query: str, candidates: list[RankCandidate], top_k: int) -> list[RankedId]:
    ...

my_plugin = define_plugin(retrieve=rank, rerank=rank)

choice_ranker_plugin(ranker) turns any object with a rank(query, [(id, text)], top_k, kind) method into a plugin.

Layout

native/                    pyo3 binding to the ratel-ai-rankers crate (../core)
ratel_ai_rankers_plugin/   the plugins, the shared adapter, type stubs
tests/                     plugin tests against local vendor stand-ins

Build & test

From this directory, with uv:

uv venv --python 3.11 .venv
uv pip install --python .venv maturin pytest pytest-asyncio ruff mypy -e ../../telemetry/python
unset CONDA_PREFIX
# The in-repo SDK, then this package; --no-deps because the SDK's version is only
# bumped at release, so the pin on the next SDK may not be met yet.
uv pip install --python .venv -e ../../sdk/python
uv pip install --python .venv --no-deps -e .
.venv/bin/ruff check . && .venv/bin/mypy ratel_ai_rankers_plugin && .venv/bin/pytest

Released as the rankers-py-v* unit (ADR-0008).

Metadata

Release files for ratel-ai-rankers-plugin 0.1.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ratel-ai-rankers-plugin 0.1.0rc1
File Size Uploaded Provenance
ratel_ai_rankers_plugin-0.1.0rc1.tar.gz 48.8 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for ratel-ai-rankers-plugin 0.1.0rc1
File
ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.2 MB

Release files / ratel_ai_rankers_plugin-0.1.0rc1.tar.gz

Download URL ratel_ai_rankers_plugin-0.1.0rc1.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a22f55b74c73cb98b3ff9f4e324f7c987697adfed08bc30fa9f0111a37c135ad
BLAKE2b-256 checksum
How to use checksums
098407eb7626392ac03117707be60aef01b6cc32061edbc46d86453e7e7e134b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-win_amd64.whl

Download URL ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
796f339cdd94929bb9d4d5ee640133aa9b45606f507caac1be992a9b16003c44
BLAKE2b-256 checksum
How to use checksums
e7c42aaa00860fc5403f348b4ff4376e86e8d4e2afa10ea43d84846c3ac7568a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f43e5f182772adc8c86adc4150ebbfc797fd09965ec983cb506cad0b82268be3
BLAKE2b-256 checksum
How to use checksums
07df4b1f71da36c64605dad3c07113fdcdf886c9714c9b44467d66f43e934529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
60ddfa3d2c4128308b27cdf0876d04b5731e1ffad6a8ca3f40bb58ed33236dbc
BLAKE2b-256 checksum
How to use checksums
7ae3553af76092879cb312e4810d28962c777173e04d06dd284c37dc31e41870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl

Download URL ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e3b10cf0920d4a11f78f1a485bdd1076114456136fea8fde7c40ac40953936a0
BLAKE2b-256 checksum
How to use checksums
1edec6eb17203a8ab65ae5a7f74bdfdc4843a94f6a978c0a63fd2abcf01f33fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL ratel_ai_rankers_plugin-0.1.0rc1-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
aea632c63deb128c40d630c30cddc55792b8b6574f9b7e5a21b52d9cd3918484
BLAKE2b-256 checksum
How to use checksums
23981fe9e27d279becc45735237256ee7c23f7eb32b13c6010e3989f9fc780b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for ratel-ai-rankers-plugin 0.1.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for ratel_ai_rankers_plugin-0.1.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page