free-coding-models 0.1.31 β 0.1.33
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/bin/free-coding-models.js +13 -11
- package/lib/utils.js +22 -22
- package/package.json +1 -1
|
@@ -425,15 +425,18 @@ function renderTable(results, pendingPings, frame, cursor = null, sortColumn = '
|
|
|
425
425
|
const sweH = sortColumn === 'swe' ? dir + ' SWE%' : 'SWE%'
|
|
426
426
|
const pingH = sortColumn === 'ping' ? dir + ' Latest Ping' : 'Latest Ping'
|
|
427
427
|
const avgH = sortColumn === 'avg' ? dir + ' Avg Ping' : 'Avg Ping'
|
|
428
|
-
const
|
|
428
|
+
const conditionH = sortColumn === 'condition' ? dir + ' Condition' : 'Condition'
|
|
429
429
|
const verdictH = sortColumn === 'verdict' ? dir + ' Verdict' : 'Verdict'
|
|
430
430
|
const uptimeH = sortColumn === 'uptime' ? dir + ' Up%' : 'Up%'
|
|
431
431
|
|
|
432
432
|
// π Helper to colorize first letter for keyboard shortcuts
|
|
433
|
+
// π IMPORTANT: Pad PLAIN TEXT first, then apply colors to avoid alignment issues
|
|
433
434
|
const colorFirst = (text, width, colorFn = chalk.yellow) => {
|
|
434
435
|
const first = text[0]
|
|
435
436
|
const rest = text.slice(1)
|
|
436
|
-
|
|
437
|
+
const plainText = first + rest
|
|
438
|
+
const padding = ' '.repeat(Math.max(0, width - plainText.length))
|
|
439
|
+
return colorFn(first) + chalk.dim(rest + padding)
|
|
437
440
|
}
|
|
438
441
|
|
|
439
442
|
// π Now colorize after padding is calculated on plain text
|
|
@@ -442,14 +445,14 @@ function renderTable(results, pendingPings, frame, cursor = null, sortColumn = '
|
|
|
442
445
|
const originH_c = sortColumn === 'origin' ? chalk.bold.cyan(originH.padEnd(W_SOURCE)) : colorFirst(originH, W_SOURCE)
|
|
443
446
|
const modelH_c = colorFirst(modelH, W_MODEL)
|
|
444
447
|
const sweH_c = sortColumn === 'swe' ? chalk.bold.cyan(sweH.padEnd(W_SWE)) : colorFirst(sweH, W_SWE)
|
|
445
|
-
const pingH_c = sortColumn === 'ping' ? chalk.bold.cyan(pingH.padEnd(W_PING)) : colorFirst(
|
|
446
|
-
const avgH_c = sortColumn === 'avg' ? chalk.bold.cyan(avgH.padEnd(W_AVG)) : colorFirst(
|
|
447
|
-
const
|
|
448
|
+
const pingH_c = sortColumn === 'ping' ? chalk.bold.cyan(pingH.padEnd(W_PING)) : colorFirst('Latest Ping', W_PING)
|
|
449
|
+
const avgH_c = sortColumn === 'avg' ? chalk.bold.cyan(avgH.padEnd(W_AVG)) : colorFirst('Avg Ping', W_AVG)
|
|
450
|
+
const conditionH_c = sortColumn === 'condition' ? chalk.bold.cyan(conditionH.padEnd(W_STATUS)) : colorFirst('Condition', W_STATUS)
|
|
448
451
|
const verdictH_c = sortColumn === 'verdict' ? chalk.bold.cyan(verdictH.padEnd(W_VERDICT)) : colorFirst(verdictH, W_VERDICT)
|
|
449
452
|
const uptimeH_c = sortColumn === 'uptime' ? chalk.bold.cyan(uptimeH.padStart(W_UPTIME)) : colorFirst(uptimeH, W_UPTIME, chalk.green)
|
|
450
453
|
|
|
451
454
|
// π Header with proper spacing
|
|
452
|
-
lines.push(' ' + rankH_c + ' ' + tierH_c + ' ' + originH_c + ' ' + modelH_c + ' ' + sweH_c + ' ' + pingH_c + ' ' + avgH_c + ' ' +
|
|
455
|
+
lines.push(' ' + rankH_c + ' ' + tierH_c + ' ' + originH_c + ' ' + modelH_c + ' ' + sweH_c + ' ' + pingH_c + ' ' + avgH_c + ' ' + conditionH_c + ' ' + verdictH_c + ' ' + uptimeH_c)
|
|
453
456
|
|
|
454
457
|
// π Separator line
|
|
455
458
|
lines.push(
|
|
@@ -618,9 +621,9 @@ function renderTable(results, pendingPings, frame, cursor = null, sortColumn = '
|
|
|
618
621
|
: mode === 'opencode-desktop'
|
|
619
622
|
? chalk.rgb(0, 200, 255)('EnterβOpenDesktop')
|
|
620
623
|
: chalk.rgb(0, 200, 255)('EnterβOpenCode')
|
|
621
|
-
lines.push(chalk.dim(` ββ Navigate β’ `) + actionHint + chalk.dim(` β’ R/T/O/M/L/A/S/V/U
|
|
624
|
+
lines.push(chalk.dim(` ββ Navigate β’ `) + actionHint + chalk.dim(` β’ R/T/O/M/L/A/S/C/V/U Sort β’ Wβ/Xβ Interval (${intervalSec}s) β’ T Tier β’ Z Mode β’ Ctrl+C Exit`))
|
|
622
625
|
lines.push('')
|
|
623
|
-
lines.push(chalk.dim(' Made with ') + 'π' + chalk.dim(' by ') + '\x1b]8;;https://github.com/vava-nessa\x1b\\vava-nessa\x1b]8;;\x1b\\' + chalk.dim(' β’ ') + 'π¬ ' + chalk.cyanBright('\x1b]8;;https://discord.gg/WKA3TwYVuZ\x1b\\Join
|
|
626
|
+
lines.push(chalk.dim(' Made with ') + 'π & β' + chalk.dim(' by ') + '\x1b]8;;https://github.com/vava-nessa\x1b\\vava-nessa\x1b]8;;\x1b\\' + chalk.dim(' β’ ') + 'π¬ ' + chalk.cyanBright('\x1b]8;;https://discord.gg/WKA3TwYVuZ\x1b\\Join Free-Coding-Models Discord!\x1b]8;;\x1b\\') + chalk.dim(' β’ ') + 'β ' + '\x1b]8;;https://github.com/vava-nessa/free-coding-models\x1b\\Read the docs on GitHub\x1b]8;;\x1b\\')
|
|
624
627
|
lines.push('')
|
|
625
628
|
// π Append \x1b[K (erase to EOL) to each line so leftover chars from previous
|
|
626
629
|
// π frames are cleared. Then pad with blank cleared lines to fill the terminal,
|
|
@@ -1191,11 +1194,10 @@ async function main() {
|
|
|
1191
1194
|
const onKeyPress = async (str, key) => {
|
|
1192
1195
|
if (!key) return
|
|
1193
1196
|
|
|
1194
|
-
// π Sorting keys: R=rank, T=tier, O=origin, M=model, L=latest ping, A=avg ping, S=
|
|
1197
|
+
// π Sorting keys: R=rank, T=tier, O=origin, M=model, L=latest ping, A=avg ping, S=SWE-bench, C=condition, V=verdict, U=uptime
|
|
1195
1198
|
const sortKeys = {
|
|
1196
1199
|
'r': 'rank', 't': 'tier', 'o': 'origin', 'm': 'model',
|
|
1197
|
-
'l': 'ping', 'a': 'avg', 's': '
|
|
1198
|
-
'e': 'swe'
|
|
1200
|
+
'l': 'ping', 'a': 'avg', 's': 'swe', 'c': 'condition', 'v': 'verdict', 'u': 'uptime'
|
|
1199
1201
|
}
|
|
1200
1202
|
|
|
1201
1203
|
if (sortKeys[key.name]) {
|
package/lib/utils.js
CHANGED
|
@@ -129,16 +129,16 @@ export const getUptime = (r) => {
|
|
|
129
129
|
// π Returns a NEW array β never mutates the original (important for React-style re-renders).
|
|
130
130
|
//
|
|
131
131
|
// π Supported columns (matching the keyboard shortcuts in the TUI):
|
|
132
|
-
// - 'rank'
|
|
133
|
-
// - 'tier'
|
|
134
|
-
// - 'origin'
|
|
135
|
-
// - 'model'
|
|
136
|
-
// - 'ping'
|
|
137
|
-
// - 'avg'
|
|
138
|
-
// - '
|
|
139
|
-
// - '
|
|
140
|
-
// - '
|
|
141
|
-
// - '
|
|
132
|
+
// - 'rank' (R key) β original index from sources.js
|
|
133
|
+
// - 'tier' (T key) β tier hierarchy (S+ first, C last)
|
|
134
|
+
// - 'origin' (O key) β provider name (all NIM for now, future-proofed)
|
|
135
|
+
// - 'model' (M key) β alphabetical by display label
|
|
136
|
+
// - 'ping' (L key) β last ping latency (only successful ones count)
|
|
137
|
+
// - 'avg' (A key) β average latency across all successful pings
|
|
138
|
+
// - 'swe' (S key) β SWE-bench score (higher is better)
|
|
139
|
+
// - 'condition'(C key) β alphabetical condition string
|
|
140
|
+
// - 'verdict' (V key) β verdict order (Perfect β Pending)
|
|
141
|
+
// - 'uptime' (U key) β uptime percentage
|
|
142
142
|
//
|
|
143
143
|
// π sortDirection 'asc' = ascending (smallest first), 'desc' = descending (largest first)
|
|
144
144
|
export const sortResults = (results, sortColumn, sortDirection) => {
|
|
@@ -173,7 +173,18 @@ export const sortResults = (results, sortColumn, sortDirection) => {
|
|
|
173
173
|
case 'avg':
|
|
174
174
|
cmp = getAvg(a) - getAvg(b)
|
|
175
175
|
break
|
|
176
|
-
case '
|
|
176
|
+
case 'swe': {
|
|
177
|
+
// π Sort by SWE-bench score β higher is better
|
|
178
|
+
// π Parse percentage strings like "49.2%", "73.1%" or use 0 for missing values
|
|
179
|
+
const parseSwe = (score) => {
|
|
180
|
+
if (!score || score === 'β') return 0
|
|
181
|
+
const num = parseFloat(score.replace('%', ''))
|
|
182
|
+
return isNaN(num) ? 0 : num
|
|
183
|
+
}
|
|
184
|
+
cmp = parseSwe(a.sweScore) - parseSwe(b.sweScore)
|
|
185
|
+
break
|
|
186
|
+
}
|
|
187
|
+
case 'condition':
|
|
177
188
|
cmp = a.status.localeCompare(b.status)
|
|
178
189
|
break
|
|
179
190
|
case 'verdict': {
|
|
@@ -186,17 +197,6 @@ export const sortResults = (results, sortColumn, sortDirection) => {
|
|
|
186
197
|
case 'uptime':
|
|
187
198
|
cmp = getUptime(a) - getUptime(b)
|
|
188
199
|
break
|
|
189
|
-
case 'swe': {
|
|
190
|
-
// π Sort by SWE-bench score β higher is better
|
|
191
|
-
// π Parse percentage strings like "49.2%", "73.1%" or use 0 for missing values
|
|
192
|
-
const parseSwe = (score) => {
|
|
193
|
-
if (!score || score === 'β') return 0
|
|
194
|
-
const num = parseFloat(score.replace('%', ''))
|
|
195
|
-
return isNaN(num) ? 0 : num
|
|
196
|
-
}
|
|
197
|
-
cmp = parseSwe(a.sweScore) - parseSwe(b.sweScore)
|
|
198
|
-
break
|
|
199
|
-
}
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// π Flip comparison for descending order
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "free-coding-models",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Find the fastest coding LLM models in seconds β ping free models from multiple providers, pick the best one for OpenCode, Cursor, or any AI coding assistant.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nvidia",
|