import {localize, translate} from './i18n.js'; import { GROUPS, METRICS, SHORT_NAMES, isDecisionIndex, statusOf, valueOf, formatValue, resultMap, sortedModels, ranksFor, filterModels, escapeHtml as esc, csvFor } from './ranking.js'; import { chartModels, chartAxis, plotValue, axisLabel, parameterSize } from './chart.js'; function readPreference(key, fallback) {try {return localStorage.getItem(key) || fallback;} catch {return fallback;}} let language = readPreference('jevalkit-language', 'en') === 'zh' ? 'zh' : 'en'; const requestedLanguage = new URLSearchParams(location.search).get('lang'); if (['en','zh'].includes(requestedLanguage)) language = requestedLanguage; let theme = readPreference('jevalkit-theme', 'light') === 'dark' ? 'dark' : 'light'; function applyPreferences() { document.documentElement.lang = language === 'zh' ? 'zh-CN' : 'en'; document.documentElement.dataset.theme = theme; for (const link of document.querySelectorAll('a[href]')) { const url = new URL(link.href); if (url.hostname === 'valen-team.github.io' && /^\/(?:zh-Hans\/)?docs(?:\/|$)/.test(url.pathname)) { url.pathname = (language === 'zh' ? '/zh-Hans' : '') + url.pathname.replace(/^\/zh-Hans/, ''); link.href = url.href; } } document.title = language === 'zh' ? 'JevalKit · 决策模型排行榜' : 'JevalKit — The decision model leaderboard'; document.querySelectorAll('[data-language]').forEach(button => button.setAttribute('aria-pressed', String(button.dataset.language === language))); const toggle = document.querySelector('[data-theme-toggle]'); if (toggle) { const label = language === 'zh' ? (theme === 'dark' ? '切换浅色模式' : '切换深色模式') : (theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'); toggle.setAttribute('aria-label', label); toggle.title = label; toggle.innerHTML = theme === 'dark' ? icon('sun', 16) : icon('moon', 16); } } function translatePage() {localize(document.body, language); applyPreferences();} function preferenceControls() {return `
`;} const icons = { moon: '', sun: '', arrow: '', diagonal: '', download: '', search: '', compare: '', close: '', check: '', shield: '', layers: '', clock: '', info: '', code: '', github: '', }; const icon = (name, size = 16) => ``; const number = value => Number(value || 0).toLocaleString('en-US'); const safeUrl = value => /^https?:\/\//.test(value || '') ? esc(value) : '#'; const external = (url, label, className = 'inline-link') => `${label}`; const prettyDate = value => value ? new Date(value).toLocaleDateString(language === 'zh' ? 'zh-CN' : 'en-GB', { day: '2-digit', month: 'short', year: 'numeric', timeZone: 'UTC' }) : 'Imported snapshot'; const groupNames = { choice: 'Choice', noul: 'Noul', score: 'Score' }; let data, map, benchmarks; let state = { group: 'text', metric: 'accuracy', rankBy: 'JevAltBench', reversed: false, family: 'all', query: '', fullCoverage: false, selected: [] }; let toastTimer; const chartState = { benchmark: 'DecisionIndex', metric: 'public_decision_index', min: 0, max: 30, includeUnknown: true, expanded: false }; let sizeLimit = 30; const sizePresets = [ { label: 'All sizes', min: 0, max: () => sizeLimit, unknown: true }, { label: '≤ 1B', min: 0, max: () => 1 }, { label: '1–4B', min: 1, max: () => 4 }, { label: '4–10B', min: 4, max: () => 10 }, { label: '≥ 10B', min: 10, max: () => sizeLimit }, ]; function activeNames() { return GROUPS[state.group].names; } function tableNames() { const names = activeNames(); return matchMedia('(max-width: 680px)').matches ? [state.rankBy, ...names.filter(name => name !== state.rankBy)] : names; } function visibleModels() { return sortedModels(filterModels(data.models, map, state), map, state.rankBy, state.metric, state.reversed); } function getRow(model, name) { return map.get(`${model}|${name}`); } function benchmark(name) { return benchmarks.get(name); } function currentRanks(name = state.rankBy) { return ranksFor(data.models, map, name, state.metric); } function measuredCount(name) { return data.results.filter(r => r.primary && r.eligible && r.benchmark === name).length; } function toast(message) { const element = document.querySelector('#toast'); element.textContent = translate(message, language); element.classList.add('visible'); clearTimeout(toastTimer); toastTimer = setTimeout(() => element.classList.remove('visible'), 2400); } function download(name, content, type = 'application/json') { const url = URL.createObjectURL(new Blob([content], { type })); const anchor = document.createElement('a'); anchor.href = url; anchor.download = name; document.body.append(anchor); anchor.click(); anchor.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); } function badge(row) { const status = statusOf(row); const label = { measured: 'Full measurement', missing: 'Not measured', unsupported: 'Unsupported', excluded: 'Excluded from ranking' }[status]; return `${label}`; } function scoreCell(model, name, rankMap) { const row = getRow(model.id, name), value = valueOf(row, state.metric); const active = name === state.rankBy ? ' active' : ''; if (value === null) { const status = statusOf(row); const label = status === 'unsupported' ? 'Unsupported' : status === 'excluded' ? 'Excluded' : '—'; const title = status === 'unsupported' ? `${model.id} does not support these inputs; no score is ranked.` : status === 'excluded' ? 'This measurement is ineligible. Inspect the run archive for details.' : `${model.id}: no ${METRICS[state.metric].label} measurement for ${name}.`; return `${label}`; } const best = rankMap.get(model.id) === 1; const partial = row.coverage < 1 - 1e-9; const title = `${name}: ${formatValue(value, state.metric)} · ${formatValue(row.coverage, 'coverage')} valid coverage. Click for measurement details.`; return ``; } function renderRows() { const names = tableNames(), models = visibleModels(), ranks = currentRanks(); const rankMaps = new Map(names.map(name => [name, currentRanks(name)])); const highFirst = METRICS[state.metric].higher !== state.reversed; const header = `Select#MODEL / FAMILY${names.map(name => ``).join('')}VALID
COVERAGE`; const rows = models.map(model => { const row = getRow(model.id, state.rankBy), rank = ranks.get(model.id); const coverage = row ? formatValue(row.coverage, 'coverage', 1) : '—'; return `${rank ?? '—'}${esc(model.family)}${!model.evaluated ? '· Not measured' : model.transport === 'server' ? 'SERVER' : ''}${names.map(name => scoreCell(model, name, rankMaps.get(name))).join('')}${coverage}`; }).join(''); document.querySelector('#table-area').innerHTML = `
${header}${models.length ? rows : ``}

No models match these filters

Try another name or turn off the full-coverage filter.

`; document.querySelector('#result-count').innerHTML = `${models.length} models · ranks use ${esc(SHORT_NAMES[state.rankBy])} only`; document.querySelector('#metric-direction').textContent = `${METRICS[state.metric].label} ${METRICS[state.metric].higher ? '↑ higher' : '↓ lower'} is better`; document.querySelector('#metric-select').title = METRICS[state.metric].detail; const params = new URLSearchParams(); if (language === 'zh') params.set('lang', 'zh'); if (state.group !== 'text') params.set('view', state.group); if (state.metric !== 'accuracy') params.set('metric', state.metric); if (state.rankBy !== 'JevAltBench') params.set('rank', state.rankBy); if (state.query) params.set('q', state.query); try { history.replaceState(null, '', `${location.pathname}${params.size ? '?' + params.toString() : ''}${location.hash}`); } catch {} renderComparisonBar(); translatePage(); } function renderControls() { document.querySelector('#tabs').innerHTML = Object.entries(GROUPS).map(([id, group]) => ``).join('') + `
SNAPSHOT · ${prettyDate(data.snapshot.last_run_at).toUpperCase()}
`; document.querySelector('#rank-select').innerHTML = activeNames().map(name => ``).join(''); document.querySelector('#metric-select').innerHTML = Object.entries(METRICS).filter(([id]) => id !== 'public_decision_index' || ['index', 'all'].includes(state.group)).map(([id, metric]) => ``).join(''); document.querySelector('#family-select').value = state.family; document.querySelector('#model-search').value = state.query; document.querySelector('#full-coverage').checked = state.fullCoverage; } function renderComparisonBar() { const bar = document.querySelector('#compare-bar'); bar.hidden = state.selected.length === 0; bar.innerHTML = `
${state.selected.map(name => `${esc(name)}`).join('')}
`; const compare = document.querySelector('#compare-top'); compare.disabled = state.selected.length < 2; compare.innerHTML = `${icon('compare', 14)} Compare${state.selected.length ? ' (' + state.selected.length + ')' : ''}`; } function renderChartSection() { return `

Model performance

View the full table ${icon('arrow', 13)}
PARAMETERS
${sizePresets.map((preset, i) => ``).join('')}

Sizes use published parameter counts or backbone sizes, including the base model for adapters. Click a size for its source; click a bar for the measurement. Partial valid coverage

`; } function renderChart() { const s = chartState, metric = METRICS[s.metric]; const models = chartModels(data.models, map, s); const shown = s.expanded ? models : models.slice(0, 10); const axis = chartAxis(models.map(model => plotValue(valueOf(getRow(model.id, s.benchmark), s.metric), s.metric)), s.metric); document.querySelector('#chart-metric').innerHTML = Object.entries(METRICS).filter(([id]) => id !== 'public_decision_index' || isDecisionIndex(s.benchmark)).map(([id, m]) => ``).join(''); document.querySelector('#chart-direction').textContent = `${metric.higher ? '↑ Higher' : '↓ Lower'} is better`; document.querySelector('#chart-note').textContent = s.metric === 'public_decision_index' ? 'Public Decision Index · 0–100. This uses the official public-only formula; private components are excluded.' : metric.detail; document.querySelector('#size-readout').textContent = `${s.min.toFixed(1)}–${s.max.toFixed(1)}B`; for (const bound of ['min', 'max']) { document.querySelector(`#size-${bound}`).value = s[bound]; document.querySelector(`#size-${bound}-label`).textContent = s[bound].toFixed(1) + 'B'; } document.querySelector('#size-unknown').checked = s.includeUnknown; document.querySelectorAll('[data-size-preset]').forEach(button => { const preset = sizePresets[Number(button.dataset.sizePreset)]; button.setAttribute('aria-pressed', String(s.min === preset.min && s.max === preset.max() && s.includeUnknown === !!preset.unknown)); }); const measured = data.models.filter(model => valueOf(getRow(model.id, s.benchmark), s.metric) !== null).length; document.querySelector('#chart-summary').textContent = `${shown.length} of ${models.length} matching models · ${measured} with eligible scores on ${SHORT_NAMES[s.benchmark]}`; document.querySelector('#chart-axis').innerHTML = Array.from({ length: 6 }, (_, i) => `${esc(axisLabel(axis * i / 5, s.metric))}`).join(''); document.querySelector('#chart-bars').innerHTML = shown.length ? shown.map((model, i) => { const row = getRow(model.id, s.benchmark), value = valueOf(row, s.metric); const width = Math.max(0, Math.min(100, plotValue(value, s.metric) / axis * 100)); const partial = row.coverage < 1 - 1e-9; const size = parameterSize(model) === null ? 'Undisclosed' : external(model.parameter_source, `${esc(model.parameter_label)} ${icon('diagonal', 9)}`, 'bar-size'); return `
${size}
${partial ? '' : ''}${formatValue(row.coverage, 'coverage', 2)}
`; }).join('') : '

No eligible scores in this size range

Choose another range or benchmark.

'; document.querySelector('#chart-more').innerHTML = models.length > 10 ? `` : ''; translatePage(); } function renderPage() { const c = data.snapshot.counts; const families = [...new Set(data.models.map(m => m.family))].sort(); document.querySelector('#app').innerHTML = `
valenleaderboard
JevalKitLeaderboard

JevalKit

A common ground for evaluating decision models.

Compare accuracy, calibration and coverage across text, images and video using verified measurements.

ChoiceNoulScore
${c.model_families}
Model families
${c.evaluated_families} evaluated · ${c.model_families - c.evaluated_families} API pending
${c.benchmark_families}
Benchmark suites
Text, image & video
${c.eligible_scores}
Verified full scores
${c.model_configurations} evaluated configurations
${c.retained_runs}
Retained runs
Full evaluation history
${renderChartSection()}

Model leaderboard

${icon('shield', 16)}

Measured, then verified

Only complete, eligible runs receive a rank. Historical errors remain visible in the archive.

${icon('layers', 16)}

Compare like with like

Each column uses a pinned dataset and protocol. No combined score across different benchmarks.

${icon('code', 16)}

Open by design

Explore every measurement, download the data, or reproduce results with JevalKit.

JevalKit · Open tools. Better decisions.${external('https://valen-team.github.io/docs/jevalkit/', 'Documentation')}Snapshot ${prettyDate(data.snapshot.last_run_at)} · UTC${external(data.snapshot.source_url, `SOURCE ${esc(data.snapshot.source_commit.slice(0, 7))} ${icon('diagonal', 11)}`, 'source-link')}
`; renderControls(); renderRows(); renderChart(); } function openDialog(title, kicker, subtitle, body) { const dialog = document.querySelector('#detail-dialog'); document.querySelector('#dialog-content').innerHTML = `
${kicker}

${title}

${subtitle ? `

${subtitle}

` : ''}
${body}
`; translatePage(); if (!dialog.open) dialog.showModal(); document.body.style.overflow = 'hidden'; dialog.scrollTop = 0; } function showModel(id) { const model = data.models.find(m => m.id === id); if (!model) return; const full = data.results.filter(r => r.primary && r.eligible && r.model === id); const rows = GROUPS.all.names.map(name => { const row = getRow(id, name); return `${esc(SHORT_NAMES[name])}${formatValue(valueOf(row, 'accuracy'), 'accuracy')}${row ? formatValue(row.coverage, 'coverage', 1) : '—'}${badge(row)}${row ? `` : ''}`; }).join(''); openDialog(esc(id), 'MODEL PROFILE', `${esc(model.family)} · ${full.length} eligible benchmark measurements`, `${!model.evaluated ? '
Benchmark evaluation is pending. No scores have been assigned to this configuration.
' : ''}
${rows}
BenchmarkAccuracyCoverageStatus

Accuracy is shown per benchmark. Open a Decision Index measurement to view its separate public-only index score.

${external(model.source_url, `Model source ${icon('diagonal', 13)}`, 'button')}${model.checkpoint && !model.checkpoint.includes('://') && model.checkpoint.includes('/') ? external(`https://huggingface.co/${model.checkpoint}`, `Checkpoint ${icon('diagonal', 13)}`, 'button') : ''}
`); } function showRun(id) { const row = data.results.find(r => r.id === id); if (!row) return; const overall = row.overall || {}, b = benchmark(row.benchmark); const counts = [['Total questions', row.questions], ['Valid answers', overall.valid ?? Math.round(row.coverage * row.questions)], ['Unsupported', row.unsupported], ['Runtime errors', row.failed]]; const stats = counts.map(([label, value]) => `
${label}${number(value)}
`).join(''); const metricRows = ['accuracy', 'brier', 'nll', 'ece', 'latency_s', ...(row.public_decision_index !== null ? ['public_decision_index'] : [])].map(metric => `${METRICS[metric].label}${metric === 'public_decision_index' ? ' · public-only' : ''}${formatValue(row[metric], metric)}${METRICS[metric].higher ? 'Higher' : 'Lower'} is better`).join(''); const types = Object.entries(row.by_type || {}).map(([type, metrics]) => `${groupNames[type] || esc(type)}${number(metrics.questions)}${formatValue(metrics.accuracy, 'accuracy')}${formatValue(metrics.coverage, 'coverage', 1)}`).join(''); const cleanStatus = row.primary ? 'CURRENT MEASUREMENT' : 'RETAINED HISTORICAL RUN'; openDialog(esc(row.model), cleanStatus, `${esc(SHORT_NAMES[row.benchmark] || row.benchmark)} · ${prettyDate(row.created_utc)}${row.created_utc ? ' UTC' : ''}`, `${badge(row)}

${row.primary ? 'The latest complete measurement selected by the toolkit for this dataset and protocol.' : 'This is a retained run, not the measurement currently selected for the main ranking.'} ${row.smoke ? 'This run uses a smoke-test sample.' : ''} ${row.origin?.startsWith('imported') ? 'This measurement was imported from retained upstream evaluation outputs.' : ''}

${stats}
${metricRows}
MetricValueDirection
${types ? `

By question type

${types}
TypeQuestionsAccuracyCoverage
` : ''}

Valid coverage: ${formatValue(row.coverage, 'coverage')}. Accuracy uses ${typeof overall.hard_questions === 'number' ? number(overall.hard_questions) + ' hard-reference questions' : 'the benchmark’s hard-reference denominator'}; probability metrics use valid probability references. Unsupported answers remain in the accuracy denominator.${isDecisionIndex(row.benchmark) ? ' Public DI excludes private components and is not the full official index.' : ''}

Protocol
${esc(row.protocol)}
Hardware / origin
${esc(row.hardware || 'Not recorded')} · ${esc(row.origin)}
Dataset SHA-256
${esc(row.dataset_sha256)}
Prediction SHA-256
${esc(row.predictions_sha256 || 'See source snapshot')}
${row.manifest_sha256 ? `
Run manifest SHA-256
${esc(row.manifest_sha256)}
` : ''}
Reference questions
${number(b?.questions || row.questions)} · ${row.complete ? 'Complete' : 'Incomplete'} · ${row.smoke ? 'Smoke test' : 'Full dataset'}
${external(data.snapshot.source_url, `Evaluation code ${icon('diagonal', 13)}`, 'button')}${b ? external(b.source_url, `Benchmark source ${icon('diagonal', 13)}`, 'button') : ''}
`); } function showComparison() { if (state.selected.length < 2) return; const colors = ['#b89c37', '#6e8d72', '#7c88a5']; const legend = state.selected.map((name, i) => `${esc(name)}`).join(''); const sections = GROUPS.all.names.map(name => `

${esc(SHORT_NAMES[name])}${number(benchmark(name).questions)} QUESTIONS

${state.selected.map((id, i) => { const row = getRow(id, name), value = valueOf(row, 'accuracy'); const label = value === null ? statusOf(row) === 'unsupported' ? 'Unsupported' : '—' : formatValue(value, 'accuracy'); return `
${esc(id)}
${value !== null ? `` : ''}
${label}
`; }).join('')}
`).join(''); openDialog('Side by side', 'MODEL COMPARISON', 'Accuracy on identical benchmark snapshots · higher is better', `
${legend}

Bars show accuracy within each benchmark. Missing or unsupported measurements are left empty. Coverage is included in each bar’s tooltip; open a model profile for complete metrics.

${sections}

Decision Index bars show accuracy, not the public-only composite index. No average across benchmarks is calculated.

`); } function showBenchmarks() { const cards = data.benchmarks.map(b => `

${external(b.source_url, `${esc(SHORT_NAMES[b.name])} ${icon('diagonal', 12)}`)}

${number(b.records)} shared states · ${number(b.questions)} questions
${esc(b.modality)} · ${measuredCount(b.name)} eligible full results

${esc(b.protocol)}
`).join(''); openDialog('The benchmark collection', '8 FAMILIES · 9 SCORED VIEWS', 'Pinned data, native question types and benchmark-specific protocols', `
${cards}

VisualDecisionBench Image and Video are views of one family. The combined TSV is available in the dataset repository and is not counted as an additional suite. Public DI is an official public-only score, with private components excluded.

${external('https://huggingface.co/datasets/Valen-Team/JevalKit_Datasets', `Explore the datasets ${icon('diagonal', 13)}`, 'button primary')}${external('https://github.com/Valen-Team/JevalKit/blob/main/docs/benchmarks.md', `Protocols and scoring ${icon('diagonal', 13)}`, 'button')}
`); } function showMethodology() { openDialog('Read the result, not just the rank.', 'EVALUATION NOTES', 'Native inference. Pinned benchmarks. Explicit coverage.', `

One ranking per benchmark

Ranks apply to the selected benchmark and metric only. Clicking a column changes the ranking. The table uses the latest complete measurement for each pinned dataset and protocol, rather than picking the highest repeat. No cross-benchmark aggregate is invented.

What qualifies for a score?

Only complete, non-smoke measurements with conformant inputs, no runtime failures and at least one valid answer are eligible. Unsupported questions stay in the hard-label accuracy denominator. The archive retains earlier errors, capability exclusions, smoke runs and repeated measurements.

Accuracy and calibration answer different questions

Accuracy uses hard references. Brier, NLL and ECE use valid references under the benchmark’s scoring protocol; inspect valid coverage alongside these metrics. Some suites include soft references that contribute probability metrics but not hard-label accuracy.

Coverage matters

A gold dot marks partial valid coverage. The coverage column refers to the benchmark selected under “Rank within.” “Full coverage only” filters that selected benchmark. A dash means no measurement. “Unsupported” indicates a complete run with no supported inputs and does not receive a rank.

Decision Index is public-only

The separate Decision Index tab can show its public-only official score. It excludes private components and should not be read as the complete official Decision Index.

Latency needs matching conditions

Latency is mean seconds per shared-state request. Hardware appears in each measurement. Author runtimes and serving environments differ, so latency alone is not a controlled hardware comparison.

A reproducible snapshot

This Space shows a static snapshot from ${prettyDate(data.snapshot.last_run_at)} UTC, with ${data.snapshot.counts.eligible_scores} eligible primary measurements. ${data.snapshot.counts.evaluated_families} of ${data.snapshot.counts.model_families} registered families have measurements; OpenAI-Decisions is still pending. Public data includes selection flags, dataset and prediction hashes, and retained run summaries.

${external(data.snapshot.source_url, `Evaluation code ${icon('diagonal', 13)}`, 'button')}
`); } function showArchive() { const rows = [...data.results].sort((a, b) => (b.created_utc || '').localeCompare(a.created_utc || '')).map(row => `
${row.primary ? 'Current selected run' : 'Historical run'}${row.smoke ? ' · smoke' : ''}
${esc(SHORT_NAMES[row.benchmark] || row.benchmark)}${badge(row)}${row.failed || '0'}`).join(''); openDialog('Every run has a place.', 'THE RUN ARCHIVE', `${data.results.length} retained evaluation artifacts · ${data.snapshot.counts.eligible_scores} current eligible scores`, `

Historical, incomplete and smoke measurements remain visible here. Only current eligible full runs enter the main ranking.

${rows}
Model / selectionBenchmarkRun statusErrors
`); } function changeGroup(group) { state.group = group; state.reversed = false; state.rankBy = group === 'text' ? 'JevAltBench' : GROUPS[group].names[0]; if (group === 'index') state.metric = 'public_decision_index'; else if (state.metric === 'public_decision_index') state.metric = 'accuracy'; renderControls(); renderRows(); } function addSelection(id) { if (state.selected.includes(id)) state.selected = state.selected.filter(name => name !== id); else if (state.selected.length >= 3) { toast('Choose up to 3 models for comparison.'); return false; } else state.selected.push(id); renderRows(); return true; } function resetFilters() { state.query = ''; state.family = 'all'; state.fullCoverage = false; renderControls(); renderRows(); } document.addEventListener('click', event => { const button = event.target.closest('button'); if (!button || !data) return; if (button.dataset.run) { showRun(button.dataset.run); return; } if (button.dataset.model) { showModel(button.dataset.model); return; } if (button.dataset.group) { changeGroup(button.dataset.group); return; } if (button.dataset.rank) { if (state.rankBy === button.dataset.rank) state.reversed = !state.reversed; else { state.rankBy = button.dataset.rank; state.reversed = false; } renderControls(); renderRows(); return; } if (button.dataset.add) { if (addSelection(button.dataset.add)) toast(state.selected.includes(button.dataset.add) ? 'Added to comparison.' : 'Removed from comparison.'); return; } if (button.dataset.downloadRun) { const row = data.results.find(r => r.id === button.dataset.downloadRun); download(`JevalKit-${row.model}-${row.benchmark}.json`, JSON.stringify({ source: data.snapshot.source_url, ...row }, null, 2)); return; } const action = button.dataset.action; if (button.dataset.sizePreset !== undefined) { const preset = sizePresets[Number(button.dataset.sizePreset)]; chartState.min = preset.min; chartState.max = preset.max(); chartState.includeUnknown = !!preset.unknown; renderChart(); return; } if (action === 'chart-expand') { chartState.expanded = !chartState.expanded; renderChart(); } if (action === 'close') document.querySelector('#detail-dialog').close(); if (action === 'methodology') showMethodology(); if (action === 'benchmarks') showBenchmarks(); if (action === 'archive') showArchive(); if (action === 'compare') showComparison(); if (action === 'clear-compare') { state.selected = []; renderRows(); } if (action === 'reset') resetFilters(); if (action === 'csv') download(`JevalKit-${state.group}-${state.metric}.csv`, csvFor(visibleModels(), map, tableNames(), state.metric), 'text/csv;charset=utf-8'); if (action === 'json') download('JevalKit-leaderboard.json', JSON.stringify(data, null, 2)); }); document.addEventListener('input', event => { if (event.target.id === 'model-search') { state.query = event.target.value; renderRows(); } if (!data) return; if (event.target.id === 'size-min' || event.target.id === 'size-max') { const bound = event.target.id === 'size-min' ? 'min' : 'max'; chartState[bound] = Number(event.target.value); if (chartState.min > chartState.max) chartState[bound === 'min' ? 'max' : 'min'] = chartState[bound]; chartState.includeUnknown = chartState.min === 0 && chartState.max === sizeLimit; renderChart(); } }); document.addEventListener('change', event => { const target = event.target; if (!data) return; if (target.id === 'chart-benchmark') { chartState.benchmark = target.value; if (isDecisionIndex(target.value)) chartState.metric = 'public_decision_index'; else if (chartState.metric === 'public_decision_index') chartState.metric = 'accuracy'; renderChart(); return; } if (target.id === 'chart-metric') { chartState.metric = target.value; renderChart(); return; } if (target.id === 'size-unknown') { chartState.includeUnknown = target.checked; renderChart(); return; } if (target.dataset.select) { if (!addSelection(target.dataset.select)) target.checked = false; return; } if (target.id === 'metric-select') { state.metric = target.value; state.reversed = false; } if (target.id === 'rank-select') { state.rankBy = target.value; state.reversed = false; } if (target.id === 'family-select') state.family = target.value; if (target.id === 'full-coverage') state.fullCoverage = target.checked; if (['metric-select', 'rank-select', 'family-select', 'full-coverage'].includes(target.id)) renderRows(); }); const dialog = document.querySelector('#detail-dialog'); matchMedia('(max-width: 680px)').addEventListener('change', () => { if (data) renderRows(); }); dialog.addEventListener('close', () => { document.body.style.overflow = ''; }); dialog.addEventListener('click', event => { if (event.target === dialog) { const rect = dialog.getBoundingClientRect(); if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) dialog.close(); } }); async function boot() { try { const response = await fetch('./data/leaderboard.json'); if (!response.ok) throw new Error(`The data snapshot returned HTTP ${response.status}.`); data = await response.json(); if (data.schema_version !== 1 || !data.results.length || !data.models.length) throw new Error('The data snapshot has an unsupported format.'); map = resultMap(data); benchmarks = new Map(data.benchmarks.map(b => [b.name, b])); sizeLimit = Math.max(30, Math.ceil(Math.max(...data.models.map(model => parameterSize(model) || 0)) / 10) * 10); chartState.max = sizeLimit; const params = new URLSearchParams(location.search); if (GROUPS[params.get('view')]) state.group = params.get('view'); if (METRICS[params.get('metric')]) state.metric = params.get('metric'); else if (state.group === 'index') state.metric = 'public_decision_index'; if (activeNames().includes(params.get('rank'))) state.rankBy = params.get('rank'); else if (!activeNames().includes(state.rankBy)) state.rankBy = activeNames()[0]; if (state.metric === 'public_decision_index' && !['index', 'all'].includes(state.group)) state.metric = 'accuracy'; state.query = params.get('q') || ''; renderPage(); } catch (error) { document.querySelector('#app').innerHTML = `
JevalKit${preferenceControls()}

The results couldn’t load.

${esc(error.message)} Please reload, or open the source snapshot on Hugging Face.

${external('https://huggingface.co/spaces/Valen-Team/JevalKit-Leaderboard/blob/main/data/leaderboard.json', 'View results snapshot', 'button')}
`; document.querySelector('#retry-load').onclick = boot; translatePage(); } } document.addEventListener('click', event => { const button = event.target.closest('button'); if (!button) return; if (button.dataset.language) { language = button.dataset.language === 'zh' ? 'zh' : 'en'; try {localStorage.setItem('jevalkit-language', language);} catch {} if (data) renderPage(); else translatePage(); } if (button.hasAttribute('data-theme-toggle')) { theme = theme === 'dark' ? 'light' : 'dark'; try {localStorage.setItem('jevalkit-theme', theme);} catch {} applyPreferences(); } }); applyPreferences(); boot();