Skip to content

Python quickstart

At the end of this page you will have ranked a file of model outputs from Python and read the result. It takes about five minutes and is free with the mock judge.

Install the package, sign up at app.supposing.app, create an API key under Developers, and put it in SUPPOSING_API_KEY:

Terminal window
pip install supposing
export SUPPOSING_API_KEY=sp_your_key

The example ranks outputs.jsonl, one model output per line. No file at hand? This makes a small one:

Terminal window
cat > outputs.jsonl <<'JSONL'
{"id": "gpt-a", "output": "The Moon pulls on the sea, so the water bulges toward it. As Earth spins, your beach moves in and out of that bulge."}
{"id": "gpt-b", "output": "Tides are caused by gravitational interactions between the Earth, Moon and Sun."}
{"id": "claude-a", "output": "Imagine the Moon gently tugging the ocean like a blanket. Where it tugs, the water piles up."}
{"id": "claude-b", "output": "Water goes up and down because of the Moon."}
JSONL

Then run this:

from supposing.cloud import Client
RUBRIC = "Which explanation of tides would a 10-year-old understand best?"
with Client() as sp:
dataset = sp.datasets.push("outputs.jsonl", text_fields=["output"], id_field="id")
print(sp.runs.estimate(dataset.id, RUBRIC, provider="mock").describe())
run = sp.runs.create(dataset.id, RUBRIC, provider="mock")
run = sp.runs.wait(run.id)
results = sp.runs.results(run.id)
print(results.summary)
for row in results.leaderboard:
print(row.rank, "could be %d-%d" % (row.rank_lo, row.rank_hi), row.title)

It prints the estimate, then the verdict, then one line per item. With the mock judge the order means nothing, but the shape is the same:

4 items, 32 judge calls, free, about 1 second
claude-b ranks first, but any of the top 2 could be first. 3 clear tiers. Treat with care: the judge often changed its mind when the two texts swapped places (same winner in both orders 69%; 1 more check is poor). Read some comparisons before relying on this ranking.
1 could be 1-2 claude-b
2 could be 1-2 claude-a
3 could be 3-3 gpt-a
4 could be 4-4 gpt-b

could be 1-2 is the range of places the item holds with 90% confidence. The “Treat with care” sentence is a judge check failing, which the fake judge often does. Reading the result explains the rest.

  • datasets.push uploaded each row as one item, titled by its id. text_fields names the field(s) with the text; a folder of documents works too, one item per file.
  • runs.estimate priced the run without starting it. With a real judge, check est_cost_usd before you call runs.create.
  • runs.wait followed the run’s live event stream until it finished.

For a real judge, drop provider="mock". AsyncClient has the same methods as coroutines. See the Python client reference.