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.
@@ -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-C_ZdUGrS.js"></script>
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 && (