pairsort

Sort anything with Jev.

Jev judges “which of these two is better?” for a fraction of a cent. pairsort turns its answers into one ranking with honest probabilities.

# pip install pairsort
import pairsort

ideas = ["A CSV-to-chart CLI",
         "A blockchain to-do app",
         "A PR-urgency ranker",
         "A local-first notes app",
         "A tweeting fridge magnet"]
r = pairsort.sort(ideas,
      "Which is most useful?")
r.best     # 'A local-first notes app'
r.scores   # P(best) for each idea

Jev is the default judge: set OPENROUTER_API_KEY. Ranking six ideas took 30 Jev judgments, 0.52 s and $0.0001 (watch it). Several questions? ↓

Several questions, one ranking

Name each question. pairsort ranks by each one separately, then blends them into one answer.

r = pairsort.sort(ideas,
      useful="Which is more useful?",
      easy="Which is easier to build?")
r.best     # 'A CSV-to-chart CLI'
print(r)   # this table:
#ideausefuleasyP(best)
1A CSV-to-chart CLI#2#154%
2A local-first notes app#1#420%
3A PR-urgency ranker#3#319%
4A tweeting fridge magnet#5#25%
5A blockchain to-do app#4#52%
Asked only “most useful?”, the notes app wins. It's also hard to build, so the blend picks the CSV CLI: #2 on useful, #1 on easy. To make one question count double, write useful:2="…" in the CLI or useful=("…", 2) in Python. Real Jev run: 40 judgments, $0.00013.

Watch Jev sort

A recorded run: six side-project ideas, every pair asked in both orders.

0 / 30 judgments cost $0.000000
Starting…

    Live ranking = Bradley–Terry on the pairs so far. Recorded 2026-09-23 against typesafe/jev-1.13 on OpenRouter; the numbers are the real ones.

    Jev: cheap and good

    The same pairs, scored against ground truth, with Jev and three general LLM judges. Jev was the cheapest judge in every eval, by 1.5–20×, and landed within 2.3 points of the best judge every time.

    eval (ground truth)Jevbest other judgeJev costothers
    Same answer in 4 languages96%94% Gemma 4 31B5.2¢15–21¢
    Next-day stock returns, Monτ +0.14+0.08 Gemma 4 31B7.3¢11–17¢
    Exact error counts96.4%97.2% Gemma 4 31B2.2¢6.8–9.7¢
    Which code runs faster97.3%97.9% DeepSeek V4.1 Flash1.2¢3.2–6.7¢
    Damage ladder94.4%96.7% Gemma 4 31B1.6¢6.3–32¢
    Next-day stock returns, Tueτ +0.06+0.08 Gemma 4 31B

    Percentages are pairs ordered correctly (cross-lingual: identical answer in EN/ES/DE/JA). Market rows are Kendall τ against realized returns; neither day is strong evidence yet. Costs are what each judge actually billed for its whole eval (Tuesday re-used cached answers, so its cost is not comparable). On the 100-model Summary Showdown, Jev's 4,800 judgments cost 11¢; the other judges cost $0.37–$1.55 for the same pairs.

    100 AI models, one paper, one jury

    Jev and three other judges ranked 100 popular models' summaries from 8% of the possible pairs.

    Loading the leaderboard…

    Judge the summaries yourself → Results & method

    How it works

    One hard question (“rank these 100 things”) becomes many easy ones (“which of these two?”), put back together with the pairwise-coupling rule of Price, Knerr, Personnaz & Dreyfus (NeurIPS 1994).

    1. 1
      Pick informative pairs

      An active schedule asks about the pairs the ranking is least sure of, and stops when it settles. No all-vs-all.

    2. 2
      Ask both orders

      A-first and B-first are averaged: Pij = (q(i,j) + 1 − q(j,i)) / 2 which cancels position bias exactly.

    3. 3
      Couple into one ranking

      PKPD Eq. 7 turns pairwise probabilities into a probability per item, even when the judge contradicts itself. Bradley–Terry takes over for large or sparse sets.

      Pi = 1 / ( Σj≠i 1/Pij − (K − 2) )

    4. 4
      Blend questions, abstain when unsure

      Each question is coupled separately, then fused. When the top two are too close to call, pairsort says so.

    Worked example: a judge that goes in circles

    The judge says A beats B (70%), B beats C (65%) and C beats A (55%). Everyone beats D. Counting wins gives a three-way tie; coupling uses how sure each answer was.

    ABCD
    A·.70.45.85
    B.30·.65.80
    C.55.35·.75
    D.15.20.25·
    A
    38%
    C
    27%
    B
    26%
    D
    8%

    P(best) from PKPD Eq. 7. A wins its fights by wider margins; B and C are too close to separate.

    The full pipeline Other judges: any OpenRouter LLM, open Jev models, your own function

    Go deeper

    What's next

    Ideas and PRs welcome on GitHub.