opencode-jev-model-router 0.1.1 → 0.1.4

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.4"`.
24
24
 
25
25
  **2. Add your Jev key** (OpenCode usually does not see shell `export`s)
26
26
 
@@ -29,7 +29,27 @@ 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**. Pick an example that matches how you use OpenCode:
33
+
34
+ ```bash
35
+ BASE=https://raw.githubusercontent.com/aaronshaf/opencode-jev-model-router/main
36
+ DEST=~/.config/opencode/opencode-jev-router.json
37
+
38
+ # Go only (same as built-in defaults)
39
+ curl -fsSL "$BASE/opencode-jev-router.example.json" -o "$DEST"
40
+
41
+ # Go + Claude
42
+ curl -fsSL "$BASE/opencode-jev-router.go-claude.example.json" -o "$DEST"
43
+
44
+ # Go + Codex
45
+ curl -fsSL "$BASE/opencode-jev-router.go-codex.example.json" -o "$DEST"
46
+
47
+ # Claude only (no Go)
48
+ curl -fsSL "$BASE/opencode-jev-router.claude.example.json" -o "$DEST"
49
+
50
+ # Codex / OpenAI only (no Go)
51
+ curl -fsSL "$BASE/opencode-jev-router.codex.example.json" -o "$DEST"
52
+ ```
33
53
 
34
54
  **4. Restart OpenCode**, then check:
35
55
 
@@ -39,13 +59,19 @@ chmod 600 ~/.config/opencode/opencode-jev-router.key
39
59
 
40
60
  You want: `Jev key present; routing ON; …`
41
61
 
62
+ ## How routing picks models
63
+
64
+ 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).
65
+
66
+ If your current model is **not** in that list, the turn is **pinned** — no routing. So Claude or Codex only participate after you add them to a tier (or use an example above).
67
+
42
68
  ## Day to day
43
69
 
44
- 1. Select a Go model the router manages (DeepSeek Flash, Muse, Luna, ). Avoid one-off pins like `hy3` if you want routing.
70
+ 1. Start on a **managed** model (one listed in the defaults or your config). Unlisted models pin.
45
71
  2. Chat as usual.
46
72
  3. Watch for a toast such as `Routed to opencode-go/muse-spark-1.3-contributor · jev fast 98% 280ms`.
47
73
 
48
- | Kind of ask | Typical tier | Default model |
74
+ | Kind of ask | Typical tier | Default model (Go) |
49
75
  |---|---|---|
50
76
  | Typo, rename, “say hi” | `fast` | Muse Spark |
51
77
  | Normal feature / fix | `balanced` | DeepSeek V4.1 Flash |
@@ -54,6 +80,20 @@ You want: `Jev key present; routing ON; …`
54
80
 
55
81
  If Jev is unreachable, your current model stays put.
56
82
 
83
+ ### Also using Claude or Codex?
84
+
85
+ Connect providers with `/connect`, then pick a config that lists those models (otherwise they **pin** and won’t route):
86
+
87
+ | Setup | Example |
88
+ |---|---|
89
+ | Go only | [opencode-jev-router.example.json](./opencode-jev-router.example.json) (or skip config — built-in) |
90
+ | Go + Claude | [opencode-jev-router.go-claude.example.json](./opencode-jev-router.go-claude.example.json) |
91
+ | Go + Codex | [opencode-jev-router.go-codex.example.json](./opencode-jev-router.go-codex.example.json) |
92
+ | Claude only | [opencode-jev-router.claude.example.json](./opencode-jev-router.claude.example.json) |
93
+ | Codex / OpenAI only | [opencode-jev-router.codex.example.json](./opencode-jev-router.codex.example.json) |
94
+
95
+ Adjust model IDs to whatever `/models` shows for your account.
96
+
57
97
  ### Force a tier in the prompt
58
98
 
