free-coding-models 0.5.60 → 0.5.62
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 +2 -0
- package/bin/free-coding-models.js +19 -0
- package/changelog/v0.5.61.md +65 -0
- package/changelog/v0.5.62.md +65 -0
- package/package.json +8 -2
- package/scripts/check-drift.mjs +160 -0
- package/scripts/update-benchmarks.mjs +239 -0
- 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/utils.js +14 -0
- package/src/data/benchmarks.json +302 -0
- package/src/tui/app.js +86 -0
- package/src/tui/cli-help.js +2 -0
- package/src/tui/render-table.js +38 -2
- package/web/dist/assets/{index-CQQJkofy.js → index-DBaz4DiK.js} +2 -2
- package/web/dist/index.html +1 -1
- package/web/server.js +39 -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-DBaz4DiK.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,
|