free-coding-models 0.1.67 → 0.1.68
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 +81 -15
- package/bin/free-coding-models.js +780 -53
- package/lib/config.js +164 -3
- package/lib/utils.js +172 -5
- package/package.json +1 -1
- package/sources.js +17 -0
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
<p align="center">
|
|
26
26
|
<strong>Find the fastest coding LLM models in seconds</strong><br>
|
|
27
|
-
<sub>Ping free coding models from
|
|
27
|
+
<sub>Ping free coding models from 18 providers in real-time — pick the best one for OpenCode, OpenClaw, or any AI coding assistant</sub>
|
|
28
28
|
</p>
|
|
29
29
|
|
|
30
30
|
<p align="center">
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
## ✨ Features
|
|
50
50
|
|
|
51
51
|
- **🎯 Coding-focused** — Only LLM models optimized for code generation, not chat or vision
|
|
52
|
-
- **🌐 Multi-provider** —
|
|
52
|
+
- **🌐 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, and ZAI
|
|
53
53
|
- **⚙️ Settings screen** — Press `P` to manage provider API keys, enable/disable providers, test keys live, and manually check/install updates
|
|
54
54
|
- **🚀 Parallel pings** — All models tested simultaneously via native `fetch`
|
|
55
55
|
- **📊 Real-time animation** — Watch latency appear live in alternate screen buffer
|
|
@@ -95,6 +95,7 @@ Before using `free-coding-models`, make sure you have:
|
|
|
95
95
|
- **Together AI** — [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) → API Keys (credits/promotions vary)
|
|
96
96
|
- **Cloudflare Workers AI** — [dash.cloudflare.com](https://dash.cloudflare.com) → Create API token + set `CLOUDFLARE_ACCOUNT_ID` (Free: 10k neurons/day)
|
|
97
97
|
- **Perplexity API** — [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api) → API Key (tiered limits by spend)
|
|
98
|
+
- **ZAI** — [z.ai](https://z.ai) → Get API key (Coding Plan subscription)
|
|
98
99
|
3. **OpenCode** *(optional)* — [Install OpenCode](https://github.com/opencode-ai/opencode) to use the OpenCode integration
|
|
99
100
|
4. **OpenClaw** *(optional)* — [Install OpenClaw](https://openclaw.ai) to use the OpenClaw integration
|
|
100
101
|
|
|
@@ -179,13 +180,13 @@ When you run `free-coding-models` without `--opencode` or `--openclaw`, you get
|
|
|
179
180
|
Use `↑↓` arrows to select, `Enter` to confirm. Then the TUI launches with your chosen mode shown in the header badge.
|
|
180
181
|
|
|
181
182
|
**How it works:**
|
|
182
|
-
1. **Ping phase** — All enabled models are pinged in parallel (up to
|
|
183
|
-
2. **Continuous monitoring** — Models are re-pinged every
|
|
183
|
+
1. **Ping phase** — All enabled models are pinged in parallel (up to 139 across 18 providers)
|
|
184
|
+
2. **Continuous monitoring** — Models are re-pinged every 60 seconds forever
|
|
184
185
|
3. **Real-time updates** — Watch "Latest", "Avg", and "Up%" columns update live
|
|
185
186
|
4. **Select anytime** — Use ↑↓ arrows to navigate, press Enter on a model to act
|
|
186
187
|
5. **Smart detection** — Automatically detects if NVIDIA NIM is configured in OpenCode or OpenClaw
|
|
187
188
|
|
|
188
|
-
Setup wizard (first run — walks through all
|
|
189
|
+
Setup wizard (first run — walks through all 18 providers):
|
|
189
190
|
|
|
190
191
|
```
|
|
191
192
|
🔑 First-time setup — API keys
|
|
@@ -268,6 +269,7 @@ SILICONFLOW_API_KEY=sk_xxx free-coding-models
|
|
|
268
269
|
TOGETHER_API_KEY=together_xxx free-coding-models
|
|
269
270
|
CLOUDFLARE_API_TOKEN=cf_xxx CLOUDFLARE_ACCOUNT_ID=your_account_id free-coding-models
|
|
270
271
|
PERPLEXITY_API_KEY=pplx_xxx free-coding-models
|
|
272
|
+
ZAI_API_KEY=zai-xxx free-coding-models
|
|
271
273
|
FREE_CODING_MODELS_TELEMETRY=0 free-coding-models
|
|
272
274
|
```
|
|
273
275
|
|
|
@@ -350,13 +352,24 @@ When enabled, telemetry events include: event name, app version, selected mode,
|
|
|
350
352
|
1. Sign up at [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api)
|
|
351
353
|
2. Create API key (`PERPLEXITY_API_KEY`)
|
|
352
354
|
|
|
353
|
-
|
|
355
|
+
**ZAI** (5 models, GLM family):
|
|
356
|
+
1. Sign up at [z.ai](https://z.ai)
|
|
357
|
+
2. Subscribe to Coding Plan
|
|
358
|
+
3. Get API key from dashboard
|
|
359
|
+
|
|
360
|
+
> 💡 **Free tiers** — each provider exposes a dev/free tier with its own quotas. ZAI requires a Coding Plan subscription.
|
|
354
361
|
|
|
355
362
|
---
|
|
356
363
|
|
|
357
364
|
## 🤖 Coding Models
|
|
358
365
|
|
|
359
|
-
**
|
|
366
|
+
**139 coding models** across 18 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.
|
|
367
|
+
|
|
368
|
+
### ZAI Coding Plan (5 models)
|
|
369
|
+
|
|
370
|
+
| Tier | SWE-bench | Model |
|
|
371
|
+
|------|-----------|-------|
|
|
372
|
+
| **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%) |
|
|
360
373
|
|
|
361
374
|
### NVIDIA NIM (44 models)
|
|
362
375
|
|
|
@@ -528,6 +541,18 @@ You can force a specific port:
|
|
|
528
541
|
OPENCODE_PORT=4098 free-coding-models --opencode
|
|
529
542
|
```
|
|
530
543
|
|
|
544
|
+
### ZAI provider proxy
|
|
545
|
+
|
|
546
|
+
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.
|
|
547
|
+
|
|
548
|
+
**How it works:**
|
|
549
|
+
1. A localhost HTTP proxy starts on a random available port
|
|
550
|
+
2. OpenCode is configured with a `zai` provider pointing at `http://localhost:<port>/v1`
|
|
551
|
+
3. The proxy rewrites `/v1/models` to `/api/coding/paas/v4/models` and `/v1/chat/completions` to `/api/coding/paas/v4/chat/completions`
|
|
552
|
+
4. When OpenCode exits, the proxy shuts down automatically
|
|
553
|
+
|
|
554
|
+
No manual configuration needed -- the proxy lifecycle is managed entirely by `free-coding-models`.
|
|
555
|
+
|
|
531
556
|
### Manual OpenCode Setup (Optional)
|
|
532
557
|
|
|
533
558
|
Create or edit `~/.config/opencode/opencode.json`:
|
|
@@ -682,7 +707,7 @@ This script:
|
|
|
682
707
|
│ 1. Enter alternate screen buffer (like vim/htop/less) │
|
|
683
708
|
│ 2. Ping ALL models in parallel │
|
|
684
709
|
│ 3. Display real-time table with Latest/Avg/Stability/Up% │
|
|
685
|
-
│ 4. Re-ping ALL models every
|
|
710
|
+
│ 4. Re-ping ALL models every 60 seconds (forever) │
|
|
686
711
|
│ 5. Update rolling averages + stability scores per model │
|
|
687
712
|
│ 6. User can navigate with ↑↓ and select with Enter │
|
|
688
713
|
│ 7. On Enter (OpenCode): set model, launch OpenCode │
|
|
@@ -717,6 +742,7 @@ This script:
|
|
|
717
742
|
| `CLOUDFLARE_API_TOKEN` / `CLOUDFLARE_API_KEY` | Cloudflare Workers AI token/key |
|
|
718
743
|
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare account ID (required for Workers AI endpoint URL) |
|
|
719
744
|
| `PERPLEXITY_API_KEY` / `PPLX_API_KEY` | Perplexity API key |
|
|
745
|
+
| `ZAI_API_KEY` | ZAI key |
|
|
720
746
|
| `FREE_CODING_MODELS_TELEMETRY` | `0` disables analytics, `1` enables analytics |
|
|
721
747
|
| `FREE_CODING_MODELS_POSTHOG_KEY` | PostHog project API key used for anonymous event capture |
|
|
722
748
|
| `FREE_CODING_MODELS_POSTHOG_HOST` | Optional PostHog ingest host (`https://eu.i.posthog.com` default) |
|
|
@@ -736,7 +762,8 @@ This script:
|
|
|
736
762
|
"siliconflow": "sk_xxx",
|
|
737
763
|
"together": "together_xxx",
|
|
738
764
|
"cloudflare": "cf_xxx",
|
|
739
|
-
"perplexity": "pplx_xxx"
|
|
765
|
+
"perplexity": "pplx_xxx",
|
|
766
|
+
"zai": "zai-xxx"
|
|
740
767
|
},
|
|
741
768
|
"providers": {
|
|
742
769
|
"nvidia": { "enabled": true },
|
|
@@ -749,7 +776,8 @@ This script:
|
|
|
749
776
|
"siliconflow": { "enabled": true },
|
|
750
777
|
"together": { "enabled": true },
|
|
751
778
|
"cloudflare": { "enabled": true },
|
|
752
|
-
"perplexity": { "enabled": true }
|
|
779
|
+
"perplexity": { "enabled": true },
|
|
780
|
+
"zai": { "enabled": true }
|
|
753
781
|
},
|
|
754
782
|
"favorites": [
|
|
755
783
|
"nvidia/deepseek-ai/deepseek-v3.2"
|
|
@@ -764,7 +792,7 @@ This script:
|
|
|
764
792
|
|
|
765
793
|
**Configuration:**
|
|
766
794
|
- **Ping timeout**: 15 seconds per attempt (slow models get more time)
|
|
767
|
-
- **Ping interval**:
|
|
795
|
+
- **Ping interval**: 60 seconds between complete re-pings of all models (adjustable with W/X keys)
|
|
768
796
|
- **Monitor mode**: Interface stays open forever, press Ctrl+C to exit
|
|
769
797
|
|
|
770
798
|
**Flags:**
|
|
@@ -782,6 +810,8 @@ This script:
|
|
|
782
810
|
| `--tier A` | Show only A+, A, A- tier models |
|
|
783
811
|
| `--tier B` | Show only B+, B tier models |
|
|
784
812
|
| `--tier C` | Show only C tier models |
|
|
813
|
+
| `--profile <name>` | Load a saved config profile on startup |
|
|
814
|
+
| `--recommend` | Auto-open Smart Recommend overlay on start |
|
|
785
815
|
|
|
786
816
|
**Keyboard shortcuts (main TUI):**
|
|
787
817
|
- **↑↓** — Navigate models
|
|
@@ -790,7 +820,12 @@ This script:
|
|
|
790
820
|
- **F** — Toggle favorite on selected model (⭐ in Model column, pinned at top)
|
|
791
821
|
- **T** — Cycle tier filter (All → S+ → S → A+ → A → A- → B+ → B → C → All)
|
|
792
822
|
- **Z** — Cycle mode (OpenCode CLI → OpenCode Desktop → OpenClaw)
|
|
793
|
-
- **P** — Open Settings (manage API keys, provider toggles, analytics toggle, manual update)
|
|
823
|
+
- **P** — Open Settings (manage API keys, provider toggles, analytics toggle, manual update, profiles)
|
|
824
|
+
- **Shift+P** — Cycle through saved profiles (switches live TUI settings)
|
|
825
|
+
- **Shift+S** — Save current TUI settings as a named profile (inline prompt)
|
|
826
|
+
- **Q** — Open Smart Recommend overlay (find the best model for your task)
|
|
827
|
+
- **E** — Elevate tier filter (show higher tiers)
|
|
828
|
+
- **D** — Descend tier filter (show lower tiers)
|
|
794
829
|
- **W** — Decrease ping interval (faster pings)
|
|
795
830
|
- **X** — Increase ping interval (slower pings)
|
|
796
831
|
- **K** / **Esc** — Show/hide help overlay
|
|
@@ -799,15 +834,46 @@ This script:
|
|
|
799
834
|
Pressing **K** now shows a full in-app reference: main hotkeys, settings hotkeys, and CLI flags with usage examples.
|
|
800
835
|
|
|
801
836
|
**Keyboard shortcuts (Settings screen — `P` key):**
|
|
802
|
-
- **↑↓** — Navigate providers, analytics row, and
|
|
803
|
-
- **Enter** — Edit API key inline, toggle analytics
|
|
804
|
-
- **Space** — Toggle provider enabled/disabled, or toggle analytics
|
|
837
|
+
- **↑↓** — Navigate providers, analytics row, maintenance row, and profile rows
|
|
838
|
+
- **Enter** — Edit API key inline, toggle analytics, check/install update, or load a profile
|
|
839
|
+
- **Space** — Toggle provider enabled/disabled, or toggle analytics
|
|
805
840
|
- **T** — Test current provider's API key (fires a live ping)
|
|
806
841
|
- **U** — Check for updates manually from settings
|
|
842
|
+
- **Backspace** — Delete the selected profile (only on profile rows)
|
|
807
843
|
- **Esc** — Close settings and return to main TUI
|
|
808
844
|
|
|
809
845
|
---
|
|
810
846
|
|
|
847
|
+
### 📋 Config Profiles
|
|
848
|
+
|
|
849
|
+
Profiles let you save and restore different TUI configurations — useful if you switch between work/personal setups, different tier preferences, or want to keep separate favorites lists.
|
|
850
|
+
|
|
851
|
+
**What's stored in a profile:**
|
|
852
|
+
- Favorites (starred models)
|
|
853
|
+
- Sort column and direction
|
|
854
|
+
- Tier filter
|
|
855
|
+
- Ping interval
|
|
856
|
+
- API keys
|
|
857
|
+
|
|
858
|
+
**Saving a profile:**
|
|
859
|
+
1. Configure the TUI the way you want (favorites, sort, tier, etc.)
|
|
860
|
+
2. Press **Shift+S** — an inline prompt appears at the bottom
|
|
861
|
+
3. Type a name (e.g. `work`, `fast-only`, `presentation`) and press **Enter**
|
|
862
|
+
4. The profile is saved and becomes the active profile (shown as a purple badge in the header)
|
|
863
|
+
|
|
864
|
+
**Switching profiles:**
|
|
865
|
+
- **Shift+P** in the main table — cycles through saved profiles (or back to raw config)
|
|
866
|
+
- **`--profile <name>`** — load a specific profile on startup
|
|
867
|
+
|
|
868
|
+
**Managing profiles:**
|
|
869
|
+
- Open Settings (**P** key) — scroll down to the **Profiles** section
|
|
870
|
+
- **Enter** on a profile row to load it
|
|
871
|
+
- **Backspace** on a profile row to delete it
|
|
872
|
+
|
|
873
|
+
Profiles are stored inside `~/.free-coding-models.json` under the `profiles` key.
|
|
874
|
+
|
|
875
|
+
---
|
|
876
|
+
|
|
811
877
|
## 🔧 Development
|
|
812
878
|
|
|
813
879
|
```bash
|