opencode-jev-model-router 0.1.2 → 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 +29 -11
- package/opencode-jev-router.claude.example.json +47 -0
- package/opencode-jev-router.codex.example.json +47 -0
- package/{opencode-jev-router.go-claude-codex.example.json → opencode-jev-router.go-claude.example.json} +1 -2
- package/opencode-jev-router.go-codex.example.json +59 -0
- package/package.json +5 -2
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.
|
|
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,16 +29,26 @@ 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 config** — built-in defaults are **OpenCode Go only
|
|
32
|
+
**3. Optional config** — built-in defaults are **OpenCode Go only**. Pick an example that matches how you use OpenCode:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-o ~/.config/opencode/opencode-jev-router.json
|
|
35
|
+
BASE=https://raw.githubusercontent.com/aaronshaf/opencode-jev-model-router/main
|
|
36
|
+
DEST=~/.config/opencode/opencode-jev-router.json
|
|
38
37
|
|
|
39
|
-
# Go
|
|
40
|
-
curl -fsSL
|
|
41
|
-
|
|
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"
|
|
42
52
|
```
|
|
43
53
|
|
|
44
54
|
**4. Restart OpenCode**, then check:
|
|
@@ -53,7 +63,7 @@ You want: `Jev key present; routing ON; …`
|
|
|
53
63
|
|
|
54
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).
|
|
55
65
|
|
|
56
|
-
If your current model is **not** in that list, the turn is **pinned** — no routing. So Claude
|
|
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).
|
|
57
67
|
|
|
58
68
|
## Day to day
|
|
59
69
|
|
|
@@ -72,9 +82,17 @@ If Jev is unreachable, your current model stays put.
|
|
|
72
82
|
|
|
73
83
|
### Also using Claude or Codex?
|
|
74
84
|
|
|
75
|
-
Connect
|
|
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) |
|
|
76
94
|
|
|
77
|
-
Adjust
|
|
95
|
+
Adjust model IDs to whatever `/models` shows for your account.
|
|
78
96
|
|
|
79
97
|
### Force a tier in the prompt
|
|
80
98
|
|
|
@@ -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
|
+
}
|
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"strong": {
|
|
25
25
|
"model": "opencode-go/gpt-5.6-luna",
|
|
26
|
-
"aliases": ["strong", "luna", "sonnet", "opus", "
|
|
26
|
+
"aliases": ["strong", "luna", "sonnet", "opus", "claude"],
|
|
27
27
|
"fallbacks": [
|
|
28
28
|
"anthropic/claude-sonnet-4-20250514",
|
|
29
|
-
"openai/gpt-5.1-codex",
|
|
30
29
|
"opencode-go/kimi-k2.7-code",
|
|
31
30
|
"opencode-go/qwen3.7-plus"
|
|
32
31
|
]
|
|
@@ -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.
|
|
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,7 +22,10 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"schemas",
|
|
24
24
|
"opencode-jev-router.example.json",
|
|
25
|
-
"opencode-jev-router.go-claude
|
|
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",
|
|
26
29
|
"README.md",
|
|
27
30
|
"LICENSE"
|
|
28
31
|
],
|