opencode-jev-model-router 0.1.1 → 0.1.2

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 CHANGED
@@ -20,7 +20,7 @@ Or add it to `~/.config/opencode/opencode.json`:
20
20
  }
21
21
  ```
22
22
 
23
- Pin a version if you prefer: `"opencode-jev-model-router@0.1.0"`.
23
+ Pin a version if you prefer: `"opencode-jev-model-router@0.1.2"`.
24
24
 
25
25
  **2. Add your Jev key** (OpenCode usually does not see shell `export`s)
26
26
 
@@ -29,7 +29,17 @@ printf '%s\n' "$JEV_KEY" > ~/.config/opencode/opencode-jev-router.key
29
29
  chmod 600 ~/.config/opencode/opencode-jev-router.key
30
30
  ```
31
31
 
32
- **3. Optional:** copy [example config](https://github.com/aaronshaf/opencode-jev-model-router/blob/main/opencode-jev-router.example.json) to `~/.config/opencode/opencode-jev-router.json` (defaults work without this).
32
+ **3. Optional config** built-in defaults are **OpenCode Go only** (Muse / DeepSeek Flash / Luna). Copy an example only if you want to change that:
33
+
34
+ ```bash
35
+ # Go-only (same as built-in defaults)
36
+ curl -fsSL https://raw.githubusercontent.com/aaronshaf/opencode-jev-model-router/main/opencode-jev-router.example.json \
37
+ -o ~/.config/opencode/opencode-jev-router.json
38
+
39
+ # Go + Claude + Codex (see below)
40
+ curl -fsSL https://raw.githubusercontent.com/aaronshaf/opencode-jev-model-router/main/opencode-jev-router.go-claude-codex.example.json \
41
+ -o ~/.config/opencode/opencode-jev-router.json
42
+ ```
33
43
 
34
44
  **4. Restart OpenCode**, then check:
35
45
 
@@ -39,13 +49,19 @@ chmod 600 ~/.config/opencode/opencode-jev-router.key
39
49
 
40
50
  You want: `Jev key present; routing ON; …`
41
51
 
52
+ ## How routing picks models
53
+
54
+ Jev chooses a **tier** (`fast` / `balanced` / `strong` / `long`). The plugin then picks the first eligible model from that tier’s `model` + `fallbacks` in the plugin config (or the built-in Go defaults if you have no config file).
55
+
56
+ If your current model is **not** in that list, the turn is **pinned** — no routing. So Claude/Codex only participate after you add them to a tier (or use the example above).
57
+
42
58
  ## Day to day
43
59
 
44
- 1. Select a Go model the router manages (DeepSeek Flash, Muse, Luna, ). Avoid one-off pins like `hy3` if you want routing.
60
+ 1. Start on a **managed** model (one listed in the defaults or your config). Unlisted models pin.
45
61
  2. Chat as usual.
46
62
  3. Watch for a toast such as `Routed to opencode-go/muse-spark-1.3-contributor · jev fast 98% 280ms`.
47
63
 
48
- | Kind of ask | Typical tier | Default model |
64
+ | Kind of ask | Typical tier | Default model (Go) |
49
65
  |---|---|---|
50
66
  | Typo, rename, “say hi” | `fast` | Muse Spark |
51
67
  | Normal feature / fix | `balanced` | DeepSeek V4.1 Flash |
@@ -54,6 +70,12 @@ You want: `Jev key present; routing ON; …`
54
70
 
55
71
  If Jev is unreachable, your current model stays put.
56
72
 
73
+ ### Also using Claude or Codex?
74
+
75
+ Connect them in OpenCode (`/connect`), then use a config that lists those models under a tier — e.g. [opencode-jev-router.go-claude-codex.example.json](./opencode-jev-router.go-claude-codex.example.json): Go stays primary for fast/balanced; `strong` falls back to Sonnet then Codex if Luna is unavailable.
76
+
77
+ Adjust the `anthropic/…` and `openai/…` IDs to whatever `/models` shows for your account.
78
+
57
79
  ### Force a tier in the prompt
58
80
 
59
81
  ```text
@@ -67,7 +89,7 @@ use balanced for this endpoint
67
89
 
68
90
  - `/jev-off` — stay on whatever model you picked
69
91
  - `/jev-on` — turn automatic routing back on
70
- - Or pick an unmanaged model (e.g. `opencode-go/hy3`) to **pin**
92
+ - Or pick an unmanaged model (not in your tier lists) to **pin**
71
93
 
72
94
  ### When a model hits its Go allowance
73
95
 
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://github.com/aaronshaf/opencode-jev-model-router/schemas/config.schema.json",
3
+ "enabled": true,
4
+ "allowProjectModels": false,
5
+ "tiers": {
6
+ "fast": {
7
+ "model": "opencode-go/muse-spark-1.3-contributor",
8
+ "aliases": ["fast", "flash", "muse"],
9
+ "fallbacks": [
10
+ "opencode-go/mimo-v2.5",
11
+ "opencode-go/deepseek-v4.1-flash",
12
+ "opencode-go/glm-5.3-flash"
13
+ ]
14
+ },
15
+ "balanced": {
16
+ "model": "opencode-go/deepseek-v4.1-flash",
17
+ "aliases": ["balanced"],
18
+ "fallbacks": [
19
+ "opencode-go/muse-spark-1.3-contributor",
20
+ "opencode-go/mimo-v2.5",
21
+ "opencode-go/qwen3.7-plus"
22
+ ]
23
+ },
24
+ "strong": {
25
+ "model": "opencode-go/gpt-5.6-luna",
26
+ "aliases": ["strong", "luna", "sonnet", "opus", "codex"],
27
+ "fallbacks": [
28
+ "anthropic/claude-sonnet-4-20250514",
29
+ "openai/gpt-5.1-codex",
30
+ "opencode-go/kimi-k2.7-code",
31
+ "opencode-go/qwen3.7-plus"
32
+ ]
33
+ },
34
+ "long": {
35
+ "model": "opencode-go/kimi-k3",
36
+ "enabled": false,
37
+ "aliases": ["long", "kimi", "k3"],
38
+ "fallbacks": ["opencode-go/kimi-k2.7-code"]
39
+ }
40
+ },
41
+ "routing": {
42
+ "failOpen": true,
43
+ "maxPromptBytes": 16384,
44
+ "timeoutMs": 1500,
45
+ "deadlineMs": 3000,
46
+ "maxRetries": 1,
47
+ "minimumConfidence": 0.3,
48
+ "uncertainCeiling": "balanced",
49
+ "downgradeMaxContextTokens": 20000
50
+ },
51
+ "quota": {
52
+ "cooldownHours": 5
53
+ },
54
+ "history": {
55
+ "enabled": true,
56
+ "retainPrompt": false,
57
+ "maxEntries": 20
58
+ },
59
+ "echoRouting": true
60
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-jev-model-router",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Jev-based automatic per-turn model routing for OpenCode",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,6 +22,7 @@
22
22
  "dist",
23
23
  "schemas",
24
24
  "opencode-jev-router.example.json",
25
+ "opencode-jev-router.go-claude-codex.example.json",
25
26
  "README.md",
26
27
  "LICENSE"
27
28
  ],