free-coding-models 0.1.81 → 0.1.83
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 -40
- package/bin/free-coding-models.js +692 -69
- package/lib/account-manager.js +600 -0
- package/lib/config.js +122 -0
- package/lib/error-classifier.js +154 -0
- package/lib/log-reader.js +174 -0
- package/lib/model-merger.js +78 -0
- package/lib/opencode-sync.js +159 -0
- package/lib/provider-quota-fetchers.js +319 -0
- package/lib/proxy-server.js +543 -0
- package/lib/quota-capabilities.js +79 -0
- package/lib/request-transformer.js +180 -0
- package/lib/token-stats.js +242 -0
- package/lib/usage-reader.js +203 -0
- package/lib/utils.js +55 -0
- package/package.json +1 -1
- package/sources.js +4 -3
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 percentage for each model directly in the TUI; persists across sessions via `token-stats.json`.
|
|
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
|
|
@@ -454,16 +460,17 @@ The main table displays one row per model with the following columns:
|
|
|
454
460
|
|--------|----------|-------------|
|
|
455
461
|
| **Rank** | `R` | Position based on current sort order (medals for top 3: 🥇🥈🥉) |
|
|
456
462
|
| **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
|
|
463
|
+
| **SWE%** | `S` | SWE-bench Verified score — industry-standard for coding |
|
|
464
|
+
| **CTX** | `C` | Context window size (e.g. `128k`) |
|
|
459
465
|
| **Model** | `M` | Model display name (favorites show ⭐ prefix) |
|
|
460
|
-
| **Origin** | `
|
|
466
|
+
| **Origin** | `O` | Provider name (NIM, Groq, etc.) — press `N` to cycle origin filter |
|
|
461
467
|
| **Latest Ping** | `L` | Most recent round-trip latency in milliseconds |
|
|
462
468
|
| **Avg Ping** | `A` | Rolling average of ALL successful pings since launch |
|
|
463
469
|
| **Health** | `H` | Current status: UP ✅, NO KEY 🔑, Timeout ⏳, Overloaded 🔥, Not Found 🚫 |
|
|
464
|
-
| **Verdict** | `V` | Health verdict based on avg latency + stability analysis
|
|
470
|
+
| **Verdict** | `V` | Health verdict based on avg latency + stability analysis |
|
|
465
471
|
| **Stability** | `B` | Composite 0–100 consistency score (see [Stability Score](#-stability-score)) |
|
|
466
|
-
| **Up%** | `U` | Uptime — percentage of successful pings
|
|
472
|
+
| **Up%** | `U` | Uptime — percentage of successful pings |
|
|
473
|
+
| **Usage** | `G` | Quota remaining — percentage of available tokens/requests left |
|
|
467
474
|
|
|
468
475
|
### Verdict values
|
|
469
476
|
|
|
@@ -507,28 +514,33 @@ Stability = 0.30 × p95_score
|
|
|
507
514
|
| **Spike rate** | 20% | Fraction of pings above 3000ms | `100 × (1 - spikes / total_pings)` |
|
|
508
515
|
| **Reliability** | 20% | Uptime — fraction of successful HTTP 200 pings | Direct uptime percentage (0–100) |
|
|
509
516
|
|
|
510
|
-
|
|
517
|
+
---
|
|
511
518
|
|
|
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) |
|
|
519
|
+
## 🔀 Multi-Account Proxy (`fcm-proxy`)
|
|
519
520
|
|
|
520
|
-
|
|
521
|
+
`free-coding-models` includes a built-in reverse proxy that can group all your provider accounts into a single virtual provider.
|
|
521
522
|
|
|
522
|
-
|
|
523
|
+
### Why use the proxy?
|
|
524
|
+
- **Unified Provider**: Instead of managing 20+ providers in your coding assistant, just use `fcm-proxy`.
|
|
525
|
+
- **Automatic Rotation**: When one account hits its rate limit (429), the proxy automatically swaps to the next available account for that model.
|
|
526
|
+
- **Quota Awareness**: The proxy tracks usage in real-time and prioritizes accounts with the most remaining bandwidth.
|
|
527
|
+
- **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
528
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
529
|
+
### How to use it
|
|
530
|
+
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.
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
## 📜 Log Viewer
|
|
535
|
+
|
|
536
|
+
Press **`X`** at any time to open the dedicated Log Viewer overlay.
|
|
528
537
|
|
|
529
|
-
|
|
538
|
+
- **Real-time Activity**: See every ping, rotation, and proxy request as it happens.
|
|
539
|
+
- **Error Diagnostics**: View detailed error messages from providers when a ping fails.
|
|
540
|
+
- **Quota Tracking**: Monitor how the tool discovers and updates your remaining quota.
|
|
541
|
+
- **Auto-Pruning**: The log history is automatically managed to stay concise and relevant.
|
|
530
542
|
|
|
531
|
-
|
|
543
|
+
Use **↑↓** to scroll and **Esc** or **X** to return to the main table.
|
|
532
544
|
|
|
533
545
|
---
|
|
534
546
|
|
|
@@ -824,19 +836,20 @@ This script:
|
|
|
824
836
|
**Keyboard shortcuts (main TUI):**
|
|
825
837
|
- **↑↓** — Navigate models
|
|
826
838
|
- **Enter** — Select model (launches OpenCode or sets OpenClaw default, depending on mode)
|
|
827
|
-
- **R/Y/
|
|
839
|
+
- **R/Y/S/C/M/O/L/A/H/V/B/U/G** — Sort by Rank/Tier/SWE/Ctx/Model/Origin/Latest/Avg/Health/Verdict/Stability/Up%/Usage
|
|
828
840
|
- **F** — Toggle favorite on selected model (⭐ in Model column, pinned at top)
|
|
829
841
|
- **T** — Cycle tier filter (All → S+ → S → A+ → A → A- → B+ → B → C → All)
|
|
842
|
+
- **N** — Cycle origin filter (All → NIM → Groq → ...)
|
|
830
843
|
- **Z** — Cycle mode (OpenCode CLI → OpenCode Desktop → OpenClaw)
|
|
831
|
-
|
|
844
|
+
- **X** — **Toggle Log Viewer** (view recent activity and error logs)
|
|
845
|
+
- **P** — Open Settings (manage API keys, toggles, updates, profiles)
|
|
832
846
|
- **Shift+P** — Cycle through saved profiles (switches live TUI settings)
|
|
833
847
|
- **Shift+S** — Save current TUI settings as a named profile (inline prompt)
|
|
834
848
|
- **Q** — Open Smart Recommend overlay (find the best model for your task)
|
|
835
|
-
- **E** — Elevate tier filter
|
|
836
|
-
- **
|
|
837
|
-
- **
|
|
838
|
-
- **
|
|
839
|
-
- **K** / **Esc** — Show/hide help overlay
|
|
849
|
+
- **E / D** — Elevate / Descend tier filter
|
|
850
|
+
- **W / =** — Decrease / Increase ping interval
|
|
851
|
+
- **J / I** — Request feature / Report bug
|
|
852
|
+
- **K / Esc** — Show help overlay / Close overlay
|
|
840
853
|
- **Ctrl+C** — Exit
|
|
841
854
|
|
|
842
855
|
Pressing **K** now shows a full in-app reference: main hotkeys, settings hotkeys, and CLI flags with usage examples.
|