free-coding-models 0.5.59 โ 0.5.61
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.
- package/README.md +32 -0
- package/bin/free-coding-models.js +31 -0
- package/changelog/v0.5.60.md +54 -0
- package/changelog/v0.5.61.md +65 -0
- package/package.json +6 -2
- package/src/core/extended-benchmarks.js +421 -0
- package/src/core/model-merger.js +155 -0
- package/src/core/models-dev-fetcher.js +210 -0
- package/src/core/models-dev-index.js +311 -0
- package/src/core/models-drift.js +296 -0
- package/src/core/router-daemon.js +96 -0
- package/src/core/runtime-telemetry.js +541 -0
- package/src/core/utils.js +29 -0
- package/src/data/benchmarks.json +302 -0
- package/src/tui/app.js +103 -0
- package/src/tui/cli-help.js +2 -0
- package/src/tui/key-handler.js +80 -0
- package/src/tui/render-table.js +38 -2
- package/src/tui/tui-state.js +9 -0
- package/web/dist/assets/{index-C_ZdUGrS.js โ index-4IyXp-vf.js} +2 -2
- package/web/dist/index.html +1 -1
- package/web/server.js +39 -0
- package/web/src/components/router/RouterView.jsx +34 -0
package/web/dist/index.html
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
49
49
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
50
50
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
51
|
-
<script type="module" crossorigin src="/assets/index-
|
|
51
|
+
<script type="module" crossorigin src="/assets/index-4IyXp-vf.js"></script>
|
|
52
52
|
<link rel="stylesheet" crossorigin href="/assets/index-wI9xrm0w.css">
|
|
53
53
|
</head>
|
|
54
54
|
<body>
|
package/web/server.js
CHANGED
|
@@ -313,9 +313,48 @@ function serializeModel(result) {
|
|
|
313
313
|
benchmarkKey: key,
|
|
314
314
|
isBenchmarking: benchmarkRunning.has(key),
|
|
315
315
|
benchmark: benchmarkResults.get(key) || null,
|
|
316
|
+
// ๐ Enrichment overlay (t4 + t5): extended benchmark + models.dev metadata
|
|
317
|
+
// ๐ attached to the result. The web dashboard's DetailPanel renders these
|
|
318
|
+
// ๐ as a benchmark block + provenance chip. Looked up via the lazily-built
|
|
319
|
+
// ๐ webEnrichmentCache (one Map per overlay layer, primed at boot).
|
|
320
|
+
extendedBench: webEnrichmentCache.extendedById.get(result.modelId) || null,
|
|
321
|
+
metaSource: webEnrichmentCache.metaSourceByModelId.get(result.modelId) || 'sources.js',
|
|
316
322
|
}
|
|
317
323
|
}
|
|
318
324
|
|
|
325
|
+
// ๐ webEnrichmentCache: pre-built lookup tables for the enrichments that need
|
|
326
|
+
// ๐ to be served synchronously from the HTTP layer. The catalog lookup is
|
|
327
|
+
// ๐ sync (extended-benchmarks.js), so we just prime the Map at boot. The
|
|
328
|
+
// ๐ models.dev metadata is async โ we try to prime it but fall back to
|
|
329
|
+
// ๐ 'sources.js' if the fetch fails.
|
|
330
|
+
const webEnrichmentCache = {
|
|
331
|
+
extendedById: new Map(),
|
|
332
|
+
metaSourceByModelId: new Map(),
|
|
333
|
+
}
|
|
334
|
+
;(async () => {
|
|
335
|
+
// ๐ t4: prime the extended-benchmark cache (sync catalog, sync lookup)
|
|
336
|
+
try {
|
|
337
|
+
const { buildPrefixIndex, loadCatalog } = await import('../src/core/extended-benchmarks.js')
|
|
338
|
+
loadCatalog() // ๐ ensure the lazy cache is hot
|
|
339
|
+
const index = buildPrefixIndex()
|
|
340
|
+
for (const [key, data] of Object.entries(index.exact)) {
|
|
341
|
+
webEnrichmentCache.extendedById.set(key, data)
|
|
342
|
+
}
|
|
343
|
+
} catch {}
|
|
344
|
+
// ๐ t5: prime the models.dev metadata (async fetch, sync lookup afterwards)
|
|
345
|
+
try {
|
|
346
|
+
const { overlayModelsDevMetadata, buildMergedModels } = await import('../src/core/model-merger.js')
|
|
347
|
+
const { MODELS } = await import('../sources.js')
|
|
348
|
+
const merged = buildMergedModels(MODELS)
|
|
349
|
+
const enriched = await overlayModelsDevMetadata(merged, { mutate: true })
|
|
350
|
+
for (const m of enriched) {
|
|
351
|
+
for (const p of m.providers || []) {
|
|
352
|
+
webEnrichmentCache.metaSourceByModelId.set(p.modelId, m.metaSource || 'sources.js')
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
} catch {}
|
|
356
|
+
})()
|
|
357
|
+
|
|
319
358
|
function getModelsPayload() {
|
|
320
359
|
return {
|
|
321
360
|
pingMode: runtime.pingMode,
|
|
@@ -1015,6 +1015,40 @@ export default function RouterView({ onClose, onToast, favorites }) {
|
|
|
1015
1015
|
</div>
|
|
1016
1016
|
)}
|
|
1017
1017
|
|
|
1018
|
+
{/* Runtime telemetry (t3): per-model real-world success rate + throughput.
|
|
1019
|
+
๐ Read from /stats.runtime (same poll, 5s refresh). Models with
|
|
1020
|
+
๐ insufficient data (< 5 calls) are hidden โ no penalty for new
|
|
1021
|
+
๐ models. */}
|
|
1022
|
+
{stats?.runtimeTelemetry?.stats?.modelsTracked > 0 && (
|
|
1023
|
+
<div className={styles.section} style={{ marginTop: 12 }}>
|
|
1024
|
+
<h3 className={styles.sectionTitle}>
|
|
1025
|
+
๐ Runtime Telemetry
|
|
1026
|
+
<span className={styles.miniPgHint}>{stats.runtimeTelemetry.stats.totalCalls} calls tracked ยท local-only</span>
|
|
1027
|
+
</h3>
|
|
1028
|
+
<div className={styles.quotaGrid}>
|
|
1029
|
+
{Object.entries(stats.runtimeTelemetry.models)
|
|
1030
|
+
.filter(([, m]) => m.totalCalls >= 5)
|
|
1031
|
+
.sort((a, b) => (b[1]?.successRate ?? 0) - (a[1]?.successRate ?? 0))
|
|
1032
|
+
.slice(0, 6)
|
|
1033
|
+
.map(([key, m]) => {
|
|
1034
|
+
const srPct = Math.round((m.successRate ?? 0) * 100)
|
|
1035
|
+
const tps = m.avgTokensPerSecond || 0
|
|
1036
|
+
const srColor = srPct <= 50 ? '#dc2626' : srPct <= 80 ? '#f59e0b' : '#16a34a'
|
|
1037
|
+
return (
|
|
1038
|
+
<div key={key} className={styles.quotaCell} title={`${key}: ${m.totalCalls} calls, ${m.successCalls} ok, ${m.errorCalls} err, ${tps.toFixed(1)} tok/s avg`}>
|
|
1039
|
+
<span className={styles.quotaSource}>๐</span>
|
|
1040
|
+
<span className={styles.quotaName}>{key.split('/')[1] || key}</span>
|
|
1041
|
+
<div className={styles.quotaBar}>
|
|
1042
|
+
<div className={styles.quotaFill} style={{ width: `${srPct}%`, background: srColor }} />
|
|
1043
|
+
</div>
|
|
1044
|
+
<span className={styles.quotaPct} style={{ color: srColor }}>{srPct}%</span>
|
|
1045
|
+
</div>
|
|
1046
|
+
)
|
|
1047
|
+
})}
|
|
1048
|
+
</div>
|
|
1049
|
+
</div>
|
|
1050
|
+
)}
|
|
1051
|
+
|
|
1018
1052
|
{/* Passive quota (t2): per-provider live quota from response headers.
|
|
1019
1053
|
๐ Updated every /stats poll (5s). See provider-quota-fetchers.js. */}
|
|
1020
1054
|
{stats?.quota && Object.keys(stats.quota).length > 0 && (
|