@xynogen/pix-models 0.1.5 → 0.1.7
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 -2
- package/package.json +1 -1
- package/src/models.ts +12 -4
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# pix-models
|
|
2
2
|
|
|
3
|
-
Pi extension — enhanced `/models` picker with
|
|
3
|
+
Pi extension — enhanced `/models` picker with coding score/rank.
|
|
4
4
|
|
|
5
5
|
## What it does
|
|
6
6
|
|
|
7
|
-
Registers a `/models` slash command that replaces Pi's built-in `/model` selector with a richer TUI picker. Each row shows model name, provider, context window, cost per million tokens, and
|
|
7
|
+
Registers a `/models` slash command that replaces Pi's built-in `/model` selector with a richer TUI picker. Each row shows model name, provider, context window, cost per million tokens, and a coding-focused score/rank when available. The list is sorted by coding score (best first), then alphabetically for unscored models. Fuzzy search filters the list as you type. Selecting a model switches the active model for the session. Model metadata is sourced from `~/.cache/pi/` via `pix-data`; the coding score/rank is computed locally from the modelgrep catalog (best = #1). Requires `@xynogen/pix-data` as a dependency.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
package/package.json
CHANGED
package/src/models.ts
CHANGED
|
@@ -23,7 +23,11 @@ import {
|
|
|
23
23
|
Text,
|
|
24
24
|
visibleWidth,
|
|
25
25
|
} from "@earendil-works/pi-tui";
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
benchScoreColor,
|
|
28
|
+
lookupBenchmark,
|
|
29
|
+
lookupModelsDev,
|
|
30
|
+
} from "@xynogen/pix-data";
|
|
27
31
|
import { patchOutBuiltinModelCommand } from "./patch-builtin";
|
|
28
32
|
|
|
29
33
|
// ─── Pure logic (exported for tests) ─────────────────────────────────────────
|
|
@@ -175,7 +179,10 @@ async function showEnhancedPicker(
|
|
|
175
179
|
let rankPrefix: string;
|
|
176
180
|
if (localRank) {
|
|
177
181
|
const rankStr = String(localRank).padEnd(maxRankWidth);
|
|
178
|
-
|
|
182
|
+
// Color rank by the model's bench score (same scale as ⚡score),
|
|
183
|
+
// not by list position — keeps the two colors consistent.
|
|
184
|
+
const rankColor = benchScoreColor(bench?.overallScore);
|
|
185
|
+
rankPrefix = mute("#") + theme.fg(rankColor, rankStr);
|
|
179
186
|
} else {
|
|
180
187
|
rankPrefix = " ".repeat(maxRankWidth + 1);
|
|
181
188
|
}
|
|
@@ -200,6 +207,7 @@ async function showEnhancedPicker(
|
|
|
200
207
|
if (bench) {
|
|
201
208
|
const score = bench.overallScore ?? "?";
|
|
202
209
|
const s = bench.overallScore;
|
|
210
|
+
const scoreColor = benchScoreColor(s);
|
|
203
211
|
let filled = 1;
|
|
204
212
|
if (typeof s === "number") {
|
|
205
213
|
if (s >= 90) filled = 5;
|
|
@@ -208,9 +216,9 @@ async function showEnhancedPicker(
|
|
|
208
216
|
else if (s >= 50) filled = 2;
|
|
209
217
|
}
|
|
210
218
|
const starBar =
|
|
211
|
-
theme.fg(
|
|
219
|
+
theme.fg(scoreColor, "★".repeat(filled)) +
|
|
212
220
|
mute("☆".repeat(5 - filled));
|
|
213
|
-
benchSeg = `⚡${theme.fg(
|
|
221
|
+
benchSeg = `⚡${theme.fg(scoreColor, String(score))} ${starBar}`;
|
|
214
222
|
}
|
|
215
223
|
const desc = [ctxStr, costSeg, benchSeg].filter(Boolean).join(sep);
|
|
216
224
|
|