openvibers/openvibe.report Commits

AI leaderboard: Free reads Free, unrated models in a useful order, providers named plainly (#167)

OP OpenVibers committed 4 days ago · 41358e2541 · 3 files, +14 −4

On the live market (46 models, 25 providers): a zero price showed as $0.00; models without a rating sat in catalogue
order; and provider names carried the catalogue's internal notes ("(the uncensored tier)"). A zero price reads
Free; unrated models list what the Exchange routes first, then the cheapest; a provider's name drops the note.

Changes

ddiff --git a/server/http/pages.js b/server/http/pages.js
iindex 0c7eadf..1f828eb 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -102,7 +102,11 @@ function createPublicPages({ sessionReports, network, live, bench, aiCatalogue =
task.rank = overlap.length ? { min: Math.min(...overlap), max: Math.max(...overlap), position: i + 1 } : null;
});
}
-- rows.sort((a, b) => (b.rating.value ?? -Infinity) - (a.rating.value ?? -Infinity));
++ const outPrice = (r) => Math.min(...(r.provider_offers || []).map((o) => (o.price && o.price.out != null ? Number(o.price.out) : NaN)).filter(Number.isFinite), Infinity);
++ rows.sort((a, b) => (b.rating.value ?? -Infinity) - (a.rating.value ?? -Infinity)
++ || (b.routed === true) - (a.routed === true)
++ || outPrice(a) - outPrice(b)
++ || String(a.id).localeCompare(String(b.id)));
rows.forEach((row, i) => {
const [lo, hi] = row.rating.interval || [];
if (lo == null || hi == null) row.rank = null;
ddiff --git a/server/views/ai-comparison.js b/server/views/ai-comparison.js
iindex cfee549..854a654 100644
---- a/server/views/ai-comparison.js
++++ b/server/views/ai-comparison.js
@@@ -17,7 +17,7 @@ const value = (x) => x == null || !Number.isFinite(Number(x)) ? null : Number(x)
const idPath = (id) => `/ai/models/${encodeURIComponent(id || '')}`;
const act = (href, label) => kit.button({ href, label, kind: 'quiet', icon: 'forward' });
const quiet = (text) => `<span class="ai-quiet">${esc(text)}</span>`;
--const money = (x) => value(x) == null ? null : kit.num(x, 'money');
++const money = (x) => value(x) == null ? null : Number(x) === 0 ? 'Free' : kit.num(x, 'money');
const ms = (x) => value(x) == null ? null : kit.num(x, 'ms');
const share = (x) => { const v = x != null && typeof x === 'object' ? x.value : x; return value(v) == null ? null : `${(Number(v) * 100).toFixed(Number(v) > 0 && Number(v) < 0.01 ? 2 : 1)}%`; };
const sourceHint = (s) => { const x = s && typeof s === 'object' ? s : { name: s }; return `Source: ${x.name || 'not listed'}${x.date ? ` · ${String(x.date).slice(0, 10)}` : ''}${x.sample_size != null ? ` · n = ${x.sample_size}` : ''}`; };
@@@ -117,7 +117,7 @@ const dataLinks = () => `<p class="ai-data">Data: <a href="/api/v1/ai/leaderboar
// ── /ai ──
const PICK_LABELS = { overall: 'Best overall', value: 'Best value', fastest: 'Fastest', open: 'Best open weights', code: 'Best for code', writing: 'Best for writing', uncensored: 'Best uncensored 18+', free: 'Best free' };
function pickNumber(id, row) {
-- if (id === 'value' || id === 'free') { const o = cheapest(row); return o ? `${money(o.price.out)} per 1M out` : ''; }
++ if (id === 'value' || id === 'free') { const o = cheapest(row); return !o ? '' : Number(o.price.out) === 0 ? 'Free' : `${money(o.price.out)} per 1M out`; }
if (id === 'fastest') { const o = fastest(row); return o ? `${ms(o.speed.p50_ms)} typical reply` : ''; }
return rated(row) ? `Rating ${Math.round(row.rating.value)}` : '';
}
@@@ -182,7 +182,7 @@ function leaderboard({ rows = [], filters = {} } = {}) {
// ── /ai/providers ──
const ownServer = (p) => /^(local|whisper)$/i.test(String(p.provider || '')) || /on this host|\blocal\b/i.test(String(p.provider_name || ''));
--const providerName = (p) => ownServer(p) ? 'OpenVibe server' : (p.provider_name || p.provider || 'Provider');
++const providerName = (p) => ownServer(p) ? 'OpenVibe server' : String(p.provider_name || p.provider || 'Provider').replace(/\s*\((?:the |an? )[^)]*\)\s*$/i, '');
const providerMark = (p) => ownServer(p) ? marks.mark('openvibe', { size: 24, label: false }) : marks.mark(p.provider || p.provider_name, { size: 24, label: false });
function providerTable(list) {
const rows = list.map((p) => ({
ddiff --git a/test/ai-catalogue-join.test.js b/test/ai-catalogue-join.test.js
iindex b40c300..7eff99c 100644
---- a/test/ai-catalogue-join.test.js
++++ b/test/ai-catalogue-join.test.js
@@@ -50,6 +50,12 @@ const { boot, check, done, stubFetch, jsonResponse } = require('./helpers/boot')
const page = await t.get('/ai/models/model-zero');
assert.ok(page.text.includes('Not rated on any task yet'), 'the model page says so');
});
++ await check('unrated models list what the Exchange routes first, then the cheapest; a note in brackets is not a name', async () => {
++ const views = require('../server/views/ai-comparison');
++ const html = views.providers({ providers: [{ provider: 'x', provider_name: 'Abliteration.ai (the uncensored tier)', model: 'm', price: { in: 0, out: 0 }, routed: false }] });
++ assert.ok(html.includes('Abliteration.ai<') && !html.includes('the uncensored tier'), 'the provider is named plainly');
++ assert.ok(html.includes('Free') && !html.includes('$0.00'), 'a price of zero reads Free');
++ });
await check('the providers page lists every offer', async () => {
const r = await t.get('/ai/providers');
assert.ok(r.text.includes('OpenAI') && r.text.includes('DeepSeek'), 'both providers');