free-coding-models 0.1.82 → 0.1.84
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 +53 -51
- package/bin/free-coding-models.js +429 -4276
- package/package.json +2 -2
- package/sources.js +3 -2
- package/src/account-manager.js +600 -0
- package/src/analysis.js +197 -0
- package/{lib → src}/config.js +122 -0
- package/src/constants.js +116 -0
- package/src/error-classifier.js +154 -0
- package/src/favorites.js +98 -0
- package/src/key-handler.js +1005 -0
- package/src/log-reader.js +174 -0
- package/src/model-merger.js +78 -0
- package/src/openclaw.js +131 -0
- package/src/opencode-sync.js +159 -0
- package/src/opencode.js +952 -0
- package/src/overlays.js +840 -0
- package/src/ping.js +186 -0
- package/src/provider-metadata.js +218 -0
- package/src/provider-quota-fetchers.js +319 -0
- package/src/proxy-server.js +543 -0
- package/src/quota-capabilities.js +112 -0
- package/src/render-helpers.js +239 -0
- package/src/render-table.js +567 -0
- package/src/request-transformer.js +180 -0
- package/src/setup.js +105 -0
- package/src/telemetry.js +382 -0
- package/src/tier-colors.js +37 -0
- package/src/token-stats.js +310 -0
- package/src/token-usage-reader.js +63 -0
- package/src/updater.js +237 -0
- package/src/usage-reader.js +245 -0
- package/{lib → src}/utils.js +55 -0
package/README.md
CHANGED
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
<a href="https://github.com/erwinh22"><img src="https://avatars.githubusercontent.com/u/6641858?v=4&s=60" width="60" height="60" style="border-radius:50%" alt="erwinh22"></a>
|
|
15
15
|
<a href="https://github.com/whit3rabbit"><img src="https://avatars.githubusercontent.com/u/12357518?v=4&s=60" width="60" height="60" style="border-radius:50%" alt="whit3rabbit"></a>
|
|
16
16
|
<a href="https://github.com/skylaweber"><img src="https://avatars.githubusercontent.com/u/172871734?v=4&s=60" width="60" height="60" style="border-radius:50%" alt="skylaweber"></a>
|
|
17
|
+
<a href="https://github.com/PhucTruong-ctrl"><img src="https://github.com/PhucTruong-ctrl.png?s=60" width="60" height="60" style="border-radius:50%" alt="PhucTruong-ctrl"></a>
|
|
17
18
|
<br>
|
|
18
19
|
<sub>
|
|
19
20
|
<a href="https://github.com/vava-nessa">vava-nessa</a> ·
|
|
20
21
|
<a href="https://github.com/erwinh22">erwinh22</a> ·
|
|
21
22
|
<a href="https://github.com/whit3rabbit">whit3rabbit</a> ·
|
|
22
|
-
<a href="https://github.com/skylaweber">skylaweber</a>
|
|
23
|
+
<a href="https://github.com/skylaweber">skylaweber</a> ·
|
|
24
|
+
<a href="https://github.com/PhucTruong-ctrl">PhucTruong-ctrl</a>
|
|
23
25
|
</sub>
|
|
24
26
|
</p>
|
|
25
27
|
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
|
|
40
42
|
<p align="center">
|
|
41
43
|
<strong>Find the fastest coding LLM models in seconds</strong><br>
|
|
42
|
-
<sub>Ping free coding models from
|
|
44
|
+
<sub>Ping free coding models from 20 providers in real-time — pick the best one for OpenCode, OpenClaw, or any AI coding assistant</sub>
|
|
43
45
|
</p>
|
|
44
46
|
|
|
45
47
|
<p align="center">
|
|
@@ -64,27 +66,31 @@
|
|
|
64
66
|
## ✨ Features
|
|
65
67
|
|
|
66
68
|
- **🎯 Coding-focused** — Only LLM models optimized for code generation, not chat or vision
|
|
67
|
-
- **🌐 Multi-provider** — Models from NVIDIA NIM, Groq, Cerebras, SambaNova, OpenRouter, Hugging Face Inference, Replicate, DeepInfra, Fireworks AI, Codestral, Hyperbolic, Scaleway, Google AI, SiliconFlow, Together AI, Cloudflare Workers AI, Perplexity API, Alibaba Cloud (DashScope), and
|
|
69
|
+
- **🌐 Multi-provider** — Models from NVIDIA NIM, Groq, Cerebras, SambaNova, OpenRouter, Hugging Face Inference, Replicate, DeepInfra, Fireworks AI, Codestral, Hyperbolic, Scaleway, Google AI, SiliconFlow, Together AI, Cloudflare Workers AI, Perplexity API, Alibaba Cloud (DashScope), ZAI, and iFlow
|
|
68
70
|
- **⚙️ Settings screen** — Press `P` to manage provider API keys, enable/disable providers, test keys live, and manually check/install updates
|
|
71
|
+
- **🔀 Multi-account Proxy (`fcm-proxy`)** — Automatically starts a local reverse proxy that groups all your accounts into a single provider in OpenCode; supports multi-account rotation and auto-detects usage limits to swap between providers.
|
|
69
72
|
- **🚀 Parallel pings** — All models tested simultaneously via native `fetch`
|
|
70
73
|
- **📊 Real-time animation** — Watch latency appear live in alternate screen buffer
|
|
71
74
|
- **🏆 Smart ranking** — Top 3 fastest models highlighted with medals 🥇🥈🥉
|
|
72
75
|
- **⏱ Continuous monitoring** — Pings all models every 3 seconds forever, never stops
|
|
73
76
|
- **📈 Rolling averages** — Avg calculated from ALL successful pings since start
|
|
74
77
|
- **📊 Uptime tracking** — Percentage of successful pings shown in real-time
|
|
75
|
-
- **📐 Stability score** — Composite 0–100 score measuring consistency (p95, jitter, spikes, uptime)
|
|
78
|
+
- **📐 Stability score** — Composite 0–100 score measuring consistency (p95, jitter, spikes, uptime)
|
|
79
|
+
- **📊 Usage tracking** — Monitor remaining quota for each exact provider/model pair when the provider exposes it; otherwise the TUI shows a green dot instead of a misleading percentage.
|
|
80
|
+
- **📜 Live Log Viewer** — Press `X` to view real-time activity and error logs in a focused TUI overlay.
|
|
81
|
+
- **🛠 MODEL_NOT_FOUND Rotation** — If a specific provider returns a 404 for a model, the TUI intelligently rotates through other available providers for the same model.
|
|
76
82
|
- **🔄 Auto-retry** — Timeout models keep getting retried, nothing is ever "given up on"
|
|
77
83
|
- **🎮 Interactive selection** — Navigate with arrow keys directly in the table, press Enter to act
|
|
78
84
|
- **🔀 Startup mode menu** — Choose between OpenCode and OpenClaw before the TUI launches
|
|
79
85
|
- **💻 OpenCode integration** — Auto-detects NIM setup, sets model as default, launches OpenCode
|
|
80
86
|
- **🦞 OpenClaw integration** — Sets selected model as default provider in `~/.openclaw/openclaw.json`
|
|
81
|
-
- **📝 Feature Request (J key)** — Send anonymous feedback directly to the project team
|
|
82
|
-
- **🐛 Bug Report (I key)** — Send anonymous bug reports directly to the project team
|
|
87
|
+
- **📝 Feature Request (J key)** — Send anonymous feedback directly to the project team
|
|
88
|
+
- **🐛 Bug Report (I key)** — Send anonymous bug reports directly to the project team
|
|
83
89
|
- **🎨 Clean output** — Zero scrollback pollution, interface stays open until Ctrl+C
|
|
84
90
|
- **📶 Status indicators** — UP ✅ · No Key 🔑 · Timeout ⏳ · Overloaded 🔥 · Not Found 🚫
|
|
85
|
-
- **🔍 Keyless latency** — Models are pinged even without an API key
|
|
86
|
-
- **🏷 Tier filtering** — Filter models by tier letter (S, A, B, C)
|
|
87
|
-
- **⭐ Persistent favorites** — Press `F` on a selected row to pin/unpin it
|
|
91
|
+
- **🔍 Keyless latency** — Models are pinged even without an API key
|
|
92
|
+
- **🏷 Tier filtering** — Filter models by tier letter (S, A, B, C)
|
|
93
|
+
- **⭐ Persistent favorites** — Press `F` on a selected row to pin/unpin it
|
|
88
94
|
|
|
89
95
|
---
|
|
90
96
|
|
|
@@ -115,7 +121,7 @@ Before using `free-coding-models`, make sure you have:
|
|
|
115
121
|
3. **OpenCode** *(optional)* — [Install OpenCode](https://github.com/opencode-ai/opencode) to use the OpenCode integration
|
|
116
122
|
4. **OpenClaw** *(optional)* — [Install OpenClaw](https://openclaw.ai) to use the OpenClaw integration
|
|
117
123
|
|
|
118
|
-
> 💡 **Tip:** You don't need all
|
|
124
|
+
> 💡 **Tip:** You don't need all twenty providers. One key is enough to get started. Add more later via the Settings screen (`P` key). Models without a key still show real latency (`🔑 NO KEY`) so you can evaluate providers before signing up.
|
|
119
125
|
|
|
120
126
|
---
|
|
121
127
|
|
|
@@ -193,13 +199,13 @@ When you run `free-coding-models` without `--opencode` or `--openclaw`, you get
|
|
|
193
199
|
Use `↑↓` arrows to select, `Enter` to confirm. Then the TUI launches with your chosen mode shown in the header badge.
|
|
194
200
|
|
|
195
201
|
**How it works:**
|
|
196
|
-
1. **Ping phase** — All enabled models are pinged in parallel (up to 150 across
|
|
202
|
+
1. **Ping phase** — All enabled models are pinged in parallel (up to 150 across 20 providers)
|
|
197
203
|
2. **Continuous monitoring** — Models are re-pinged every 3 seconds forever
|
|
198
204
|
3. **Real-time updates** — Watch "Latest", "Avg", and "Up%" columns update live
|
|
199
205
|
4. **Select anytime** — Use ↑↓ arrows to navigate, press Enter on a model to act
|
|
200
206
|
5. **Smart detection** — Automatically detects if NVIDIA NIM is configured in OpenCode or OpenClaw
|
|
201
207
|
|
|
202
|
-
Setup wizard (first run — walks through all
|
|
208
|
+
Setup wizard (first run — walks through all 20 providers):
|
|
203
209
|
|
|
204
210
|
```
|
|
205
211
|
🔑 First-time setup — API keys
|
|
@@ -435,17 +441,6 @@ free-coding-models --tier B # Only B+, B (lightweight options)
|
|
|
435
441
|
free-coding-models --tier C # Only C (edge/minimal models)
|
|
436
442
|
```
|
|
437
443
|
|
|
438
|
-
#### Dynamic tier filtering with E/D keys
|
|
439
|
-
|
|
440
|
-
During runtime, use **E** and **D** keys to dynamically adjust the tier filter:
|
|
441
|
-
|
|
442
|
-
- **E** (Elevate) — Show fewer, higher-tier models (cycle: All → S → A → B → C → All)
|
|
443
|
-
- **D** (Descend) — Show more, lower-tier models (cycle: All → C → B → A → S → All)
|
|
444
|
-
|
|
445
|
-
Current tier filter is shown in the header badge (e.g., `[Tier S]`)
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
|
|
449
444
|
## 📊 TUI Columns
|
|
450
445
|
|
|
451
446
|
The main table displays one row per model with the following columns:
|
|
@@ -454,16 +449,18 @@ The main table displays one row per model with the following columns:
|
|
|
454
449
|
|--------|----------|-------------|
|
|
455
450
|
| **Rank** | `R` | Position based on current sort order (medals for top 3: 🥇🥈🥉) |
|
|
456
451
|
| **Tier** | `Y` | SWE-bench tier (S+, S, A+, A, A-, B+, B, C) |
|
|
457
|
-
| **SWE%** | `S` | SWE-bench Verified score —
|
|
458
|
-
| **CTX** | `C` | Context window size
|
|
452
|
+
| **SWE%** | `S` | SWE-bench Verified score — industry-standard for coding |
|
|
453
|
+
| **CTX** | `C` | Context window size (e.g. `128k`) |
|
|
459
454
|
| **Model** | `M` | Model display name (favorites show ⭐ prefix) |
|
|
460
|
-
| **
|
|
455
|
+
| **Provider** | `O` | Provider name (NIM, Groq, etc.) — press `D` to cycle provider filter |
|
|
461
456
|
| **Latest Ping** | `L` | Most recent round-trip latency in milliseconds |
|
|
462
457
|
| **Avg Ping** | `A` | Rolling average of ALL successful pings since launch |
|
|
463
458
|
| **Health** | `H` | Current status: UP ✅, NO KEY 🔑, Timeout ⏳, Overloaded 🔥, Not Found 🚫 |
|
|
464
|
-
| **Verdict** | `V` | Health verdict based on avg latency + stability analysis
|
|
459
|
+
| **Verdict** | `V` | Health verdict based on avg latency + stability analysis |
|
|
465
460
|
| **Stability** | `B` | Composite 0–100 consistency score (see [Stability Score](#-stability-score)) |
|
|
466
|
-
| **Up%** | `U` | Uptime — percentage of successful pings
|
|
461
|
+
| **Up%** | `U` | Uptime — percentage of successful pings |
|
|
462
|
+
| **Used** | — | Total prompt+completion tokens consumed in logs for this exact provider/model pair, shown in `k` or `M` |
|
|
463
|
+
| **Usage** | `G` | Provider-scoped quota remaining when measurable; otherwise a green dot means usage % is not applicable/reliable for that provider |
|
|
467
464
|
|
|
468
465
|
### Verdict values
|
|
469
466
|
|
|
@@ -507,28 +504,33 @@ Stability = 0.30 × p95_score
|
|
|
507
504
|
| **Spike rate** | 20% | Fraction of pings above 3000ms | `100 × (1 - spikes / total_pings)` |
|
|
508
505
|
| **Reliability** | 20% | Uptime — fraction of successful HTTP 200 pings | Direct uptime percentage (0–100) |
|
|
509
506
|
|
|
510
|
-
|
|
507
|
+
---
|
|
511
508
|
|
|
512
|
-
|
|
513
|
-
|-------|-------|----------------|
|
|
514
|
-
| **80–100** | Green | Rock-solid — very consistent, safe to rely on |
|
|
515
|
-
| **60–79** | Cyan | Good — occasional variance but generally stable |
|
|
516
|
-
| **40–59** | Yellow | Shaky — noticeable inconsistency |
|
|
517
|
-
| **< 40** | Red | Unreliable — frequent spikes or failures |
|
|
518
|
-
| **—** | Dim | No data yet (no successful pings) |
|
|
509
|
+
## 🔀 Multi-Account Proxy (`fcm-proxy`)
|
|
519
510
|
|
|
520
|
-
|
|
511
|
+
`free-coding-models` includes a built-in reverse proxy that can group all your provider accounts into a single virtual provider.
|
|
521
512
|
|
|
522
|
-
|
|
513
|
+
### Why use the proxy?
|
|
514
|
+
- **Unified Provider**: Instead of managing 20+ providers in your coding assistant, just use `fcm-proxy`.
|
|
515
|
+
- **Automatic Rotation**: When one account hits its rate limit (429), the proxy automatically swaps to the next available account for that model.
|
|
516
|
+
- **Quota Awareness**: The proxy tracks usage in real-time and prioritizes accounts with the most remaining bandwidth.
|
|
517
|
+
- **Transparent Bridging**: Automatically handles non-standard API paths (like ZAI's `/api/coding/paas/v4/`) and converts them to standard OpenAI-compatible `/v1/` calls.
|
|
523
518
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
519
|
+
### How to use it
|
|
520
|
+
The proxy starts automatically when you select a model in OpenCode mode if you have `fcm-proxy` configured. You can see its status (port and active account count) in the TUI footer.
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## 📜 Log Viewer
|
|
525
|
+
|
|
526
|
+
Press **`X`** at any time to open the dedicated Log Viewer overlay.
|
|
528
527
|
|
|
529
|
-
|
|
528
|
+
- **Real-time Activity**: See every ping, rotation, and proxy request as it happens.
|
|
529
|
+
- **Error Diagnostics**: View detailed error messages from providers when a ping fails.
|
|
530
|
+
- **Quota Tracking**: Monitor how the tool discovers and updates your remaining quota.
|
|
531
|
+
- **Auto-Pruning**: The log history is automatically managed to stay concise and relevant.
|
|
530
532
|
|
|
531
|
-
|
|
533
|
+
Use **↑↓** to scroll and **Esc** or **X** to return to the main table.
|
|
532
534
|
|
|
533
535
|
---
|
|
534
536
|
|
|
@@ -824,19 +826,19 @@ This script:
|
|
|
824
826
|
**Keyboard shortcuts (main TUI):**
|
|
825
827
|
- **↑↓** — Navigate models
|
|
826
828
|
- **Enter** — Select model (launches OpenCode or sets OpenClaw default, depending on mode)
|
|
827
|
-
- **R/Y/
|
|
829
|
+
- **R/Y/S/C/M/O/L/A/H/V/B/U/G** — Sort by Rank/Tier/SWE/Ctx/Model/Provider/Latest/Avg/Health/Verdict/Stability/Up%/Usage
|
|
828
830
|
- **F** — Toggle favorite on selected model (⭐ in Model column, pinned at top)
|
|
829
831
|
- **T** — Cycle tier filter (All → S+ → S → A+ → A → A- → B+ → B → C → All)
|
|
832
|
+
- **D** — Cycle provider filter (All → NIM → Groq → ...)
|
|
830
833
|
- **Z** — Cycle mode (OpenCode CLI → OpenCode Desktop → OpenClaw)
|
|
831
|
-
|
|
834
|
+
- **X** — **Toggle Log Viewer** (view recent activity and error logs)
|
|
835
|
+
- **P** — Open Settings (manage API keys, toggles, updates, profiles)
|
|
832
836
|
- **Shift+P** — Cycle through saved profiles (switches live TUI settings)
|
|
833
837
|
- **Shift+S** — Save current TUI settings as a named profile (inline prompt)
|
|
834
838
|
- **Q** — Open Smart Recommend overlay (find the best model for your task)
|
|
835
|
-
- **
|
|
836
|
-
- **
|
|
837
|
-
- **
|
|
838
|
-
- **X** — Increase ping interval (slower pings)
|
|
839
|
-
- **K** / **Esc** — Show/hide help overlay
|
|
839
|
+
- **W / =** — Decrease / Increase ping interval
|
|
840
|
+
- **J / I** — Request feature / Report bug
|
|
841
|
+
- **K / Esc** — Show help overlay / Close overlay
|
|
840
842
|
- **Ctrl+C** — Exit
|
|
841
843
|
|
|
842
844
|
Pressing **K** now shows a full in-app reference: main hotkeys, settings hotkeys, and CLI flags with usage examples.
|