free-coding-models 0.3.11 → 0.3.13
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/CHANGELOG.md +24 -0
- package/README.md +112 -1134
- package/bin/free-coding-models.js +18 -170
- package/package.json +2 -3
- package/src/cli-help.js +0 -18
- package/src/config.js +5 -117
- package/src/endpoint-installer.js +26 -64
- package/src/key-handler.js +90 -443
- package/src/legacy-proxy-cleanup.js +432 -0
- package/src/openclaw.js +69 -108
- package/src/opencode-config.js +48 -0
- package/src/opencode.js +6 -248
- package/src/overlays.js +28 -520
- package/src/product-flags.js +14 -0
- package/src/render-helpers.js +2 -34
- package/src/render-table.js +11 -19
- package/src/testfcm.js +90 -43
- package/src/token-usage-reader.js +9 -38
- package/src/tool-launchers.js +235 -409
- package/src/tool-metadata.js +0 -7
- package/src/utils.js +3 -68
- package/bin/fcm-proxy-daemon.js +0 -242
- package/src/account-manager.js +0 -634
- package/src/anthropic-translator.js +0 -440
- package/src/daemon-manager.js +0 -527
- package/src/error-classifier.js +0 -157
- package/src/log-reader.js +0 -195
- package/src/opencode-sync.js +0 -200
- package/src/proxy-foreground.js +0 -234
- package/src/proxy-server.js +0 -1506
- package/src/proxy-sync.js +0 -591
- package/src/proxy-topology.js +0 -85
- package/src/request-transformer.js +0 -180
- package/src/responses-translator.js +0 -423
- package/src/token-stats.js +0 -320
package/README.md
CHANGED
|
@@ -1,1206 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
<img src="https://img.shields.io/npm/v/free-coding-models?color=76b900&label=npm&logo=npm" alt="npm version">
|
|
3
|
-
<img src="https://img.shields.io/node/v/free-coding-models?color=76b900&logo=node.js" alt="node version">
|
|
4
|
-
<img src="https://img.shields.io/npm/l/free-coding-models?color=76b900" alt="license">
|
|
5
|
-
<img src="https://img.shields.io/badge/models-160-76b900?logo=nvidia" alt="models count">
|
|
6
|
-
<img src="https://img.shields.io/badge/providers-20-blue" alt="providers count">
|
|
7
|
-
</p>
|
|
1
|
+
# free-coding-models
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
`free-coding-models` is a terminal UI to compare free coding models across providers, monitor live health/latency, and launch supported coding tools with the selected model.
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
<strong>Contributors</strong><br>
|
|
13
|
-
<a href="https://github.com/vava-nessa"><img src="https://avatars.githubusercontent.com/u/5466264?v=4&s=60" width="60" height="60" style="border-radius:50%" alt="vava-nessa"></a>
|
|
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
|
-
<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
|
-
<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>
|
|
18
|
-
<br>
|
|
19
|
-
<sub>
|
|
20
|
-
<a href="https://github.com/vava-nessa">vava-nessa</a> ·
|
|
21
|
-
<a href="https://github.com/erwinh22">erwinh22</a> ·
|
|
22
|
-
<a href="https://github.com/whit3rabbit">whit3rabbit</a> ·
|
|
23
|
-
<a href="https://github.com/skylaweber">skylaweber</a> ·
|
|
24
|
-
<a href="https://github.com/PhucTruong-ctrl">PhucTruong-ctrl</a>
|
|
25
|
-
</sub>
|
|
26
|
-
</p>
|
|
5
|
+
It is built around direct provider integrations. The old global proxy bridge has been removed from the product and is being rewritten from scratch, so only the stable direct-launch workflow is exposed for now.
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
💬 <a href="https://discord.gg/ZTNFHvvCkU">Let's talk about the project on Discord</a>
|
|
30
|
-
</p>
|
|
7
|
+
## Install
|
|
31
8
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
1. Create a free API key (NVIDIA, OpenRouter, Hugging Face, etc.)
|
|
38
|
-
2. npm i -g free-coding-models
|
|
39
|
-
3. free-coding-models
|
|
9
|
+
```bash
|
|
10
|
+
pnpm install
|
|
11
|
+
pnpm start
|
|
40
12
|
```
|
|
41
13
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<p align="center">
|
|
45
|
-
<strong>Find the fastest coding LLM models in seconds</strong><br>
|
|
46
|
-
<sub>Ping free coding models from 20 providers in real-time — pick the best one for OpenCode, OpenClaw, or any AI coding assistant</sub>
|
|
47
|
-
</p>
|
|
48
|
-
|
|
49
|
-
> ⚠️ **Beta notice**
|
|
50
|
-
> FCM Proxy V2 support for external tools is still in beta. Claude Code, Codex, Gemini, and the other proxy-backed launchers already work in many setups, but auth and startup edge cases can still fail while the integration stabilizes.
|
|
51
|
-
|
|
52
|
-
<p align="center">
|
|
53
|
-
<img src="demo.gif" alt="free-coding-models demo" width="100%">
|
|
54
|
-
</p>
|
|
55
|
-
|
|
56
|
-
<p align="center">
|
|
57
|
-
<a href="#-features">Features</a> •
|
|
58
|
-
<a href="#-requirements">Requirements</a> •
|
|
59
|
-
<a href="#-installation">Installation</a> •
|
|
60
|
-
<a href="#-usage">Usage</a> •
|
|
61
|
-
<a href="#-tui-columns">Columns</a> •
|
|
62
|
-
<a href="#-stability-score">Stability</a> •
|
|
63
|
-
<a href="#-coding-models">Models</a> •
|
|
64
|
-
<a href="#-opencode-integration">OpenCode</a> •
|
|
65
|
-
<a href="#-openclaw-integration">OpenClaw</a> •
|
|
66
|
-
<a href="#-how-it-works">How it works</a>
|
|
67
|
-
</p>
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## ✨ Features
|
|
72
|
-
|
|
73
|
-
- **🎯 Coding-focused** — Only LLM models optimized for code generation, not chat or vision
|
|
74
|
-
- **🌐 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
|
|
75
|
-
- **⚙️ Settings screen** — Press `P` to manage provider API keys, enable/disable providers, access FCM Proxy V2 settings, and check/install updates
|
|
76
|
-
- **📡 FCM Proxy V2** — Built-in reverse proxy with multi-key rotation, rate-limit failover, and Anthropic wire format translation for Claude Code. Optional always-on background service (`launchd`/`systemd`) keeps the proxy running 24/7 — even without the TUI. Dedicated overlay with full status, restart, stop, force-kill, and log viewer.
|
|
77
|
-
- **🚀 Parallel pings** — All models tested simultaneously via native `fetch`
|
|
78
|
-
- **📊 Real-time animation** — Watch latency appear live in alternate screen buffer
|
|
79
|
-
- **🏆 Smart ranking** — Top 3 fastest models highlighted with medals 🥇🥈🥉
|
|
80
|
-
- **⏱ Adaptive monitoring** — Starts in a fast 2s cadence for 60s, settles to 10s, slows to 30s after 5 minutes idle, and supports a forced 4s mode
|
|
81
|
-
- **📈 Rolling averages** — Avg calculated from ALL successful pings since start
|
|
82
|
-
- **📊 Uptime tracking** — Percentage of successful pings shown in real-time
|
|
83
|
-
- **📐 Stability score** — Composite 0–100 score measuring consistency (p95, jitter, spikes, uptime)
|
|
84
|
-
- **📊 Token usage tracking** — The proxy logs prompt+completion token usage per exact provider/model pair, and the TUI surfaces that history in the `Used` column and the request log overlay.
|
|
85
|
-
- **📜 Request Log Overlay** — Press `X` to inspect recent proxied requests and token usage for exact provider/model pairs.
|
|
86
|
-
- **📋 Changelog Overlay** — Press `N` to browse all versions in an index, then `Enter` to view details for any version with full scroll support
|
|
87
|
-
- **🧪 AI end-to-end workflow** — Run the repo-local `/testfcm` flow to drive the TUI in a PTY, launch one tool, send `hi`, and generate a Markdown bug report plus raw artifacts under `task/`
|
|
88
|
-
- **🛠 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.
|
|
89
|
-
- **🔄 Auto-retry** — Timeout models keep getting retried, nothing is ever "given up on"
|
|
90
|
-
- **🎮 Interactive selection** — Navigate with arrow keys directly in the table, press Enter to act
|
|
91
|
-
- **💻 OpenCode integration** — Auto-detects NIM setup, sets model as default, launches OpenCode
|
|
92
|
-
- **🦞 OpenClaw integration** — Sets selected model as default provider in `~/.openclaw/openclaw.json`
|
|
93
|
-
- **🧰 Public tool launchers** — `Enter` auto-configures and launches all 13 tool modes: `OpenCode CLI`, `OpenCode Desktop`, `OpenClaw`, `Crush`, `Goose`, `Aider`, `Claude Code`, `Codex`, `Gemini`, `Qwen`, `OpenHands`, `Amp`, and `Pi`. All tools auto-select the chosen model on launch.
|
|
94
|
-
- **🔌 Install Endpoints flow** — Press `Y` to install one configured provider into the compatible persisted-config tools, with a choice between **Direct Provider** (pure API) or **FCM Proxy V2** (key rotation + usage tracking), then pick all models or a curated subset
|
|
95
|
-
- **📝 Feature Request (J key)** — Send anonymous feedback directly to the project team
|
|
96
|
-
- **🐛 Bug Report (I key)** — Send anonymous bug reports directly to the project team
|
|
97
|
-
- **🎨 Clean output** — Zero scrollback pollution, interface stays open until Ctrl+C
|
|
98
|
-
- **📶 Status indicators** — UP ✅ · No Key 🔑 · Timeout ⏳ · Overloaded 🔥 · Not Found 🚫
|
|
99
|
-
- **🔍 Keyless latency** — Models are pinged even without an API key
|
|
100
|
-
- **🏷 Tier filtering** — Filter models by tier letter (S, A, B, C)
|
|
101
|
-
- **⭐ Persistent favorites** — Press `F` on a selected row to pin/unpin it
|
|
102
|
-
- **🙈 Configured-only by default** — Press `E` to toggle showing only providers with configured API keys; the choice persists across sessions and profiles
|
|
103
|
-
- **🪟 Width guardrail** — If your terminal is too narrow, the TUI shows a centered warning instead of rendering a broken table
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## 📋 Requirements
|
|
108
|
-
|
|
109
|
-
Before using `free-coding-models`, make sure you have:
|
|
110
|
-
|
|
111
|
-
1. **Node.js 18+** — Required for native `fetch` API
|
|
112
|
-
2. **At least one free API key** — pick any or all of:
|
|
113
|
-
- **NVIDIA NIM** — [build.nvidia.com](https://build.nvidia.com) → Profile → API Keys → Generate – free tier: 40 req/min (no credit card)
|
|
114
|
-
- **Groq** — [console.groq.com/keys](https://console.groq.com/keys) → Create API Key – free tier: 30‑50 RPM per model (varies)
|
|
115
|
-
- **Cerebras** — [cloud.cerebras.ai](https://cloud.cerebras.ai) → API Keys → Create – free tier: generous (developer tier 10× higher limits)
|
|
116
|
-
- **SambaNova** — [sambanova.ai/developers](https://sambanova.ai/developers) → Developers portal → API key (dev tier generous)
|
|
117
|
-
- **OpenRouter** — [openrouter.ai/keys](https://openrouter.ai/keys) → Create key (free requests on `:free` models, see details below)
|
|
118
|
-
|
|
119
|
-
### OpenRouter Free Tier Details
|
|
120
|
-
|
|
121
|
-
OpenRouter provides free requests on free models (`:free`):
|
|
14
|
+
To install globally:
|
|
122
15
|
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g free-coding-models
|
|
18
|
+
free-coding-models
|
|
123
19
|
```
|
|
124
|
-
──────────────────────────────────────────────────
|
|
125
|
-
OpenRouter — Free requests on free models (:free)
|
|
126
|
-
──────────────────────────────────────────────────
|
|
127
|
-
|
|
128
|
-
No credits (or <$10) → 50 requests / day (20 req/min)
|
|
129
|
-
≥ $10 in credits → 1000 requests / day (20 req/min)
|
|
130
20
|
|
|
131
|
-
|
|
132
|
-
Key things to know:
|
|
21
|
+
## What It Does
|
|
133
22
|
|
|
134
|
-
|
|
135
|
-
|
|
23
|
+
- Lists free coding models from the providers defined in [`sources.js`](./sources.js)
|
|
24
|
+
- Pings models continuously and shows latency, uptime, stability, verdict, and usage snapshots
|
|
25
|
+
- Lets you filter, sort, favorite, and compare models inside a full-screen TUI
|
|
26
|
+
- Launches supported coding tools with the currently selected model, after writing that exact selection as the tool default
|
|
27
|
+
- Installs provider catalogs into compatible external tool configs through the `Y` flow
|
|
136
28
|
|
|
137
|
-
|
|
29
|
+
## Stable Product Surface
|
|
138
30
|
|
|
139
|
-
|
|
31
|
+
The public launcher set is currently:
|
|
140
32
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- **Hyperbolic** — [app.hyperbolic.ai/settings](https://app.hyperbolic.ai/settings) → API Keys ($1 free trial)
|
|
152
|
-
- **Scaleway** — [console.scaleway.com/iam/api-keys](https://console.scaleway.com/iam/api-keys) → IAM → API Keys (1M free tokens)
|
|
153
|
-
- **Google AI Studio** — [aistudio.google.com/apikey](https://aistudio.google.com/apikey) → Get API key (free Gemma models, 14.4K req/day)
|
|
154
|
-
- **SiliconFlow** — [cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak) → API Keys (free-model quotas vary by model)
|
|
155
|
-
- **Together AI** — [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) → API Keys (credits/promotions vary)
|
|
156
|
-
- **Cloudflare Workers AI** — [dash.cloudflare.com](https://dash.cloudflare.com) → Create API token + set `CLOUDFLARE_ACCOUNT_ID` (Free: 10k neurons/day)
|
|
157
|
-
- **Perplexity API** — [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api) → API Key (tiered limits by spend)
|
|
158
|
-
- **ZAI** — [z.ai](https://z.ai) → Get API key (Coding Plan subscription)
|
|
159
|
-
3. **OpenCode** *(optional)* — [Install OpenCode](https://github.com/opencode-ai/opencode) to use the OpenCode integration
|
|
160
|
-
4. **OpenClaw** *(optional)* — [Install OpenClaw](https://openclaw.ai) to use the OpenClaw integration
|
|
33
|
+
- `OpenCode CLI`
|
|
34
|
+
- `OpenCode Desktop`
|
|
35
|
+
- `OpenClaw`
|
|
36
|
+
- `Crush`
|
|
37
|
+
- `Goose`
|
|
38
|
+
- `Pi`
|
|
39
|
+
- `Aider`
|
|
40
|
+
- `Qwen Code`
|
|
41
|
+
- `OpenHands`
|
|
42
|
+
- `Amp`
|
|
161
43
|
|
|
162
|
-
|
|
44
|
+
Temporarily removed from the public app while the bridge is being rebuilt:
|
|
163
45
|
|
|
164
|
-
|
|
46
|
+
- `Claude Code`
|
|
47
|
+
- `Codex`
|
|
48
|
+
- `Gemini`
|
|
49
|
+
- the old FCM global proxy / daemon / log overlay flow
|
|
165
50
|
|
|
166
|
-
##
|
|
51
|
+
## Quick Start
|
|
167
52
|
|
|
168
53
|
```bash
|
|
169
|
-
|
|
170
|
-
npm install -g free-coding-models
|
|
171
|
-
|
|
172
|
-
# pnpm
|
|
173
|
-
pnpm add -g free-coding-models
|
|
174
|
-
|
|
175
|
-
# bun
|
|
176
|
-
bun add -g free-coding-models
|
|
177
|
-
|
|
178
|
-
# Or use directly with npx/pnpx/bunx
|
|
179
|
-
npx free-coding-models YOUR_API_KEY
|
|
180
|
-
pnpx free-coding-models YOUR_API_KEY
|
|
181
|
-
bunx free-coding-models YOUR_API_KEY
|
|
54
|
+
free-coding-models
|
|
182
55
|
```
|
|
183
56
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
**Version 0.3.5 fixes the main Claude Code proxy compatibility bug found in real-world use:**
|
|
187
|
-
|
|
188
|
-
- **Claude Code beta-route requests now work** — the proxy accepts Anthropic URLs like `/v1/messages?beta=true` and `/v1/messages/count_tokens?beta=true`, which is how recent Claude Code builds really call the API.
|
|
189
|
-
- **Claude proxy flow now behaves like `free-claude-code` on the routing layer** — fake Claude model ids still map proxy-side to the selected free backend model, but the route matcher no longer breaks before that mapping can run.
|
|
190
|
-
- **The fix was validated against the real `claude` binary** — not just unit tests. The exact failure `selected model (claude-sonnet-4-6) may not exist` is now gone in local end-to-end repro.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## 🚀 Usage
|
|
57
|
+
Useful startup flags:
|
|
195
58
|
|
|
196
59
|
```bash
|
|
197
|
-
# Just run it — starts in OpenCode CLI mode, prompts for API key if not set
|
|
198
|
-
free-coding-models
|
|
199
|
-
|
|
200
|
-
# Explicitly target OpenCode CLI (TUI + Enter launches OpenCode CLI)
|
|
201
60
|
free-coding-models --opencode
|
|
202
|
-
|
|
203
|
-
## 📋 CLI Flags (expanded)
|
|
204
|
-
|
|
205
|
-
The tool now supports a comprehensive set of flags to fine‑tune its behavior. All flags can be combined in any order.
|
|
206
|
-
|
|
207
|
-
| Flag | Type | Description |
|
|
208
|
-
|------|------|-------------|
|
|
209
|
-
| `--best` | boolean | Show only top‑tier models (A+, S, S+). |
|
|
210
|
-
| `--fiable` | boolean | Run a 10 s reliability analysis and output the most reliable model. |
|
|
211
|
-
| `--json` | boolean | Output results as JSON for scripting/automation. |
|
|
212
|
-
| `--tier <S|A|B|C>` | value | Filter models by tier family (e.g. `S` shows S+ and S). |
|
|
213
|
-
| `--recommend` | boolean | Open Smart Recommend mode immediately on startup. |
|
|
214
|
-
| `--sort <column>` | value | Sort by a specific column (`rank`, `tier`, `origin`, `model`, `ping`, `avg`, `swe`, `ctx`, `condition`, `verdict`, `uptime`, `stability`, `usage`). |
|
|
215
|
-
| `--desc` / `--asc` | boolean | Set sort direction explicitly (descending or ascending). |
|
|
216
|
-
| `--origin <provider>` | value | Filter models by provider origin (e.g. `nvidia`, `groq`). |
|
|
217
|
-
| `--ping-interval <ms>` | value | Override the ping interval in milliseconds (affects live monitoring speed). |
|
|
218
|
-
| `--hide-unconfigured` | boolean | Hide models whose providers have no configured API key. |
|
|
219
|
-
| `--show-unconfigured` | boolean | Show all models regardless of API key configuration. |
|
|
220
|
-
| `--disable-widths-warning` | boolean | Disable the terminal width warning banner. |
|
|
221
|
-
| `--profile <name>` | value | Load a saved configuration profile before startup. |
|
|
222
|
-
| `--no-telemetry` | boolean | Disable anonymous telemetry for this run. |
|
|
223
|
-
| `--clean-proxy`, `--proxy-clean` | boolean | Remove persisted FCM proxy configuration from OpenCode. |
|
|
224
|
-
| `--help`, `-h` | boolean | Print the complete help text and exit. |
|
|
225
|
-
|
|
226
|
-
These flags are also reflected in the built‑in help (`free-coding-models --help`).
|
|
227
|
-
# Explicitly target OpenCode Desktop (TUI + Enter sets model & opens Desktop app)
|
|
228
|
-
free-coding-models --opencode-desktop
|
|
229
|
-
|
|
230
|
-
# Explicitly target OpenClaw (TUI + Enter sets model as default in OpenClaw)
|
|
231
|
-
free-coding-models --openclaw
|
|
232
|
-
|
|
233
|
-
# Launch other supported public tools with the selected model
|
|
61
|
+
free-coding-models --openclaw --tier S
|
|
234
62
|
free-coding-models --crush
|
|
235
|
-
free-coding-models --goose
|
|
236
|
-
|
|
237
|
-
# Show only top-tier models (A+, S, S+)
|
|
238
|
-
free-coding-models --best
|
|
239
|
-
|
|
240
|
-
# Analyze for 10 seconds and output the most reliable model
|
|
241
|
-
free-coding-models --fiable
|
|
242
|
-
|
|
243
|
-
# Output results as JSON (for scripting/automation)
|
|
244
63
|
free-coding-models --json
|
|
245
|
-
free-coding-models --
|
|
246
|
-
free-coding-models --json | jq '.[] | select(.avgPing < 500)' # Filter by latency
|
|
247
|
-
|
|
248
|
-
# Print the complete CLI help with every supported flag and daemon command
|
|
64
|
+
free-coding-models --recommend
|
|
249
65
|
free-coding-models --help
|
|
250
|
-
|
|
251
|
-
# Filter models by tier letter
|
|
252
|
-
free-coding-models --tier S # S+ and S only
|
|
253
|
-
free-coding-models --tier A # A+, A, A- only
|
|
254
|
-
free-coding-models --tier B # B+, B only
|
|
255
|
-
free-coding-models --tier C # C only
|
|
256
|
-
|
|
257
|
-
# Combine flags freely
|
|
258
|
-
free-coding-models --openclaw --tier S
|
|
259
|
-
free-coding-models --opencode --best
|
|
260
|
-
free-coding-models --tier S --json
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### AI E2E workflow (`/testfcm`)
|
|
264
|
-
|
|
265
|
-
For repo-level validation, this project now ships a repeatable AI-driven manual test flow:
|
|
266
|
-
|
|
267
|
-
- Preferred: `pnpm test:fcm -- --tool crush`
|
|
268
|
-
- Fallback when `pnpm` is unavailable: `npm run test:fcm -- --tool crush`
|
|
269
|
-
- Mock plumbing check: `pnpm test:fcm:mock`
|
|
270
|
-
|
|
271
|
-
What it does:
|
|
272
|
-
|
|
273
|
-
1. Copies your current `~/.free-coding-models.json` into an isolated HOME
|
|
274
|
-
2. Runs a `--json` preflight to catch obvious startup regressions
|
|
275
|
-
3. Starts the real TUI in a PTY via the system `expect` command
|
|
276
|
-
4. Presses `Enter` like a user to launch the chosen tool
|
|
277
|
-
5. Sends `hi`
|
|
278
|
-
6. Captures the response, `request-log.jsonl`, daemon logs, and generated tool config
|
|
279
|
-
7. Writes a Markdown report to `task/reports/` and raw artifacts to `task/artifacts/`
|
|
280
|
-
|
|
281
|
-
The command workflow is documented in [task/TESTFCM-WORKFLOW.md](task/TESTFCM-WORKFLOW.md). Project-local slash commands are also included at [.claude/commands/testfcm.md](.claude/commands/testfcm.md) and [.crush/commands/testfcm.md](.crush/commands/testfcm.md).
|
|
282
|
-
|
|
283
|
-
### Choosing the target tool
|
|
284
|
-
|
|
285
|
-
Running `free-coding-models` with no launcher flag starts in **OpenCode CLI** mode.
|
|
286
|
-
|
|
287
|
-
- Press **`Z`** in the TUI to cycle the public launch targets: `OpenCode CLI` → `OpenCode Desktop` → `OpenClaw` → `Crush` → `Goose` → `Pi` → `Aider` → `Claude Code` → `Codex` → `Gemini` → `Qwen` → `OpenHands` → `Amp`
|
|
288
|
-
- Or start directly in the target mode with a CLI flag such as `--opencode-desktop`, `--openclaw`, `--crush`, `--goose`, `--pi`, `--aider`, `--claude-code`, `--codex`, `--gemini`, `--qwen`, `--openhands`, or `--amp`
|
|
289
|
-
- The active target is always visible in the header badge before you press `Enter`
|
|
290
|
-
|
|
291
|
-
**How it works:**
|
|
292
|
-
1. **Ping phase** — All enabled models are pinged in parallel (up to 160 across 20 providers)
|
|
293
|
-
2. **Continuous monitoring** — Models start at 2s re-pings for 60s, then fall back to 10s automatically, and slow to 30s after 5 minutes idle unless you force 4s mode with `W`
|
|
294
|
-
3. **Real-time updates** — Watch "Latest", "Avg", and "Up%" columns update live
|
|
295
|
-
4. **Select anytime** — Use ↑↓ arrows to navigate, press Enter on a model to act
|
|
296
|
-
5. **Smart detection** — Automatically detects if NVIDIA NIM is configured in OpenCode or OpenClaw
|
|
297
|
-
|
|
298
|
-
Setup wizard (first run — walks through all 20 providers):
|
|
299
|
-
|
|
300
|
-
```
|
|
301
|
-
🔑 First-time setup — API keys
|
|
302
|
-
Enter keys for any provider you want to use. Press Enter to skip one.
|
|
303
|
-
|
|
304
|
-
● NVIDIA NIM
|
|
305
|
-
Free key at: https://build.nvidia.com
|
|
306
|
-
Profile → API Keys → Generate
|
|
307
|
-
Enter key (or Enter to skip): nvapi-xxxx
|
|
308
|
-
|
|
309
|
-
● Groq
|
|
310
|
-
Free key at: https://console.groq.com/keys
|
|
311
|
-
API Keys → Create API Key
|
|
312
|
-
Enter key (or Enter to skip): gsk_xxxx
|
|
313
|
-
|
|
314
|
-
● Cerebras
|
|
315
|
-
Free key at: https://cloud.cerebras.ai
|
|
316
|
-
API Keys → Create
|
|
317
|
-
Enter key (or Enter to skip):
|
|
318
|
-
|
|
319
|
-
● SambaNova
|
|
320
|
-
Free key at: https://cloud.sambanova.ai/apis
|
|
321
|
-
API Keys → Create ($5 free trial, 3 months)
|
|
322
|
-
Enter key (or Enter to skip):
|
|
323
|
-
|
|
324
|
-
✅ 2 key(s) saved to ~/.free-coding-models.json
|
|
325
|
-
You can add or change keys anytime with the P key in the TUI.
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
You don't need all twenty providers — skip any provider by pressing Enter. At least one key is required.
|
|
329
|
-
|
|
330
|
-
### Adding or changing keys later
|
|
331
|
-
|
|
332
|
-
Press **`P`** to open the Settings screen at any time:
|
|
333
|
-
|
|
334
|
-
```
|
|
335
|
-
⚙ Settings
|
|
336
|
-
|
|
337
|
-
Providers
|
|
338
|
-
|
|
339
|
-
❯ [ ✅ ] NVIDIA NIM nvapi-••••••••••••3f9a [Test ✅] Free tier (provider quota by model)
|
|
340
|
-
[ ✅ ] OpenRouter (no key set) [Test —] Free on :free (50/day <$10, 1000/day ≥$10)
|
|
341
|
-
[ ✅ ] Hugging Face Inference (no key set) [Test —] Free monthly credits (~$0.10)
|
|
342
|
-
|
|
343
|
-
Setup Instructions — NVIDIA NIM
|
|
344
|
-
1) Create a NVIDIA NIM account: https://build.nvidia.com
|
|
345
|
-
2) Profile → API Keys → Generate
|
|
346
|
-
3) Press T to test your key
|
|
347
|
-
|
|
348
|
-
↑↓ Navigate • Enter Edit/Run • + Add key • - Remove key • Space Toggle • T Test key • S Sync→OpenCode • R Restore backup • U Updates • ⌫ Delete profile • Esc Close
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
- **↑↓** — navigate providers
|
|
352
|
-
- **Enter** — edit the selected key, run maintenance actions, or load the selected profile
|
|
353
|
-
- **+ / -** — add another key for the selected provider or remove one
|
|
354
|
-
- **Space** — toggle provider enabled/disabled
|
|
355
|
-
- **T** — fire a real test ping to verify the key works (shows ✅/❌)
|
|
356
|
-
- **S** — sync `fcm-proxy` into OpenCode when proxy mode + persistence are enabled
|
|
357
|
-
- **R** — restore the last OpenCode backup created by sync/cleanup flows
|
|
358
|
-
- **U** — manually check npm for a newer version
|
|
359
|
-
- **Backspace** — delete the selected saved profile
|
|
360
|
-
- **Esc** — close settings and reload models list
|
|
361
|
-
|
|
362
|
-
Keys are saved to `~/.free-coding-models.json` (permissions `0600`).
|
|
363
|
-
|
|
364
|
-
Manual update is in the same Settings screen (`P`) under **Maintenance** (Enter to check, Enter again to install when an update is available).
|
|
365
|
-
When a newer npm release is known, the main footer also adds a full-width red warning line with the manual recovery command `npm install -g free-coding-models@latest`.
|
|
366
|
-
Favorites are also persisted in the same config file and survive restarts, app relaunches, and package updates.
|
|
367
|
-
Favorite rows stay pinned at the top and remain visible even when `Configured Only` mode is enabled.
|
|
368
|
-
The main table now starts in `Configured Only` mode, so if nothing is set up yet you can press `P` and add your first API key immediately.
|
|
369
|
-
|
|
370
|
-
### Environment variable overrides
|
|
371
|
-
|
|
372
|
-
Env vars always take priority over the config file:
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
NVIDIA_API_KEY=nvapi-xxx free-coding-models
|
|
376
|
-
GROQ_API_KEY=gsk_xxx free-coding-models
|
|
377
|
-
CEREBRAS_API_KEY=csk_xxx free-coding-models
|
|
378
|
-
OPENROUTER_API_KEY=sk-or-xxx free-coding-models
|
|
379
|
-
HUGGINGFACE_API_KEY=hf_xxx free-coding-models
|
|
380
|
-
REPLICATE_API_TOKEN=r8_xxx free-coding-models
|
|
381
|
-
DEEPINFRA_API_KEY=di_xxx free-coding-models
|
|
382
|
-
FIREWORKS_API_KEY=fw_xxx free-coding-models
|
|
383
|
-
SILICONFLOW_API_KEY=sk_xxx free-coding-models
|
|
384
|
-
TOGETHER_API_KEY=together_xxx free-coding-models
|
|
385
|
-
CLOUDFLARE_API_TOKEN=cf_xxx CLOUDFLARE_ACCOUNT_ID=your_account_id free-coding-models
|
|
386
|
-
PERPLEXITY_API_KEY=pplx_xxx free-coding-models
|
|
387
|
-
ZAI_API_KEY=zai-xxx free-coding-models
|
|
388
|
-
DASHSCOPE_API_KEY=sk-xxx free-coding-models
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
### Get your free API keys
|
|
392
|
-
|
|
393
|
-
**NVIDIA NIM** (44 models, S+ → C tier):
|
|
394
|
-
1. Sign up at [build.nvidia.com](https://build.nvidia.com)
|
|
395
|
-
2. Go to Profile → API Keys → Generate API Key
|
|
396
|
-
3. Name it (e.g. "free-coding-models"), set expiry to "Never"
|
|
397
|
-
4. Copy — shown only once!
|
|
398
|
-
|
|
399
|
-
**Groq** (6 models, fast inference):
|
|
400
|
-
1. Sign up at [console.groq.com](https://console.groq.com)
|
|
401
|
-
2. Go to API Keys → Create API Key
|
|
402
|
-
|
|
403
|
-
**Cerebras** (3 models, ultra-fast silicon):
|
|
404
|
-
1. Sign up at [cloud.cerebras.ai](https://cloud.cerebras.ai)
|
|
405
|
-
2. Go to API Keys → Create
|
|
406
|
-
|
|
407
|
-
**OpenRouter** (`:free` models):
|
|
408
|
-
1. Sign up at [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
409
|
-
2. Create API key (`sk-or-...`)
|
|
410
|
-
|
|
411
|
-
**Hugging Face Inference**:
|
|
412
|
-
1. Sign up at [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens)
|
|
413
|
-
2. Create Access Token (`hf_...`)
|
|
414
|
-
|
|
415
|
-
**Replicate**:
|
|
416
|
-
1. Sign up at [replicate.com/account/api-tokens](https://replicate.com/account/api-tokens)
|
|
417
|
-
2. Create API token (`r8_...`)
|
|
418
|
-
|
|
419
|
-
**DeepInfra**:
|
|
420
|
-
1. Sign up at [deepinfra.com/login](https://deepinfra.com/login)
|
|
421
|
-
2. Create API key from your account dashboard
|
|
422
|
-
|
|
423
|
-
**Fireworks AI**:
|
|
424
|
-
1. Sign up at [fireworks.ai](https://fireworks.ai)
|
|
425
|
-
2. Open Settings → Access Tokens and create a token
|
|
426
|
-
|
|
427
|
-
**Mistral Codestral**:
|
|
428
|
-
1. Sign up at [codestral.mistral.ai](https://codestral.mistral.ai)
|
|
429
|
-
2. Go to API Keys → Create
|
|
430
|
-
|
|
431
|
-
**Hyperbolic**:
|
|
432
|
-
1. Sign up at [app.hyperbolic.ai/settings](https://app.hyperbolic.ai/settings)
|
|
433
|
-
2. Create an API key in Settings
|
|
434
|
-
|
|
435
|
-
**Scaleway**:
|
|
436
|
-
1. Sign up at [console.scaleway.com/iam/api-keys](https://console.scaleway.com/iam/api-keys)
|
|
437
|
-
2. Go to IAM → API Keys
|
|
438
|
-
|
|
439
|
-
**Google AI Studio**:
|
|
440
|
-
1. Sign up at [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
441
|
-
2. Create an API key for Gemini/Gemma endpoints
|
|
442
|
-
|
|
443
|
-
**SiliconFlow**:
|
|
444
|
-
1. Sign up at [cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak)
|
|
445
|
-
2. Create API key in Account → API Keys
|
|
446
|
-
|
|
447
|
-
**Together AI**:
|
|
448
|
-
1. Sign up at [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys)
|
|
449
|
-
2. Create an API key in Settings
|
|
450
|
-
|
|
451
|
-
**Cloudflare Workers AI**:
|
|
452
|
-
1. Sign up at [dash.cloudflare.com](https://dash.cloudflare.com)
|
|
453
|
-
2. Create an API token with Workers AI permissions
|
|
454
|
-
3. Export both `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID`
|
|
455
|
-
|
|
456
|
-
**Perplexity API**:
|
|
457
|
-
1. Sign up at [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api)
|
|
458
|
-
2. Create API key (`PERPLEXITY_API_KEY`)
|
|
459
|
-
|
|
460
|
-
**Alibaba Cloud (DashScope)** (8 models, Qwen3-Coder family):
|
|
461
|
-
1. Sign up at [modelstudio.console.alibabacloud.com](https://modelstudio.console.alibabacloud.com)
|
|
462
|
-
2. Activate Model Studio (1M free tokens per model, Singapore region, 90 days)
|
|
463
|
-
3. Create API key (`DASHSCOPE_API_KEY`)
|
|
464
|
-
|
|
465
|
-
**ZAI** (5 models, GLM family):
|
|
466
|
-
1. Sign up at [z.ai](https://z.ai)
|
|
467
|
-
2. Subscribe to Coding Plan
|
|
468
|
-
3. Get API key from dashboard
|
|
469
|
-
|
|
470
|
-
> 💡 **Free tiers** — each provider exposes a dev/free tier with its own quotas. ZAI requires a Coding Plan subscription.
|
|
471
|
-
|
|
472
|
-
---
|
|
473
|
-
|
|
474
|
-
## 🤖 Coding Models
|
|
475
|
-
|
|
476
|
-
**160 coding models** across 20 providers and 8 tiers, ranked by [SWE-bench Verified](https://www.swebench.com) — the industry-standard benchmark measuring real GitHub issue resolution. Scores are self-reported by providers unless noted.
|
|
477
|
-
|
|
478
|
-
### Alibaba Cloud (DashScope) (8 models)
|
|
479
|
-
|
|
480
|
-
| Tier | SWE-bench | Model |
|
|
481
|
-
|------|-----------|-------|
|
|
482
|
-
| **S+** ≥70% | Qwen3 Coder Plus (69.6%), Qwen3 Coder 480B (70.6%) |
|
|
483
|
-
| **S** 60–70% | Qwen3 Coder Max (67.0%), Qwen3 Coder Next (65.0%), Qwen3 235B (70.0%), Qwen3 80B Instruct (65.0%) |
|
|
484
|
-
| **A+** 50–60% | Qwen3 32B (50.0%) |
|
|
485
|
-
| **A** 40–50% | Qwen2.5 Coder 32B (46.0%) |
|
|
486
|
-
|
|
487
|
-
### ZAI Coding Plan (5 models)
|
|
488
|
-
|
|
489
|
-
| Tier | SWE-bench | Model |
|
|
490
|
-
|------|-----------|-------|
|
|
491
|
-
| **S+** ≥70% | GLM-5 (77.8%), GLM-4.5 (75.0%), GLM-4.7 (73.8%), GLM-4.5-Air (72.0%), GLM-4.6 (70.0%) |
|
|
492
|
-
|
|
493
|
-
### NVIDIA NIM (44 models)
|
|
494
|
-
|
|
495
|
-
| Tier | SWE-bench | Models |
|
|
496
|
-
|------|-----------|--------|
|
|
497
|
-
| **S+** ≥70% | GLM 5 (77.8%), Kimi K2.5 (76.8%), Step 3.5 Flash (74.4%), MiniMax M2.1 (74.0%), GLM 4.7 (73.8%), DeepSeek V3.2 (73.1%), Devstral 2 (72.2%), Kimi K2 Thinking (71.3%), Qwen3 Coder 480B (70.6%), Qwen3 235B (70.0%) |
|
|
498
|
-
| **S** 60–70% | MiniMax M2 (69.4%), DeepSeek V3.1 Terminus (68.4%), Qwen3 80B Thinking (68.0%), Qwen3.5 400B (68.0%), Kimi K2 Instruct (65.8%), Qwen3 80B Instruct (65.0%), DeepSeek V3.1 (62.0%), Llama 4 Maverick (62.0%), GPT OSS 120B (60.0%) |
|
|
499
|
-
| **A+** 50–60% | Mistral Large 675B (58.0%), Nemotron Ultra 253B (56.0%), Colosseum 355B (52.0%), QwQ 32B (50.0%) |
|
|
500
|
-
| **A** 40–50% | Nemotron Super 49B (49.0%), Mistral Medium 3 (48.0%), Qwen2.5 Coder 32B (46.0%), Magistral Small (45.0%), Llama 4 Scout (44.0%), Llama 3.1 405B (44.0%), Nemotron Nano 30B (43.0%), R1 Distill 32B (43.9%), GPT OSS 20B (42.0%) |
|
|
501
|
-
| **A-** 35–40% | Llama 3.3 70B (39.5%), Seed OSS 36B (38.0%), R1 Distill 14B (37.7%), Stockmark 100B (36.0%) |
|
|
502
|
-
| **B+** 30–35% | Ministral 14B (34.0%), Mixtral 8x22B (32.0%), Granite 34B Code (30.0%) |
|
|
503
|
-
| **B** 20–30% | R1 Distill 8B (28.2%), R1 Distill 7B (22.6%) |
|
|
504
|
-
| **C** <20% | Gemma 2 9B (18.0%), Phi 4 Mini (14.0%), Phi 3.5 Mini (12.0%) |
|
|
505
|
-
|
|
506
|
-
### Groq (10 models)
|
|
507
|
-
|
|
508
|
-
| Tier | SWE-bench | Model |
|
|
509
|
-
|------|-----------|-------|
|
|
510
|
-
| **S** 60–70% | Kimi K2 Instruct (65.8%), Llama 4 Maverick (62.0%) |
|
|
511
|
-
| **A+** 50–60% | QwQ 32B (50.0%) |
|
|
512
|
-
| **A** 40–50% | Llama 4 Scout (44.0%), R1 Distill 70B (43.9%) |
|
|
513
|
-
| **A-** 35–40% | Llama 3.3 70B (39.5%) |
|
|
514
|
-
|
|
515
|
-
### Cerebras (7 models)
|
|
516
|
-
|
|
517
|
-
| Tier | SWE-bench | Model |
|
|
518
|
-
|------|-----------|-------|
|
|
519
|
-
| **A+** 50–60% | Qwen3 32B (50.0%) |
|
|
520
|
-
| **A** 40–50% | Llama 4 Scout (44.0%) |
|
|
521
|
-
| **A-** 35–40% | Llama 3.3 70B (39.5%) |
|
|
522
|
-
|
|
523
|
-
### Tier scale
|
|
524
|
-
|
|
525
|
-
- **S+/S** — Elite frontier coders (≥60% SWE-bench), best for complex real-world tasks and refactors
|
|
526
|
-
- **A+/A** — Great alternatives, strong at most coding tasks
|
|
527
|
-
- **A-/B+** — Solid performers, good for targeted programming tasks
|
|
528
|
-
- **B/C** — Lightweight or older models, good for code completion on constrained infra
|
|
529
|
-
|
|
530
|
-
### Filtering by tier
|
|
531
|
-
|
|
532
|
-
Use `--tier` to focus on a specific capability band:
|
|
533
|
-
|
|
534
|
-
```bash
|
|
535
|
-
free-coding-models --tier S # Only S+ and S (frontier models)
|
|
536
|
-
free-coding-models --tier A # Only A+, A, A- (solid performers)
|
|
537
|
-
free-coding-models --tier B # Only B+, B (lightweight options)
|
|
538
|
-
free-coding-models --tier C # Only C (edge/minimal models)
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
## 📊 TUI Columns
|
|
542
|
-
|
|
543
|
-
The main table displays one row per model with the following columns:
|
|
544
|
-
|
|
545
|
-
| Column | Sort key | Description |
|
|
546
|
-
|--------|----------|-------------|
|
|
547
|
-
| **Rank** | `R` | Position based on current sort order (medals for top 3: 🥇🥈🥉) |
|
|
548
|
-
| **Tier** | — | SWE-bench tier (S+, S, A+, A, A-, B+, B, C) |
|
|
549
|
-
| **SWE%** | `S` | SWE-bench Verified score — industry-standard for coding |
|
|
550
|
-
| **CTX** | `C` | Context window size (e.g. `128k`) |
|
|
551
|
-
| **Model** | `M` | Model display name (favorites show ⭐ prefix) |
|
|
552
|
-
| **Provider** | `O` | Provider name (NIM, Groq, etc.) — press `D` to cycle provider filter |
|
|
553
|
-
| **Latest Ping** | `L` | Most recent round-trip latency in milliseconds |
|
|
554
|
-
| **Avg Ping** | `A` | Rolling average of ALL successful pings since launch |
|
|
555
|
-
| **Health** | `H` | Current status: UP ✅, NO KEY 🔑, Timeout ⏳, Overloaded 🔥, Not Found 🚫 |
|
|
556
|
-
| **Verdict** | `V` | Health verdict based on avg latency + stability analysis |
|
|
557
|
-
| **Stability** | `B` | Composite 0–100 consistency score (see [Stability Score](#-stability-score)) |
|
|
558
|
-
| **Up%** | `U` | Uptime — percentage of successful pings |
|
|
559
|
-
| **Used** | — | Total prompt+completion tokens consumed in logs for this exact provider/model pair, shown in `k` or `M` |
|
|
560
|
-
|
|
561
|
-
### Verdict values
|
|
562
|
-
|
|
563
|
-
The Verdict column combines average latency with stability analysis:
|
|
564
|
-
|
|
565
|
-
| Verdict | Meaning |
|
|
566
|
-
|---------|---------|
|
|
567
|
-
| **Perfect** | Avg < 400ms with stable p95/jitter |
|
|
568
|
-
| **Normal** | Avg < 1000ms, consistent responses |
|
|
569
|
-
| **Slow** | Avg 1000–2000ms |
|
|
570
|
-
| **Spiky** | Good avg but erratic tail latency (p95 >> avg) |
|
|
571
|
-
| **Very Slow** | Avg 2000–5000ms |
|
|
572
|
-
| **Overloaded** | Server returned 429/503 (rate limited or capacity hit) |
|
|
573
|
-
| **Unstable** | Was previously up but now timing out, or avg > 5000ms |
|
|
574
|
-
| **Not Active** | No successful pings yet |
|
|
575
|
-
| **Pending** | First ping still in flight |
|
|
576
|
-
|
|
577
|
-
---
|
|
578
|
-
|
|
579
|
-
## 📐 Stability Score
|
|
580
|
-
|
|
581
|
-
The **Stability** column (sort with `B` key) shows a composite 0–100 score that answers: *"How consistent and predictable is this model?"*
|
|
582
|
-
|
|
583
|
-
Average latency alone is misleading — a model averaging 250ms that randomly spikes to 6 seconds *feels* slower in practice than a steady 400ms model. The stability score captures this.
|
|
584
|
-
|
|
585
|
-
### Formula
|
|
586
|
-
|
|
587
|
-
Four signals are normalized to 0–100 each, then combined with weights:
|
|
588
|
-
|
|
589
|
-
```
|
|
590
|
-
Stability = 0.30 × p95_score
|
|
591
|
-
+ 0.30 × jitter_score
|
|
592
|
-
+ 0.20 × spike_score
|
|
593
|
-
+ 0.20 × reliability_score
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
| Component | Weight | What it measures | How it's normalized |
|
|
597
|
-
|-----------|--------|-----------------|---------------------|
|
|
598
|
-
| **p95 latency** | 30% | Tail-latency spikes — the worst 5% of response times | `100 × (1 - p95 / 5000)`, clamped to 0–100 |
|
|
599
|
-
| **Jitter (σ)** | 30% | Erratic response times — standard deviation of ping times | `100 × (1 - jitter / 2000)`, clamped to 0–100 |
|
|
600
|
-
| **Spike rate** | 20% | Fraction of pings above 3000ms | `100 × (1 - spikes / total_pings)` |
|
|
601
|
-
| **Reliability** | 20% | Uptime — fraction of successful HTTP 200 pings | Direct uptime percentage (0–100) |
|
|
602
|
-
|
|
603
|
-
---
|
|
604
|
-
|
|
605
|
-
## 📡 FCM Proxy V2
|
|
606
|
-
|
|
607
|
-
`free-coding-models` includes a local reverse proxy that merges all your provider API keys into one endpoint. Optional background service mode keeps it running 24/7 — even without the TUI.
|
|
608
|
-
|
|
609
|
-
> **Disabled by default** — enable in Settings (`P`) → FCM Proxy V2 settings.
|
|
610
|
-
|
|
611
|
-
### What the proxy does
|
|
612
|
-
|
|
613
|
-
| Feature | Description |
|
|
614
|
-
|---------|-------------|
|
|
615
|
-
| **Unified endpoint** | One URL (`http://127.0.0.1:18045/v1`) replaces 20+ provider endpoints |
|
|
616
|
-
| **Key rotation** | Automatically swaps to the next API key when one hits rate limits (429) |
|
|
617
|
-
| **Usage tracking** | Tracks token consumption per provider/model pair in real-time |
|
|
618
|
-
| **Anthropic translation** | Claude Code sends `POST /v1/messages` — the proxy translates to OpenAI format upstream |
|
|
619
|
-
| **Path normalization** | Converts non-standard API paths (ZAI, Cloudflare) to standard `/v1/` calls |
|
|
620
|
-
|
|
621
|
-
### In-process vs Background Service mode
|
|
622
|
-
|
|
623
|
-
| | In-process (default) | Background Service (always-on) |
|
|
624
|
-
|---|---|---|
|
|
625
|
-
| **Lifetime** | Starts/stops with TUI | Survives reboots |
|
|
626
|
-
| **Use case** | Quick sessions | 24/7 access from any tool |
|
|
627
|
-
| **Setup** | Toggle in Settings | One-time install via TUI or CLI |
|
|
628
|
-
| **Port** | Random or configured | Stable (`18045` by default) |
|
|
629
|
-
| **Token** | New each session | Persistent (env files stay valid) |
|
|
630
|
-
|
|
631
|
-
### Quick setup
|
|
632
|
-
|
|
633
|
-
**Via TUI (recommended):**
|
|
634
|
-
1. Press `P` to open Settings
|
|
635
|
-
2. Select **FCM Proxy V2 settings →** and press Enter
|
|
636
|
-
3. Enable **Proxy mode**, then select **Install background service**
|
|
637
|
-
|
|
638
|
-
**Via CLI:**
|
|
639
|
-
```bash
|
|
640
|
-
free-coding-models daemon install # Install + start as OS service
|
|
641
|
-
free-coding-models daemon status # Check running status
|
|
642
|
-
free-coding-models daemon restart # Restart after config changes
|
|
643
|
-
free-coding-models daemon stop # Graceful stop (SIGTERM)
|
|
644
|
-
free-coding-models daemon uninstall # Remove OS service completely
|
|
645
|
-
free-coding-models daemon logs # Show recent service logs
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
For a quick browser sanity-check, open [http://127.0.0.1:18045/](http://127.0.0.1:18045/) or [http://127.0.0.1:18045/v1/health](http://127.0.0.1:18045/v1/health) while the proxy is running.
|
|
649
|
-
|
|
650
|
-
### Service management
|
|
651
|
-
|
|
652
|
-
The dedicated **FCM Proxy V2** overlay (accessible via `J` from main TUI, or Settings → Enter) provides full control:
|
|
653
|
-
|
|
654
|
-
- **Current tool hint** — Shows which Z-selected tool will receive persisted proxy config (when that mode supports it)
|
|
655
|
-
- **Auto-sync toggle** — Automatically write the `fcm-proxy` provider to the current tool's config when the proxy starts
|
|
656
|
-
- **Cleanup** — Remove `fcm-proxy` entries from the current tool's config
|
|
657
|
-
- **Status display** — Running/Stopped/Stale/Unhealthy with PID, port, uptime, account/model counts
|
|
658
|
-
- **Version mismatch detection** — warns if service version differs from installed FCM version
|
|
659
|
-
- **Restart** — stop + start via the OS service manager
|
|
660
|
-
- **Stop** — graceful SIGTERM (service may auto-restart if installed)
|
|
661
|
-
- **Force kill** — emergency SIGKILL for stuck processes
|
|
662
|
-
- **View logs** — last 50 lines from `~/.free-coding-models/daemon-stdout.log`
|
|
663
|
-
|
|
664
|
-
### Platform support
|
|
665
|
-
|
|
666
|
-
| Platform | Service type | Config path |
|
|
667
|
-
|----------|-------------|-------------|
|
|
668
|
-
| macOS | `launchd` LaunchAgent | `~/Library/LaunchAgents/com.fcm.proxy.plist` |
|
|
669
|
-
| Linux | `systemd` user service | `~/.config/systemd/user/fcm-proxy.service` |
|
|
670
|
-
| Windows | Not supported | Falls back to in-process proxy |
|
|
671
|
-
|
|
672
|
-
### Config files
|
|
673
|
-
|
|
674
|
-
| File | Purpose |
|
|
675
|
-
|------|---------|
|
|
676
|
-
| `~/.free-coding-models.json` | API keys, proxy settings, service consent |
|
|
677
|
-
| `~/.free-coding-models/daemon.json` | Status file (PID, port, token) — written by the background service |
|
|
678
|
-
| `~/.free-coding-models/daemon-stdout.log` | Service output log |
|
|
679
|
-
|
|
680
|
-
The `proxy.activeTool` field is now legacy-only. FCM Proxy V2 follows the current **Z-selected** tool automatically whenever that mode supports persisted proxy sync.
|
|
681
|
-
|
|
682
|
-
### Cleanup
|
|
683
|
-
|
|
684
|
-
- From the FCM Proxy V2 overlay: **Clean {tool} proxy config** — removes `fcm-proxy` entries from whichever tool is currently selected
|
|
685
|
-
- Or: `free-coding-models --clean-proxy`
|
|
686
|
-
|
|
687
|
-
### Safety
|
|
688
|
-
|
|
689
|
-
- **Dev guard**: `installDaemon()` is blocked when running from a git checkout — prevents hardcoding local repo paths in OS service files
|
|
690
|
-
- **Localhost only**: The proxy listens on `127.0.0.1`, never exposed to the network
|
|
691
|
-
- **Consent required**: Service installation requires explicit user action — never auto-installs
|
|
692
|
-
- **Hot-reload**: Config changes are picked up automatically without restarting the service
|
|
693
|
-
|
|
694
|
-
---
|
|
695
|
-
|
|
696
|
-
## 📜 Request Log Overlay
|
|
697
|
-
|
|
698
|
-
Press **`X`** at any time to open the dedicated request-log overlay.
|
|
699
|
-
|
|
700
|
-
- **Proxy-only accounting**: Entries are written when requests flow through the multi-account proxy.
|
|
701
|
-
- **Exact token totals**: The overlay aggregates prompt+completion usage per proxied request.
|
|
702
|
-
- **Per-request visibility**: You can inspect provider, model, status, token count, and latency for recent requests.
|
|
703
|
-
- **Startup table reuse**: The `Used` column in the main table is derived from the same request log file.
|
|
704
|
-
|
|
705
|
-
Use **↑↓** to scroll and **Esc** or **X** to return to the main table.
|
|
706
|
-
|
|
707
|
-
---
|
|
708
|
-
|
|
709
|
-
## 🧰 Supported Tool Launchers
|
|
710
|
-
|
|
711
|
-
You can use `free-coding-models` with 12+ AI coding tools. When you select a model and press Enter, the tool automatically configures and pre-selects your chosen model:
|
|
712
|
-
|
|
713
|
-
| Tool | Flag | Auto-Config |
|
|
714
|
-
|------|------|------------|
|
|
715
|
-
| OpenCode CLI | `--opencode` | ~/.config/opencode/opencode.json |
|
|
716
|
-
| OpenCode Desktop | `--opencode-desktop` | Opens Desktop app |
|
|
717
|
-
| OpenClaw | `--openclaw` | ~/.openclaw/openclaw.json |
|
|
718
|
-
| Crush | `--crush` | ~/.config/crush/crush.json |
|
|
719
|
-
| Goose | `--goose` | ~/.config/goose/config.yaml + custom_providers/ |
|
|
720
|
-
| **Aider** | `--aider` | ~/.aider.conf.yml |
|
|
721
|
-
| **Claude Code** ⚡ | `--claude-code` | Requires FCM Proxy V2 |
|
|
722
|
-
| **Codex** ⚡ | `--codex` | Requires FCM Proxy V2 |
|
|
723
|
-
| **Gemini** ⚡ | `--gemini` | Requires FCM Proxy V2 |
|
|
724
|
-
| **Qwen** | `--qwen` | ~/.qwen/settings.json |
|
|
725
|
-
| **OpenHands** | `--openhands` | LLM_MODEL env var |
|
|
726
|
-
| **Amp** | `--amp` | ~/.config/amp/settings.json |
|
|
727
|
-
| **Pi** | `--pi` | ~/.pi/agent/settings.json |
|
|
728
|
-
|
|
729
|
-
Press **Z** to cycle through all 13 tool modes in the TUI, or use flags to start in your preferred mode.
|
|
730
|
-
|
|
731
|
-
⚡ = Requires FCM Proxy V2 background service (press `J` to enable). These tools cannot connect to free providers without the proxy.
|
|
732
|
-
|
|
733
|
-
Proxy-backed external tool support is still beta. Expect occasional launch/auth rough edges while third-party CLI contracts are still settling.
|
|
734
|
-
|
|
735
|
-
`Claude Code` is launched with a real Claude alias (`--model sonnet`) while the proxy maps that fake Claude family back to your selected FCM backend, which avoids stale local `gpt-oss-*` selections breaking before the proxy is hit. `Codex` is launched through an explicit custom provider config so it stays in API-key mode through the proxy. `Gemini` proxy launches are version-gated: older builds like `0.33.0` are blocked with a clear diagnostic instead of being misconfigured silently.
|
|
736
|
-
|
|
737
|
-
The **Install Endpoints** flow (`Y` key) now targets only the tools with a stable persisted config contract. `Claude Code`, `Codex`, and `Gemini` stay launcher-only and should be started directly from FCM.
|
|
738
|
-
|
|
739
|
-
---
|
|
740
|
-
|
|
741
|
-
## 🔌 OpenCode Integration
|
|
742
|
-
|
|
743
|
-
**The easiest way** — let `free-coding-models` do everything:
|
|
744
|
-
|
|
745
|
-
1. **Run**: `free-coding-models --opencode` (or launch with no flag to use the default OpenCode CLI mode)
|
|
746
|
-
2. **Wait** for models to be pinged (green ✅ status)
|
|
747
|
-
3. **Navigate** with ↑↓ arrows to your preferred model
|
|
748
|
-
4. **Press Enter** — tool automatically:
|
|
749
|
-
- Detects if NVIDIA NIM is configured in OpenCode
|
|
750
|
-
- Sets your selected model as default in `~/.config/opencode/opencode.json`
|
|
751
|
-
- Launches OpenCode with the model pre-selected and ready to use
|
|
752
|
-
|
|
753
|
-
### tmux sub-agent panes
|
|
754
|
-
|
|
755
|
-
When launched from an existing `tmux` session, `free-coding-models` now auto-adds an OpenCode `--port` argument so OpenCode/oh-my-opencode can spawn sub-agents in panes.
|
|
756
|
-
|
|
757
|
-
- Priority 1: reuse `OPENCODE_PORT` if it is valid and free
|
|
758
|
-
- Priority 2: auto-pick the first free port in `4096-5095`
|
|
759
|
-
|
|
760
|
-
You can force a specific port:
|
|
761
|
-
|
|
762
|
-
```bash
|
|
763
|
-
OPENCODE_PORT=4098 free-coding-models --opencode
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
### ZAI provider proxy
|
|
767
|
-
|
|
768
|
-
OpenCode doesn't natively support ZAI's API path format (`/api/coding/paas/v4/*`). When you select a ZAI model, `free-coding-models` automatically starts a local reverse proxy that translates OpenCode's standard `/v1/*` requests to ZAI's API. This is fully transparent -- just select a ZAI model and press Enter.
|
|
769
|
-
|
|
770
|
-
**How it works:**
|
|
771
|
-
1. A localhost HTTP proxy starts on a random available port
|
|
772
|
-
2. OpenCode is configured with a `zai` provider pointing at `http://localhost:<port>/v1`
|
|
773
|
-
3. The proxy rewrites `/v1/models` to `/api/coding/paas/v4/models` and `/v1/chat/completions` to `/api/coding/paas/v4/chat/completions`
|
|
774
|
-
4. When OpenCode exits, the proxy shuts down automatically
|
|
775
|
-
|
|
776
|
-
No manual configuration needed -- the proxy lifecycle is managed entirely by `free-coding-models`.
|
|
777
|
-
|
|
778
|
-
### Manual OpenCode Setup (Optional)
|
|
779
|
-
|
|
780
|
-
Create or edit `~/.config/opencode/opencode.json`:
|
|
781
|
-
|
|
782
|
-
```json
|
|
783
|
-
{
|
|
784
|
-
"provider": {
|
|
785
|
-
"nvidia": {
|
|
786
|
-
"npm": "@ai-sdk/openai-compatible",
|
|
787
|
-
"name": "NVIDIA NIM",
|
|
788
|
-
"options": {
|
|
789
|
-
"baseURL": "https://integrate.api.nvidia.com/v1",
|
|
790
|
-
"apiKey": "{env:NVIDIA_API_KEY}"
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
},
|
|
794
|
-
"model": "nvidia/deepseek-ai/deepseek-v3.2"
|
|
795
|
-
}
|
|
796
66
|
```
|
|
797
67
|
|
|
798
|
-
|
|
68
|
+
Default tool mode with no launcher flag: `OpenCode CLI`
|
|
799
69
|
|
|
800
|
-
|
|
801
|
-
export NVIDIA_API_KEY=nvapi-xxxx-your-key-here
|
|
802
|
-
# Add to ~/.bashrc or ~/.zshrc for persistence
|
|
803
|
-
```
|
|
70
|
+
## Main TUI Keys
|
|
804
71
|
|
|
805
|
-
|
|
72
|
+
- `↑↓` navigate rows
|
|
73
|
+
- `Enter` launch/select the current model in the active tool mode
|
|
74
|
+
- `Z` cycle tool mode
|
|
75
|
+
- `T` cycle tier filter
|
|
76
|
+
- `D` cycle provider filter
|
|
77
|
+
- `R/O/M/L/A/S/C/H/V/B/U/G` sort columns
|
|
78
|
+
- `E` toggle configured models only
|
|
79
|
+
- `F` favorite/unfavorite the selected model
|
|
80
|
+
- `W` cycle ping cadence
|
|
81
|
+
- `P` open Settings
|
|
82
|
+
- `Y` open Install Endpoints
|
|
83
|
+
- `Q` open Smart Recommend
|
|
84
|
+
- `I` open feedback / bug report form
|
|
85
|
+
- `N` open changelog
|
|
86
|
+
- `K` open help
|
|
87
|
+
- `Ctrl+C` exit
|
|
806
88
|
|
|
807
|
-
|
|
89
|
+
## Settings
|
|
808
90
|
|
|
809
|
-
|
|
91
|
+
Press `P` to:
|
|
810
92
|
|
|
811
|
-
|
|
812
|
-
-
|
|
813
|
-
-
|
|
814
|
-
-
|
|
93
|
+
- add or remove provider API keys
|
|
94
|
+
- enable or disable providers
|
|
95
|
+
- test provider keys
|
|
96
|
+
- check for updates
|
|
97
|
+
- toggle the terminal width warning
|
|
98
|
+
- clean discontinued proxy-era config left behind by older builds
|
|
815
99
|
|
|
816
|
-
|
|
100
|
+
The main TUI also shows a footer notice explaining that the external-tools bridge/proxy is intentionally disabled while it is being rebuilt.
|
|
817
101
|
|
|
818
|
-
##
|
|
102
|
+
## Install Endpoints
|
|
819
103
|
|
|
820
|
-
|
|
104
|
+
Press `Y` to install one configured provider into supported external tools.
|
|
821
105
|
|
|
822
|
-
|
|
106
|
+
Current install flow:
|
|
823
107
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
108
|
+
1. Choose a configured provider
|
|
109
|
+
2. Choose a supported tool
|
|
110
|
+
3. Choose scope: all models or selected models
|
|
111
|
+
4. Write the managed config/env files
|
|
827
112
|
|
|
828
|
-
|
|
113
|
+
This flow is direct-provider only now. The old proxy-backed install path has been removed.
|
|
829
114
|
|
|
830
|
-
|
|
831
|
-
2. **Navigate** with ↑↓ arrows to your preferred model
|
|
832
|
-
3. **Press Enter** — tool automatically:
|
|
833
|
-
- Reads `~/.openclaw/openclaw.json`
|
|
834
|
-
- Adds the `nvidia` provider block (NIM base URL + your API key) if missing
|
|
835
|
-
- Sets `agents.defaults.model.primary` to `nvidia/<model-id>`
|
|
836
|
-
- Saves config and prints next steps
|
|
115
|
+
## Tool Notes
|
|
837
116
|
|
|
838
|
-
|
|
117
|
+
When you press `Enter`, FCM now persists the selected model into the target tool before launch so the tool opens on the model you actually picked.
|
|
839
118
|
|
|
840
|
-
|
|
841
|
-
{
|
|
842
|
-
"models": {
|
|
843
|
-
"providers": {
|
|
844
|
-
"nvidia": {
|
|
845
|
-
"baseUrl": "https://integrate.api.nvidia.com/v1",
|
|
846
|
-
"api": "openai-completions"
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
"env": {
|
|
851
|
-
"NVIDIA_API_KEY": "nvapi-xxxx-your-key"
|
|
852
|
-
},
|
|
853
|
-
"agents": {
|
|
854
|
-
"defaults": {
|
|
855
|
-
"model": {
|
|
856
|
-
"primary": "nvidia/deepseek-ai/deepseek-v3.2"
|
|
857
|
-
},
|
|
858
|
-
"models": {
|
|
859
|
-
"nvidia/deepseek-ai/deepseek-v3.2": {}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
```
|
|
119
|
+
### OpenCode
|
|
865
120
|
|
|
866
|
-
|
|
121
|
+
- `OpenCode CLI` and `OpenCode Desktop` share `~/.config/opencode/opencode.json`
|
|
122
|
+
- Selecting a model and pressing `Enter` updates the config and launches the target mode
|
|
867
123
|
|
|
868
|
-
|
|
124
|
+
### OpenClaw
|
|
869
125
|
|
|
870
|
-
|
|
126
|
+
- `free-coding-models` writes the selected provider/model into `~/.openclaw/openclaw.json` as the primary default
|
|
127
|
+
- OpenClaw itself is not launched by FCM
|
|
871
128
|
|
|
872
|
-
|
|
129
|
+
### ZAI with OpenCode
|
|
873
130
|
|
|
874
|
-
|
|
875
|
-
# Apply via CLI
|
|
876
|
-
openclaw models set nvidia/deepseek-ai/deepseek-v3.2
|
|
131
|
+
ZAI still needs a small local compatibility bridge for OpenCode only, because ZAI uses `/api/coding/paas/v4/*` instead of standard `/v1/*` paths.
|
|
877
132
|
|
|
878
|
-
|
|
879
|
-
openclaw configure
|
|
880
|
-
```
|
|
133
|
+
That bridge is internal to the OpenCode launcher path and is still supported:
|
|
881
134
|
|
|
882
|
-
|
|
135
|
+
- it starts only when launching a ZAI model in OpenCode
|
|
136
|
+
- it binds to localhost on a random port
|
|
137
|
+
- it shuts down automatically when OpenCode exits
|
|
883
138
|
|
|
884
|
-
|
|
139
|
+
This is separate from the removed global multi-tool proxy system.
|
|
885
140
|
|
|
886
|
-
|
|
141
|
+
## `/testfcm`
|
|
887
142
|
|
|
888
|
-
|
|
143
|
+
There is a repo-local harness for exercising the real TUI and launcher flow.
|
|
889
144
|
|
|
890
|
-
|
|
891
|
-
Model "nvidia/mistralai/devstral-2-123b-instruct-2512" is not allowed. Use /models to list providers, or /models <provider> to list models.
|
|
892
|
-
```
|
|
893
|
-
|
|
894
|
-
**Solution:** Patch OpenClaw's configuration to add ALL 47 NVIDIA models from `free-coding-models` to the allowlist:
|
|
145
|
+
Available scripts:
|
|
895
146
|
|
|
896
147
|
```bash
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
This script:
|
|
902
|
-
- Backs up `~/.openclaw/agents/main/agent/models.json` and `~/.openclaw/openclaw.json`
|
|
903
|
-
- Adds all 47 NVIDIA models with proper context window and token limits
|
|
904
|
-
- Preserves existing models and configuration
|
|
905
|
-
- Prints a summary of what was added
|
|
906
|
-
|
|
907
|
-
**After patching:**
|
|
908
|
-
|
|
909
|
-
1. Restart OpenClaw gateway:
|
|
910
|
-
```bash
|
|
911
|
-
systemctl --user restart openclaw-gateway
|
|
912
|
-
```
|
|
913
|
-
|
|
914
|
-
2. Verify models are available:
|
|
915
|
-
```bash
|
|
916
|
-
free-coding-models --openclaw
|
|
917
|
-
```
|
|
918
|
-
|
|
919
|
-
3. Select any model — no more "not allowed" errors!
|
|
920
|
-
|
|
921
|
-
**Why this is needed:** OpenClaw uses a strict allowlist system to prevent typos and invalid models. The `patch-openclaw.js` script populates the allowlist with all known working NVIDIA models, so you can freely switch between them without manually editing config files.
|
|
922
|
-
|
|
923
|
-
---
|
|
924
|
-
|
|
925
|
-
## ⚙️ How it works
|
|
926
|
-
|
|
927
|
-
```
|
|
928
|
-
┌──────────────────────────────────────────────────────────────────┐
|
|
929
|
-
│ 1. Enter alternate screen buffer (like vim/htop/less) │
|
|
930
|
-
│ 2. Ping ALL models in parallel │
|
|
931
|
-
│ 3. Display real-time table with Latest/Avg/Stability/Up% │
|
|
932
|
-
│ 4. Re-ping ALL models at 2s on startup, then 10s steady-state │
|
|
933
|
-
│ and 30s after 5m idle unless forced back to 4s with W │
|
|
934
|
-
│ 5. Update rolling averages + stability scores per model │
|
|
935
|
-
│ 6. User can navigate with ↑↓ and select with Enter │
|
|
936
|
-
│ 7. On Enter (OpenCode): set model, launch OpenCode │
|
|
937
|
-
│ 8. On Enter (OpenClaw): update ~/.openclaw/openclaw.json │
|
|
938
|
-
└──────────────────────────────────────────────────────────────────┘
|
|
939
|
-
```
|
|
940
|
-
|
|
941
|
-
**Result:** Continuous monitoring interface that stays open until you select a model or press Ctrl+C. Rolling averages give you accurate long-term latency data, the stability score reveals which models are truly consistent vs. deceptively spikey, and you can configure your tool of choice with one keystroke. If the terminal is too narrow, the app shows a centered warning instead of a truncated table.
|
|
942
|
-
|
|
943
|
-
---
|
|
944
|
-
|
|
945
|
-
## 📋 API Reference
|
|
946
|
-
|
|
947
|
-
### 🎁 Premium Flag
|
|
948
|
-
|
|
949
|
-
The `--premium` flag provides a quick view of only the elite **S/S+ tier** models with perfect health (**UP**) and a good verdict (**Perfect**, **Normal**, or **Slow**). This is useful when you want to focus exclusively on the highest‑quality, most reliable models that are currently available.
|
|
950
|
-
|
|
951
|
-
```bash
|
|
952
|
-
free-coding-models --premium
|
|
953
|
-
```
|
|
954
|
-
|
|
955
|
-
What it does under the hood:
|
|
956
|
-
- Sets `tierFilter` to `S` (showing only S+ and S tier models).
|
|
957
|
-
- Filters out any model that is not currently **UP** (hides 429, 410, auth fail, timeouts, etc.).
|
|
958
|
-
- Filters out models with poor verdicts (hides **Spiky**, **Very Slow**, **Overloaded**, **Unstable**, etc.).
|
|
959
|
-
- Forces the sort column to `verdict` with ascending order, so the best‑rated models appear at the top.
|
|
960
|
-
- Leaves other settings untouched, so you can still combine it with flags like `--json` for scripting.
|
|
961
|
-
|
|
962
|
-
You can combine `--premium` with other flags (e.g., `--json --hide-unconfigured`) to further tailor the output.
|
|
963
|
-
|
|
964
|
-
---
|
|
965
|
-
|
|
966
|
-
**Environment variables (override config file):**
|
|
967
|
-
|
|
968
|
-
| Variable | Description |
|
|
969
|
-
|----------|-------------|
|
|
970
|
-
| `NVIDIA_API_KEY` | NVIDIA NIM key |
|
|
971
|
-
| `GROQ_API_KEY` | Groq key |
|
|
972
|
-
| `CEREBRAS_API_KEY` | Cerebras key |
|
|
973
|
-
| `SAMBANOVA_API_KEY` | SambaNova key |
|
|
974
|
-
| `OPENROUTER_API_KEY` | OpenRouter key |
|
|
975
|
-
| `HUGGINGFACE_API_KEY` / `HF_TOKEN` | Hugging Face token |
|
|
976
|
-
| `REPLICATE_API_TOKEN` | Replicate token |
|
|
977
|
-
| `DEEPINFRA_API_KEY` / `DEEPINFRA_TOKEN` | DeepInfra key |
|
|
978
|
-
| `CODESTRAL_API_KEY` | Mistral Codestral key |
|
|
979
|
-
| `HYPERBOLIC_API_KEY` | Hyperbolic key |
|
|
980
|
-
| `SCALEWAY_API_KEY` | Scaleway key |
|
|
981
|
-
| `GOOGLE_API_KEY` | Google AI Studio key |
|
|
982
|
-
| `SILICONFLOW_API_KEY` | SiliconFlow key |
|
|
983
|
-
| `TOGETHER_API_KEY` | Together AI key |
|
|
984
|
-
| `CLOUDFLARE_API_TOKEN` / `CLOUDFLARE_API_KEY` | Cloudflare Workers AI token/key |
|
|
985
|
-
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare account ID (required for Workers AI endpoint URL) |
|
|
986
|
-
| `PERPLEXITY_API_KEY` / `PPLX_API_KEY` | Perplexity API key |
|
|
987
|
-
| `ZAI_API_KEY` | ZAI key |
|
|
988
|
-
| `DASHSCOPE_API_KEY` | Alibaba Cloud (DashScope) API key |
|
|
989
|
-
|
|
990
|
-
**Config file:** `~/.free-coding-models.json` (created automatically, permissions `0600`)
|
|
991
|
-
|
|
992
|
-
```json
|
|
993
|
-
{
|
|
994
|
-
"apiKeys": {
|
|
995
|
-
"nvidia": "nvapi-xxx",
|
|
996
|
-
"groq": "gsk_xxx",
|
|
997
|
-
"cerebras": "csk_xxx",
|
|
998
|
-
"openrouter": "sk-or-xxx",
|
|
999
|
-
"huggingface": "hf_xxx",
|
|
1000
|
-
"replicate": "r8_xxx",
|
|
1001
|
-
"deepinfra": "di_xxx",
|
|
1002
|
-
"siliconflow": "sk_xxx",
|
|
1003
|
-
"together": "together_xxx",
|
|
1004
|
-
"cloudflare": "cf_xxx",
|
|
1005
|
-
"perplexity": "pplx_xxx",
|
|
1006
|
-
"zai": "zai-xxx"
|
|
1007
|
-
},
|
|
1008
|
-
"providers": {
|
|
1009
|
-
"nvidia": { "enabled": true },
|
|
1010
|
-
"groq": { "enabled": true },
|
|
1011
|
-
"cerebras": { "enabled": true },
|
|
1012
|
-
"openrouter": { "enabled": true },
|
|
1013
|
-
"huggingface": { "enabled": true },
|
|
1014
|
-
"replicate": { "enabled": true },
|
|
1015
|
-
"deepinfra": { "enabled": true },
|
|
1016
|
-
"siliconflow": { "enabled": true },
|
|
1017
|
-
"together": { "enabled": true },
|
|
1018
|
-
"cloudflare": { "enabled": true },
|
|
1019
|
-
"perplexity": { "enabled": true },
|
|
1020
|
-
"zai": { "enabled": true }
|
|
1021
|
-
},
|
|
1022
|
-
"settings": {
|
|
1023
|
-
"hideUnconfiguredModels": true
|
|
1024
|
-
},
|
|
1025
|
-
"favorites": [
|
|
1026
|
-
"nvidia/deepseek-ai/deepseek-v3.2"
|
|
1027
|
-
]
|
|
1028
|
-
}
|
|
148
|
+
pnpm test:fcm
|
|
149
|
+
pnpm test:fcm:mock
|
|
1029
150
|
```
|
|
1030
151
|
|
|
1031
|
-
|
|
1032
|
-
- **Ping timeout**: 15 seconds per attempt (slow models get more time)
|
|
1033
|
-
- **Ping cadence**: startup burst at 2 seconds for 60s, then 10 seconds normally, 30 seconds when idle for 5 minutes, or forced 4 seconds via `W`
|
|
1034
|
-
- **Monitor mode**: Interface stays open forever, press Ctrl+C to exit
|
|
1035
|
-
|
|
1036
|
-
**Flags:**
|
|
1037
|
-
|
|
1038
|
-
| Flag | Description |
|
|
1039
|
-
|------|-------------|
|
|
1040
|
-
| *(none)* | Start in OpenCode CLI mode |
|
|
1041
|
-
| `--opencode` | OpenCode CLI mode — Enter launches OpenCode CLI with selected model |
|
|
1042
|
-
| `--opencode-desktop` | OpenCode Desktop mode — Enter sets model and opens OpenCode Desktop |
|
|
1043
|
-
| `--openclaw` | OpenClaw mode — Enter sets selected model as default in OpenClaw |
|
|
1044
|
-
| `--crush` | Crush mode — Enter writes `crush.json` and launches Crush |
|
|
1045
|
-
| `--goose` | Goose mode — Enter launches Goose with env-based provider config |
|
|
1046
|
-
| `--best` | Show only top-tier models (A+, S, S+) |
|
|
1047
|
-
| `--fiable` | Analyze 10 seconds, output the most reliable model as `provider/model_id` |
|
|
1048
|
-
| `--json` | Output results as JSON (for scripting/automation, CI/CD, dashboards) |
|
|
1049
|
-
| `--tier S` | Show only S+ and S tier models |
|
|
1050
|
-
| `--tier A` | Show only A+, A, A- tier models |
|
|
1051
|
-
| `--tier B` | Show only B+, B tier models |
|
|
1052
|
-
| `--tier C` | Show only C tier models |
|
|
1053
|
-
| `--profile <name>` | Load a saved config profile on startup |
|
|
1054
|
-
| `--recommend` | Auto-open Smart Recommend overlay on start |
|
|
1055
|
-
| `--clean-proxy` | Remove persisted `fcm-proxy` config from OpenCode |
|
|
1056
|
-
|
|
1057
|
-
**Keyboard shortcuts (main TUI):**
|
|
1058
|
-
- **↑↓** — Navigate models
|
|
1059
|
-
- **Enter** — Select model and launch the current target tool from the header badge
|
|
1060
|
-
- **R/S/C/M/O/L/A/H/V/B/U/G** — Sort by Rank/SWE/Ctx/Model/Provider/Latest/Avg/Health/Verdict/Stability/Up%/Usage
|
|
1061
|
-
- **F** — Toggle favorite on selected model (⭐ in Model column, pinned at top)
|
|
1062
|
-
- **T** — Cycle tier filter (All → S+ → S → A+ → A → A- → B+ → B → C → All)
|
|
1063
|
-
- **D** — Cycle provider filter (All → NIM → Groq → ...)
|
|
1064
|
-
- **E** — Toggle configured-only mode (on by default, persisted across sessions and profiles)
|
|
1065
|
-
- **Z** — Cycle target tool (OpenCode CLI → Desktop → OpenClaw → Crush → Goose → Pi → Aider → Claude Code → Codex → Gemini → Qwen → OpenHands → Amp)
|
|
1066
|
-
- **X** — Toggle request logs (recent proxied request/token usage logs, up to 500 entries)
|
|
1067
|
-
- **A (in logs)** — Toggle between showing 500 entries or ALL logs
|
|
1068
|
-
- **P** — Open Settings (manage API keys, toggles, updates, profiles)
|
|
1069
|
-
- **Y** — Open Install Endpoints (`provider → tool → connection mode → scope → models`, Direct or FCM Proxy V2)
|
|
1070
|
-
- **Shift+P** — Cycle through saved profiles (switches live TUI settings)
|
|
1071
|
-
- **Shift+S** — Save current TUI settings as a named profile (inline prompt)
|
|
1072
|
-
- **Q** — Open Smart Recommend overlay (find the best model for your task)
|
|
1073
|
-
- **N** — Open Changelog overlay (browse index of all versions, `Enter` to view details, `B` to go back)
|
|
1074
|
-
- **W** — Cycle ping mode (`FAST` 2s → `NORMAL` 10s → `SLOW` 30s → `FORCED` 4s)
|
|
1075
|
-
- **J** — Open FCM Proxy V2 settings (shows green "Proxy On" / red "Proxy Off" badge in footer)
|
|
1076
|
-
- **I** — Feedback, bugs & requests
|
|
1077
|
-
- **K / Esc** — Show help overlay / Close overlay
|
|
1078
|
-
- **Ctrl+C** — Exit
|
|
1079
|
-
|
|
1080
|
-
Pressing **K** now shows a full in-app reference: main hotkeys, settings hotkeys, and CLI flags with usage examples.
|
|
1081
|
-
|
|
1082
|
-
### 🔌 Install Endpoints (`Y`)
|
|
1083
|
-
|
|
1084
|
-
`Y` opens a dedicated install flow for configured providers. The 5-step flow is:
|
|
1085
|
-
|
|
1086
|
-
1. **Provider** — Pick one provider that already has an API key in Settings
|
|
1087
|
-
2. **Tool** — Pick the target tool from the compatible install targets:
|
|
1088
|
-
- Config-based: `OpenCode CLI`, `OpenCode Desktop`, `OpenClaw`, `Crush`, `Goose`, `Pi`, `Aider`, `Amp`, `Qwen`
|
|
1089
|
-
- Env-file based: `OpenHands` (writes `~/.fcm-openhands-env` — source it before launching)
|
|
1090
|
-
3. **Connection Mode** — Choose how the tool connects to the provider:
|
|
1091
|
-
- **⚡ Direct Provider** — pure API connection, no proxy involved
|
|
1092
|
-
- **🔄 FCM Proxy V2** — route through FCM Proxy V2 with key rotation and usage tracking
|
|
1093
|
-
4. **Scope** — Choose `Install all models` or `Install selected models only`
|
|
1094
|
-
5. **Models** (if scope = selected) — Multi-select individual models from the provider catalog
|
|
1095
|
-
|
|
1096
|
-
Important behavior:
|
|
1097
|
-
|
|
1098
|
-
- Installs are written into the target tool config as FCM-managed entries (namespaced under `fcm-*`)
|
|
1099
|
-
- `Install all models` is the recommended path because FCM can refresh that catalog automatically on later launches when the provider model list changes
|
|
1100
|
-
- `Install selected models only` is useful when you want a smaller curated picker inside the target tool
|
|
1101
|
-
- `OpenCode CLI` and `OpenCode Desktop` share the same `opencode.json`, so the managed provider appears in both
|
|
1102
|
-
- `Claude Code`, `Codex`, and `Gemini` are launcher-only in this flow for now. Use the normal `Enter` launcher path so FCM can apply the right proxy/runtime contract automatically.
|
|
1103
|
-
- For env-based install targets like `OpenHands`, FCM writes a sourceable helper file at `~/.fcm-{tool}-env`
|
|
1104
|
-
|
|
1105
|
-
**Keyboard shortcuts (Settings screen — `P` key):**
|
|
1106
|
-
- **↑↓** — Navigate providers, maintenance row, and profile rows
|
|
1107
|
-
- **Enter** — Edit API key inline, check/install update, or load a profile
|
|
1108
|
-
- **Space** — Toggle provider enabled/disabled
|
|
1109
|
-
- **T** — Test current provider's API key (fires a live ping)
|
|
1110
|
-
- **U** — Check for updates manually from settings
|
|
1111
|
-
- **Backspace** — Delete the selected profile (only on profile rows)
|
|
1112
|
-
- **Esc** — Close settings and return to main TUI
|
|
1113
|
-
|
|
1114
|
-
---
|
|
1115
|
-
|
|
1116
|
-
### 📋 Config Profiles
|
|
152
|
+
`pnpm test:fcm:mock` uses the mock `crush` binary in `test/fixtures/mock-bin` so maintainers can validate the TUI → launcher plumbing without a real external CLI installed.
|
|
1117
153
|
|
|
1118
|
-
|
|
154
|
+
## Development
|
|
1119
155
|
|
|
1120
|
-
|
|
1121
|
-
- Favorites (starred models)
|
|
1122
|
-
- Sort column and direction
|
|
1123
|
-
- Tier filter
|
|
1124
|
-
- Ping mode
|
|
1125
|
-
- Configured-only filter
|
|
1126
|
-
- API keys
|
|
1127
|
-
|
|
1128
|
-
**Saving a profile:**
|
|
1129
|
-
1. Configure the TUI the way you want (favorites, sort, tier, etc.)
|
|
1130
|
-
2. Press **Shift+S** — an inline prompt appears at the bottom
|
|
1131
|
-
3. Type a name (e.g. `work`, `fast-only`, `presentation`) and press **Enter**
|
|
1132
|
-
4. The profile is saved and becomes the active profile (shown as a purple badge in the header)
|
|
1133
|
-
|
|
1134
|
-
**Switching profiles:**
|
|
1135
|
-
- **Shift+P** in the main table — cycles through saved profiles (or back to raw config)
|
|
1136
|
-
- **`--profile <name>`** — load a specific profile on startup
|
|
1137
|
-
|
|
1138
|
-
**Managing profiles:**
|
|
1139
|
-
- Open Settings (**P** key) — scroll down to the **Profiles** section
|
|
1140
|
-
- **Enter** on a profile row to load it
|
|
1141
|
-
- While a profile is active, edits to favorites and API keys update that active profile immediately
|
|
1142
|
-
- **Backspace** on a profile row to delete it
|
|
1143
|
-
|
|
1144
|
-
Profiles are stored inside `~/.free-coding-models.json` under the `profiles` key.
|
|
1145
|
-
|
|
1146
|
-
---
|
|
1147
|
-
|
|
1148
|
-
## 🔧 Development
|
|
156
|
+
Run the unit tests:
|
|
1149
157
|
|
|
1150
158
|
```bash
|
|
1151
|
-
|
|
1152
|
-
cd free-coding-models
|
|
1153
|
-
npm install
|
|
1154
|
-
npm start -- YOUR_API_KEY
|
|
159
|
+
pnpm test
|
|
1155
160
|
```
|
|
1156
161
|
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
1. Make your changes and commit them with a descriptive message
|
|
1160
|
-
2. Update `CHANGELOG.md` with the new version entry
|
|
1161
|
-
3. Bump `"version"` in `package.json` (e.g. `0.1.3` → `0.1.4`)
|
|
1162
|
-
4. Commit with **just the version number** as the message:
|
|
162
|
+
Run the app locally:
|
|
1163
163
|
|
|
1164
164
|
```bash
|
|
1165
|
-
|
|
1166
|
-
git commit -m "0.1.4"
|
|
1167
|
-
git push
|
|
165
|
+
pnpm start
|
|
1168
166
|
```
|
|
1169
167
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
---
|
|
1173
|
-
|
|
1174
|
-
## 📄 License
|
|
1175
|
-
|
|
1176
|
-
MIT © [vava](https://github.com/vava-nessa)
|
|
1177
|
-
|
|
1178
|
-
---
|
|
1179
|
-
|
|
1180
|
-
<p align="center">
|
|
1181
|
-
<sub>Built with ☕ and 🌹 by <a href="https://github.com/vava-nessa">vava</a></sub>
|
|
1182
|
-
</p>
|
|
1183
|
-
|
|
1184
|
-
## 📬 Contribute
|
|
1185
|
-
We welcome contributions! Feel free to open issues, submit pull requests, or get involved in the project.
|
|
1186
|
-
|
|
1187
|
-
**Q:** Can I use this with other providers?
|
|
1188
|
-
**A:** Yes, the tool is designed to be extensible; see the source for examples of customizing endpoints.
|
|
1189
|
-
|
|
1190
|
-
**Q:** How accurate are the latency numbers?
|
|
1191
|
-
**A:** They represent average round-trip times measured during testing; actual performance may vary based on network conditions.
|
|
1192
|
-
|
|
1193
|
-
**Q:** Do I need to download models locally for OpenClaw?
|
|
1194
|
-
**A:** No — `free-coding-models` configures OpenClaw to use NVIDIA NIM's remote API, so models run on NVIDIA's infrastructure. No GPU or local setup required.
|
|
168
|
+
## Architecture Notes
|
|
1195
169
|
|
|
1196
|
-
|
|
170
|
+
- Main CLI entrypoint: [`bin/free-coding-models.js`](./bin/free-coding-models.js)
|
|
171
|
+
- Pure helpers and sorting logic: [`src/utils.js`](./src/utils.js)
|
|
172
|
+
- OpenCode launch/config helpers: [`src/opencode.js`](./src/opencode.js), [`src/opencode-config.js`](./src/opencode-config.js)
|
|
173
|
+
- External tool launchers: [`src/tool-launchers.js`](./src/tool-launchers.js)
|
|
174
|
+
- Endpoint installer flow: [`src/endpoint-installer.js`](./src/endpoint-installer.js)
|
|
1197
175
|
|
|
1198
|
-
|
|
176
|
+
## Current Status
|
|
1199
177
|
|
|
1200
|
-
|
|
178
|
+
The app surface is intentionally narrowed right now to keep releases stable:
|
|
1201
179
|
|
|
1202
|
-
|
|
180
|
+
- direct provider launches are the supported path
|
|
181
|
+
- the old cross-tool proxy stack has been removed from the app
|
|
182
|
+
- Claude Code, Codex, and Gemini stay hidden until the rewrite is production-ready
|
|
1203
183
|
|
|
1204
|
-
|
|
1205
|
-
<sub>We collect anonymous usage data to improve the tool and fix bugs. No personal information is ever collected.</sub>
|
|
1206
|
-
</p>
|
|
184
|
+
When that rewrite lands, it should come back as a separate, cleaner system rather than more patches on the old one.
|