openvibers/openvibe.report Commits
AI leaderboard: Free reads Free, unrated models in a useful order, providers named plainly (#167)
Changes
@@@ -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;@@@ -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) => ({@@@ -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');
@@ -102,7 +102,11 @@ function createPublicPages({ sessionReports, network, live, bench, aiCatalogue =
@@ -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;
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) => {
rows.forEach((row, i) => {
const [lo, hi] = row.rating.interval || [];
const [lo, hi] = row.rating.interval || [];
if (lo == null || hi == null) row.rank = null;
if (lo == null || hi == null) row.rank = null;
@@ -17,7 +17,7 @@ const value = (x) => x == null || !Number.isFinite(Number(x)) ? null : Number(x)
@@ -17,7 +17,7 @@ const value = (x) => x == null || !Number.isFinite(Number(x)) ? null : Number(x)
const idPath = (id) => `/ai/models/${encodeURIComponent(id || '')}`;
const idPath = (id) => `/ai/models/${encodeURIComponent(id || '')}`;
const act = (href, label) => kit.button({ href, label, kind: 'quiet', icon: 'forward' });
const act = (href, label) => kit.button({ href, label, kind: 'quiet', icon: 'forward' });
const quiet = (text) => `<span class="ai-quiet">${esc(text)}</span>`;
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 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 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}` : ''}`; };
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
@@ -117,7 +117,7 @@ const dataLinks = () => `<p class="ai-data">Data: <a href="/api/v1/ai/leaderboar
// ── /ai ──
// ── /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' };
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) {
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` : ''; }
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)}` : '';
return rated(row) ? `Rating ${Math.round(row.rating.value)}` : '';
}
}
@@ -182,7 +182,7 @@ function leaderboard({ rows = [], filters = {} } = {}) {
@@ -182,7 +182,7 @@ function leaderboard({ rows = [], filters = {} } = {}) {
// ── /ai/providers ──
// ── /ai/providers ──
const ownServer = (p) => /^(local|whisper)$/i.test(String(p.provider || '')) || /on this host|\blocal\b/i.test(String(p.provider_name || ''));
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 });
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) {
function providerTable(list) {
const rows = list.map((p) => ({
const rows = list.map((p) => ({
@@ -50,6 +50,12 @@ const { boot, check, done, stubFetch, jsonResponse } = require('./helpers/boot')
@@ -50,6 +50,12 @@ const { boot, check, done, stubFetch, jsonResponse } = require('./helpers/boot')
const page = await t.get('/ai/models/model-zero');
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');
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 () => {
await check('the providers page lists every offer', async () => {
const r = await t.get('/ai/providers');
const r = await t.get('/ai/providers');
assert.ok(r.text.includes('OpenAI') && r.text.includes('DeepSeek'), 'both providers');
assert.ok(r.text.includes('OpenAI') && r.text.includes('DeepSeek'), 'both providers');