@xynogen/pix-data 0.2.0 → 0.2.2
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/package.json +1 -1
- package/src/data.ts +11 -1
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/data.ts
CHANGED
|
@@ -277,7 +277,7 @@ export const CACHE_DIR = join(
|
|
|
277
277
|
|
|
278
278
|
export const modelgrep = new DataSource<ModelGrepModel[]>({
|
|
279
279
|
label: "modelgrep",
|
|
280
|
-
url: `https://modelgrep.com/api/v1/models?
|
|
280
|
+
url: `https://modelgrep.com/api/v1/models?sort=coding&order=desc&limit=${MODELGREP_PAGE}`,
|
|
281
281
|
cachePath: join(CACHE_DIR, "modelgrep.json"),
|
|
282
282
|
fetchRaw: fetchModelGrepAll,
|
|
283
283
|
parse: (raw) => (raw as ModelGrepResponse).data ?? [],
|
|
@@ -466,6 +466,16 @@ function buildBenchIndex(): Map<string, BenchmarkEntry> {
|
|
|
466
466
|
return index;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
+
/** Map a benchmark score (0–100) to a semantic color token. */
|
|
470
|
+
export function benchScoreColor(
|
|
471
|
+
score: number | null | undefined,
|
|
472
|
+
): "success" | "warning" | "error" | "muted" {
|
|
473
|
+
if (score == null) return "muted";
|
|
474
|
+
if (score >= 80) return "success";
|
|
475
|
+
if (score >= 60) return "warning";
|
|
476
|
+
return "error";
|
|
477
|
+
}
|
|
478
|
+
|
|
469
479
|
export function lookupBenchmark(modelName: string): BenchmarkEntry | undefined {
|
|
470
480
|
return findInIndex(modelName, buildBenchIndex());
|
|
471
481
|
}
|
package/src/index.ts
CHANGED