rtr-bench 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +15 -4
  2. package/dist/cli.js +24 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -43,21 +43,32 @@ echo 'OPENROUTER_API_KEY=sk-or-your-key' > .env
43
43
  node src/cli.ts catalog --limit 20
44
44
 
45
45
  # run a model, then score everything on disk
46
- node src/cli.ts run --models <model-id> --concurrency 8
46
+ node src/cli.ts run --models z-ai/glm-5.3-flash --concurrency 8
47
47
  node src/cli.ts report
48
48
  ```
49
49
 
50
- Once the package is published, the same run is one command with no clone:
50
+ Published on npm, the same run is one command with no clone:
51
51
 
52
52
  ```bash
53
- npx rtr-bench <model-id>
53
+ npx rtr-bench z-ai/glm-5.3-flash
54
54
  ```
55
55
 
56
56
  Rebuilding the dataset needs the project's database connection, so `npm run export` is included for inspection only.
57
57
 
58
58
  ## Results
59
59
 
60
- <!-- populated after the multi-model run. results/leaderboard.md is generated by `rtr-bench report`. -->
60
+ | Model | Provider | Score | Cost |
61
+ |---|---|---|---|
62
+ | z-ai/glm-5.3-flash | TBD | TBD | TBD |
63
+ | z-ai/glm-5.3 | TBD | TBD | TBD |
64
+ | minimax/minimax-m3.1-flash | TBD | TBD | TBD |
65
+ | deepseek/deepseek-v4.1-flash-1017 | TBD | TBD | TBD |
66
+ | tencent/hy4 | TBD | TBD | TBD |
67
+ | google/gemini-3.8-flash | TBD | TBD | TBD |
68
+ | google/gemini-4-carbon | TBD | TBD | TBD |
69
+ | moonshotai/kimi-k3.1-pro | TBD | TBD | TBD |
70
+ | x-ai/grok-4.7 | TBD | TBD | TBD |
71
+ | qwen/qwen3.8-max-0902 | TBD | TBD | TBD |
61
72
 
62
73
  ## License
63
74
 
package/dist/cli.js CHANGED
@@ -119,7 +119,8 @@ function readModel(dir) {
119
119
  day: rec.day,
120
120
  order: rec.order,
121
121
  task,
122
- parsed: rec.parsed ?? null
122
+ parsed: rec.parsed ?? null,
123
+ cost: rec.usage?.cost ?? rec.usage?.total_cost ?? 0
123
124
  });
124
125
  }
125
126
  }
@@ -245,7 +246,8 @@ function scoreModel(model, windows) {
245
246
  crowdDistance: mean(dists),
246
247
  gap: readAgree - predictAcc,
247
248
  instability: pred.length ? pred.filter((a) => a.unstable).length / pred.length : NaN,
248
- parseFailures: calls.filter((c) => !c.parsed).length
249
+ parseFailures: calls.filter((c) => !c.parsed).length,
250
+ costUsd: calls.reduce((a, c) => a + c.cost, 0)
249
251
  };
250
252
  }
251
253
  function majorityBaseline(windows) {
@@ -531,12 +533,12 @@ function writeReport() {
531
533
  lines.push("## Leaderboard");
532
534
  lines.push("");
533
535
  lines.push(
534
- "| model | score /100 | n | 95% CI | axis x | axis y | Brier | own reading agrees | crowd distance | gap | unstable |"
536
+ "| model | score /100 | n | cost | 95% CI | axis x | axis y | Brier | own reading agrees | crowd distance | gap | unstable |"
535
537
  );
536
- lines.push("|---|---|---|---|---|---|---|---|---|---|---|");
538
+ lines.push("|---|---|---|---|---|---|---|---|---|---|---|---|");
537
539
  for (const s of ranked) {
538
540
  lines.push(
539
- `| \`${s.model}\` | **${(100 * s.predict.acc).toFixed(1)}** | ${s.windows} | ${ci(s.predict.ci)} | ${pct(s.axes.x)} | ${pct(s.axes.y)} | ${round(s.brier)} | ${pct(s.read.agree)} | ${round(s.crowdDistance)} | ${s.gap >= 0 ? "+" : ""}${pct(s.gap)} | ${pct(s.instability)} |`
541
+ `| \`${s.model}\` | **${(100 * s.predict.acc).toFixed(1)}** | ${s.windows} | $${s.costUsd.toFixed(4)} | ${ci(s.predict.ci)} | ${pct(s.axes.x)} | ${pct(s.axes.y)} | ${round(s.brier)} | ${pct(s.read.agree)} | ${round(s.crowdDistance)} | ${s.gap >= 0 ? "+" : ""}${pct(s.gap)} | ${pct(s.instability)} |`
540
542
  );
541
543
  }
542
544
  lines.push("");
@@ -609,6 +611,16 @@ function writeReport() {
609
611
  console.log("wrote results/leaderboard.md and results/leaderboard.svg");
610
612
  return data;
611
613
  }
614
+ function scoreLine(s) {
615
+ const [lo, hi] = s.predict.ci;
616
+ return [
617
+ s.model,
618
+ `${(100 * s.predict.acc).toFixed(1)} / 100`,
619
+ `${s.windows} windows`,
620
+ `95% CI ${(100 * lo).toFixed(1)} to ${(100 * hi).toFixed(1)}`,
621
+ `cost $${s.costUsd.toFixed(4)}`
622
+ ].join(" ");
623
+ }
612
624
  function svg(scores, baselines, windowCount) {
613
625
  const rowH = 38;
614
626
  const top = 84;
@@ -710,6 +722,10 @@ if (cmd === "catalog") {
710
722
  for (const model of models) {
711
723
  await runModel(windows, { model, tasks: [...tasks], concurrency, limit });
712
724
  }
725
+ const data = writeReport();
726
+ for (const s of data.scores) {
727
+ if (models.includes(s.model)) console.log(scoreLine(s));
728
+ }
713
729
  } else if (cmd === "score" || cmd === "report" || cmd === "all") {
714
730
  const data = writeReport();
715
731
  console.log(
@@ -730,7 +746,9 @@ if (cmd === "catalog") {
730
746
  concurrency: Number(flags.concurrency ?? 6),
731
747
  limit: flags.limit ? Number(flags.limit) : void 0
732
748
  });
733
- writeReport();
749
+ const data = writeReport();
750
+ const s = data.scores.find((x) => x.model === cmd);
751
+ if (s) console.log(scoreLine(s));
734
752
  } else {
735
753
  const here = path4.dirname(fileURLToPath2(import.meta.url));
736
754
  console.log(fs5.readFileSync(path4.join(here, "..", "README.md"), "utf8").slice(0, 1200));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rtr-bench",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Can a language model predict how a crowd reads a word? A cultural fluency benchmark built from Mixed Messages.",
5
5
  "type": "module",
6
6
  "license": "MIT",