59
99
  ```text
@@ -67,7 +107,7 @@ use balanced for this endpoint
67
107
 
68
108
  - `/jev-off` — stay on whatever model you picked
69
109
  - `/jev-on` — turn automatic routing back on
70
- - Or pick an unmanaged model (e.g. `opencode-go/hy3`) to **pin**
110
+ - Or pick an unmanaged model (not in your tier lists) to **pin**
71
111
 
72
112
  ### When a model hits its Go allowance
73
113
 
@@ -0,0 +1,47 @@
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": "anthropic/claude-haiku-4-20250514",
8
+ "aliases": ["fast", "flash", "haiku"],
9
+ "fallbacks": ["anthropic/claude-sonnet-4-20250514"]
10
+ },
11
+ "balanced": {
12
+ "model": "anthropic/claude-sonnet-4-20250514",
13
+ "aliases": ["balanced", "sonnet"],
14
+ "fallbacks": ["anthropic/claude-opus-4-20250514"]
15
+ },
16
+ "strong": {
17
+ "model": "anthropic/claude-opus-4-20250514",
18
+ "aliases": ["strong", "opus", "claude"],
19
+ "fallbacks": ["anthropic/claude-sonnet-4-20250514"]
20
+ },
21
+ "long": {
22
+ "model": "anthropic/claude-opus-4-20250514",
23
+ "enabled": false,
24
+ "aliases": ["long"],
25
+ "fallbacks": ["anthropic/claude-sonnet-4-20250514"]
26
+ }
27
+ },
28
+ "routing": {
29
+ "failOpen": true,
30
+ "maxPromptBytes": 16384,
31
+ "timeoutMs": 1500,
32
+ "deadlineMs": 3000,
33
+ "maxRetries": 1,
34
+ "minimumConfidence": 0.3,
35
+ "uncertainCeiling": "balanced",
36
+ "downgradeMaxContextTokens": 20000
37
+ },
38
+ "quota": {
39
+ "cooldownHours": 5
40
+ },
41
+ "history": {
42
+ "enabled": true,
43
+ "retainPrompt": false,
44
+ "maxEntries": 20
45
+ },
46
+ "echoRouting": true
47
+ }
@@ -0,0 +1,47 @@
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": "openai/gpt-5-mini",
8
+ "aliases": ["fast", "flash", "mini"],
9
+ "fallbacks": ["openai/gpt-5.1-codex"]
10
+ },
11
+ "balanced": {
12
+ "model": "openai/gpt-5.1-codex",
13
+ "aliases": ["balanced", "codex"],
14
+ "fallbacks": ["openai/gpt-5.2"]
15
+ },
16
+ "strong": {
17
+ "model": "openai/gpt-5.2",
18
+ "aliases": ["strong"],
19
+ "fallbacks": ["openai/gpt-5.1-codex"]
20
+ },
21
+ "long": {
22
+ "model": "openai/gpt-5.2",
23
+ "enabled": false,
24
+ "aliases": ["long"],
25
+ "fallbacks": ["openai/gpt-5.1-codex"]
26
+ }
27
+ },
28
+ "routing": {
29
+ "failOpen": true,
30
+ "maxPromptBytes": 16384,
31
+ "timeoutMs": 1500,
32
+ "deadlineMs": 3000,
33
+ "maxRetries": 1,
34
+ "minimumConfidence": 0.3,
35
+ "uncertainCeiling": "balanced",
36
+ "downgradeMaxContextTokens": 20000
37
+ },
38
+ "quota": {
39
+ "cooldownHours": 5
40
+ },
41
+ "history": {
42
+ "enabled": true,
43
+ "retainPrompt": false,
44
+ "maxEntries": 20
45
+ },
46
+ "echoRouting": true
47
+ }
@@ -0,0 +1,59 @@
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", "claude"],
27
+ "fallbacks": [
28
+ "anthropic/claude-sonnet-4-20250514",
29
+ "opencode-go/kimi-k2.7-code",
30
+ "opencode-go/qwen3.7-plus"
31
+ ]
32
+ },
33
+ "long": {
34
+ "model": "opencode-go/kimi-k3",
35
+ "enabled": false,
36
+ "aliases": ["long", "kimi", "k3"],
37
+ "fallbacks": ["opencode-go/kimi-k2.7-code"]
38
+ }
39
+ },
40
+ "routing": {
41
+ "failOpen": true,
42
+ "maxPromptBytes": 16384,
43
+ "timeoutMs": 1500,
44
+ "deadlineMs": 3000,
45
+ "maxRetries": 1,
46
+ "minimumConfidence": 0.3,
47
+ "uncertainCeiling": "balanced",
48
+ "downgradeMaxContextTokens": 20000
49
+ },
50
+ "quota": {
51
+ "cooldownHours": 5
52
+ },
53
+ "history": {
54
+ "enabled": true,
55
+ "retainPrompt": false,
56
+ "maxEntries": 20
57
+ },
58
+ "echoRouting": true
59
+ }
@@ -0,0 +1,59 @@
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", "codex"],
27
+ "fallbacks": [
28
+ "openai/gpt-5.1-codex",
29
+ "opencode-go/kimi-k2.7-code",
30
+ "opencode-go/qwen3.7-plus"
31
+ ]
32
+ },
33
+ "long": {
34
+ "model": "opencode-go/kimi-k3",
35
+ "enabled": false,
36
+ "aliases": ["long", "kimi", "k3"],
37
+ "fallbacks": ["opencode-go/kimi-k2.7-code"]
38
+ }
39
+ },
40
+ "routing": {
41
+ "failOpen": true,
42
+ "maxPromptBytes": 16384,
43
+ "timeoutMs": 1500,
44
+ "deadlineMs": 3000,
45
+ "maxRetries": 1,
46
+ "minimumConfidence": 0.3,
47
+ "uncertainCeiling": "balanced",
48
+ "downgradeMaxContextTokens": 20000
49
+ },
50
+ "quota": {
51
+ "cooldownHours": 5
52
+ },
53
+ "history": {
54
+ "enabled": true,
55
+ "retainPrompt": false,
56
+ "maxEntries": 20
57
+ },
58
+ "echoRouting": true
59
+ }
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.4",
4
4
  "description": "Jev-based automatic per-turn model routing for OpenCode",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,6 +22,10 @@
22
22
  "dist",
23
23
  "schemas",
24
24
  "opencode-jev-router.example.json",
25
+ "opencode-jev-router.go-claude.example.json",
26
+ "opencode-jev-router.go-codex.example.json",
27
+ "opencode-jev-router.claude.example.json",
28
+ "opencode-jev-router.codex.example.json",
25
29
  "README.md",
26
30
  "LICENSE"
27
31
  ],