@xynogen/pix-models 0.1.5 → 0.1.6
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 +11 -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,9 @@ async function showEnhancedPicker(
|
|
|
175
179
|
let rankPrefix: string;
|
|
176
180
|
if (localRank) {
|
|
177
181
|
const rankStr = String(localRank).padEnd(maxRankWidth);
|
|
178
|
-
|
|
182
|
+
const rankColor =
|
|
183
|
+
localRank <= 3 ? "success" : localRank <= 7 ? "warning" : "error";
|
|
184
|
+
rankPrefix = mute("#") + theme.fg(rankColor, rankStr);
|
|
179
185
|
} else {
|
|
180
186
|
rankPrefix = " ".repeat(maxRankWidth + 1);
|
|
181
187
|
}
|
|
@@ -200,6 +206,7 @@ async function showEnhancedPicker(
|
|
|
200
206
|
if (bench) {
|
|
201
207
|
const score = bench.overallScore ?? "?";
|
|
202
208
|
const s = bench.overallScore;
|
|
209
|
+
const scoreColor = benchScoreColor(s);
|
|
203
210
|
let filled = 1;
|
|
204
211
|
if (typeof s === "number") {
|
|
205
212
|
if (s >= 90) filled = 5;
|
|
@@ -208,9 +215,9 @@ async function showEnhancedPicker(
|
|
|
208
215
|
else if (s >= 50) filled = 2;
|
|
209
216
|
}
|
|
210
217
|
const starBar =
|
|
211
|
-
theme.fg(
|
|
218
|
+
theme.fg(scoreColor, "★".repeat(filled)) +
|
|
212
219
|
mute("☆".repeat(5 - filled));
|
|
213
|
-
benchSeg = `⚡${theme.fg(
|
|
220
|
+
benchSeg = `⚡${theme.fg(scoreColor, String(score))} ${starBar}`;
|
|
214
221
|
}
|
|
215
222
|
const desc = [ctxStr, costSeg, benchSeg].filter(Boolean).join(sep);
|
|
216
223
|
|