Datasets:
feat: add model metadata sidecar + merge for leaderboard
Browse files- scripts/generate_leaderboard.py +27 -0
- scripts/model_metadata.yaml +46 -0
- tests/test_leaderboard_html.py +21 -0
scripts/generate_leaderboard.py
CHANGED
|
@@ -15,6 +15,9 @@ import os
|
|
| 15 |
import re
|
| 16 |
import sys
|
| 17 |
from collections import defaultdict
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
# Known exam names that may contain underscores
|
|
@@ -90,6 +93,30 @@ def load_summary_jsonl(filepath: str) -> list[dict]:
|
|
| 90 |
return records
|
| 91 |
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
def extract_max_score_from_md(filepath: str) -> int | None:
|
| 94 |
"""Extract max possible score from summary.md's Overall Score line.
|
| 95 |
|
|
|
|
| 15 |
import re
|
| 16 |
import sys
|
| 17 |
from collections import defaultdict
|
| 18 |
+
from datetime import date
|
| 19 |
+
|
| 20 |
+
import yaml
|
| 21 |
|
| 22 |
|
| 23 |
# Known exam names that may contain underscores
|
|
|
|
| 93 |
return records
|
| 94 |
|
| 95 |
|
| 96 |
+
def load_model_metadata(path: str) -> dict:
|
| 97 |
+
"""Load the model metadata sidecar (model id -> dict). Returns {} if absent."""
|
| 98 |
+
if not path or not os.path.exists(path):
|
| 99 |
+
return {}
|
| 100 |
+
with open(path, "r") as f:
|
| 101 |
+
return yaml.safe_load(f) or {}
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def merge_metadata(entries: list[dict], metadata: dict) -> list[str]:
|
| 105 |
+
"""Attach metadata to each entry under 'meta'. Return model ids lacking metadata."""
|
| 106 |
+
missing: list[str] = []
|
| 107 |
+
seen: set[str] = set()
|
| 108 |
+
for e in entries:
|
| 109 |
+
meta = metadata.get(e["model"])
|
| 110 |
+
if meta is None:
|
| 111 |
+
e["meta"] = {}
|
| 112 |
+
if e["model"] not in seen:
|
| 113 |
+
seen.add(e["model"])
|
| 114 |
+
missing.append(e["model"])
|
| 115 |
+
else:
|
| 116 |
+
e["meta"] = meta
|
| 117 |
+
return missing
|
| 118 |
+
|
| 119 |
+
|
| 120 |
def extract_max_score_from_md(filepath: str) -> int | None:
|
| 121 |
"""Extract max possible score from summary.md's Overall Score line.
|
| 122 |
|
scripts/model_metadata.yaml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Model metadata sidecar for the HTML leaderboard.
|
| 2 |
+
# Keyed by exact OpenRouter model id. All fields optional.
|
| 3 |
+
# open_weight: true|false -> open/closed badge
|
| 4 |
+
# contamination: clean|suspect -> 'suspect' adds a footnote
|
| 5 |
+
# quant: <str> -> footnote noting served precision
|
| 6 |
+
# lab / license / release_date / provider_pinned -> shown inline or in tooltip
|
| 7 |
+
|
| 8 |
+
"google/gemini-3.1-pro-preview":
|
| 9 |
+
lab: Google
|
| 10 |
+
open_weight: false
|
| 11 |
+
release_date: 2026-01
|
| 12 |
+
contamination: clean
|
| 13 |
+
"moonshotai/kimi-k2.6":
|
| 14 |
+
lab: Moonshot
|
| 15 |
+
open_weight: true
|
| 16 |
+
contamination: clean
|
| 17 |
+
"moonshotai/kimi-k2.5":
|
| 18 |
+
lab: Moonshot
|
| 19 |
+
open_weight: true
|
| 20 |
+
"qwen/qwen3.7-plus":
|
| 21 |
+
lab: Alibaba
|
| 22 |
+
open_weight: false
|
| 23 |
+
contamination: suspect # released after exam — not ruled out
|
| 24 |
+
"qwen/qwen3-vl-235b-a22b-thinking":
|
| 25 |
+
lab: Alibaba
|
| 26 |
+
open_weight: true
|
| 27 |
+
license: Apache-2.0
|
| 28 |
+
release_date: 2025-09-22
|
| 29 |
+
provider_pinned: alibaba
|
| 30 |
+
contamination: clean
|
| 31 |
+
"z-ai/glm-4.6v":
|
| 32 |
+
lab: Z.ai
|
| 33 |
+
open_weight: true
|
| 34 |
+
release_date: 2025-12
|
| 35 |
+
provider_pinned: z-ai
|
| 36 |
+
quant: fp8 # official Z.AI endpoint is fp8
|
| 37 |
+
contamination: clean
|
| 38 |
+
"minimax/minimax-m3":
|
| 39 |
+
lab: MiniMax
|
| 40 |
+
open_weight: true
|
| 41 |
+
"google/gemma-4-31b-it":
|
| 42 |
+
lab: Google
|
| 43 |
+
open_weight: true
|
| 44 |
+
"xiaomi/mimo-v2.5":
|
| 45 |
+
lab: Xiaomi
|
| 46 |
+
open_weight: true
|
tests/test_leaderboard_html.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
import sys
|
| 4 |
+
|
| 5 |
+
import pytest
|
| 6 |
+
|
| 7 |
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "scripts"))
|
| 8 |
+
import generate_leaderboard as gl # noqa: E402
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def test_merge_metadata_attaches_and_reports_missing():
|
| 12 |
+
entries = [{"model": "a/b"}, {"model": "c/d"}]
|
| 13 |
+
metadata = {"a/b": {"lab": "X", "open_weight": True}}
|
| 14 |
+
missing = gl.merge_metadata(entries, metadata)
|
| 15 |
+
assert entries[0]["meta"] == {"lab": "X", "open_weight": True}
|
| 16 |
+
assert entries[1]["meta"] == {}
|
| 17 |
+
assert missing == ["c/d"]
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def test_load_model_metadata_absent_returns_empty():
|
| 21 |
+
assert gl.load_model_metadata("does/not/exist.yaml") == {}
|