v0.2.0Open source · Apache 2.0 Document ranking
Document ranking
from your terminal.
The best open source library for document ranking, powered by LLMs and statistical methods.
uv add supposingrank rating won-lost itemrange 1 2359 16-0 the-lighthouse-keeper.md 2 1990 13-3 salt.md 3 1921 12-4 the-census.md 4 1746 10-6 the-translator.md 5 1618 8-8 quarterly-review.md 6 1573 7-9 inheritance-of-clocks.md 7 1531 10-6 second-moon.md 8 1323 7-9 my-cat.md 9 1268 6-10 space-battle.md 10 1174 5-11 rain.md 11 892 2-14 sunset.md 12 605 0-16 the-meeting.md
why pairs
Comparing beats scoring.
100 student essays, one LLM judge, one rubric. How often each method agreed with trained human raters, across 3,758 pairs.
Pairwise supposing86%
Scoring each alone67%
Random order50%
from code
Command line, Python or HTTP.
One engine behind all three. Every run prices itself before it spends.
# free first try: the mock judge, no key uvx supposing rank ./stories \ --rubric "Which is the better short story?" \ --judge mock # then a real judge, priced first and capped uvx supposing rank ./stories --rubric brief.md --dry-run uvx supposing rank ./stories --rubric brief.md --max-cost 2
Real output, mock judge
Estimate: 12 items, 48 judge calls with mock, free the-translator.md ranks first, but any of the top 3 could be first. …
# uv add supposing
from pathlib import Path
from supposing import rank
docs = {p.name: p.read_text() for p in Path("stories").glob("*.md")}
ranking = rank(docs, "Which is the better short story?", provider="mock")
print(ranking.summary)
for row in ranking.leaderboard:
print(row["rank"], row["item_id"], row["rank_lo"], row["rank_hi"])Real output, mock judge
the-census.md ranks first, but any of the top 4 could be first. 1 the-census.md 1 4 …
# price it, then run it, with the same body
curl https://api.supposing.app/v1/runs/estimate \
-H "Authorization: Bearer $SUPPOSING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dataset_id": "'$DATASET'",
"judge": "quick",
"ranking": {"rubric": "Which pitch is more fundable?"}}'Response shape, from the docs
GET /v1/runs/{id}/results
{ "summary": "…",
"ranking": { "leaderboard": [
{ "rank", "rank_lo", "rank_hi", "title" } ] } }from your agent
Or hand it to your agent.
Use Supposing to rank the files in <path> by which is strongest against <rubric.md>. Read https://app.supposing.app/llms.txt first. Do a free run with the mock judge, show me the cost before any paid run, and tell me which places are close calls.
Hosted MCP connector
https://api.supposing.app/mcp- Claude Code
claude mcp add --transport http supposing https://api.supposing.app/mcp- Claude and ChatGPT
- Add a custom connector with the URL above, then sign in.
rank_documentscompare_optionsget_runget_results
Connector setup