opencode-peak-scheduler 0.1.1 → 0.1.3
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 +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ plugin API and the session-model lever were confirmed against that source (see
|
|
|
12
12
|
|
|
13
13
|
| Window | Model | When |
|
|
14
14
|
| -------- | ----------------------------- | ------------------------------------------ |
|
|
15
|
-
| Peak | `deepseek/deepseek-
|
|
15
|
+
| Peak | `deepseek/deepseek-flash` | Mon–Fri 09:00–12:00 and 14:00–18:00 |
|
|
16
16
|
| Off-peak | `deepseek/deepseek-v4-pro` | Everything else + weekends (Sat & Sun) |
|
|
17
17
|
|
|
18
18
|
Half-open intervals `[start, end)`. Weekday means Monday–Friday in the
|
|
@@ -41,7 +41,7 @@ adds one pseudo-model, `auto`, which becomes the default model:
|
|
|
41
41
|
"baseURL": "https://api.deepseek.com",
|
|
42
42
|
"apiKey": "…",
|
|
43
43
|
"scheduler": {
|
|
44
|
-
"peakModel": "deepseek-
|
|
44
|
+
"peakModel": "deepseek-flash",
|
|
45
45
|
"offModel": "deepseek-v4-pro",
|
|
46
46
|
"timezone": "Asia/Shanghai",
|
|
47
47
|
"autoID": "auto"
|
|
@@ -49,7 +49,7 @@ adds one pseudo-model, `auto`, which becomes the default model:
|
|
|
49
49
|
},
|
|
50
50
|
"models": {
|
|
51
51
|
"deepseek-v4-pro": { "name": "DeepSeek-V4-Pro" },
|
|
52
|
-
"deepseek-
|
|
52
|
+
"deepseek-flash": { "name": "deepseek-flash" },
|
|
53
53
|
"auto": {
|
|
54
54
|
"name": "Auto (peak-aware)",
|
|
55
55
|
"limit": { "context": 1048576, "output": 393216 }
|
|
@@ -102,12 +102,12 @@ rate). Configure the **off-peak** per-1M-token prices on the model entries in
|
|
|
102
102
|
`https://api-docs.deepseek.com/quick_start/pricing/`):
|
|
103
103
|
|
|
104
104
|
"deepseek-v4-pro": { "cost": { "input": 0.66, "output": 1.98, "cache": { "read": 0.022, "write": 0 } } },
|
|
105
|
-
"deepseek-
|
|
105
|
+
"deepseek-flash": { "cost": { "input": 0.15, "output": 0.6, "cache": { "read": 0.003, "write": 0 } } }
|
|
106
106
|
|
|
107
107
|
`input` is the cache-miss price, `cache.read` the cache-hit price, and
|
|
108
108
|
`cache.write` is 0 (DeepSeek doesn't charge for cache writes). DeepSeek's peak
|
|
109
109
|
hours (`01:00–04:00` and `06:00–10:00` UTC) are exactly the plugin's peak
|
|
110
|
-
windows, so during peak the plugin routes to `deepseek-
|
|
110
|
+
windows, so during peak the plugin routes to `deepseek-flash` at 2× and
|
|
111
111
|
off-peak to `deepseek-v4-pro` at 1×. The estimate is accurate to the 30s check
|
|
112
112
|
interval; in manual mode opencode prices the real model itself, so the plugin
|
|
113
113
|
hides the line.
|
|
@@ -138,7 +138,7 @@ The sidebar also shows a `Balance:` line — the account's current DeepSeek
|
|
|
138
138
|
balance, fetched via `GET /user/balance` (see
|
|
139
139
|
`https://api-docs.deepseek.com/api/get-user-balance`) using the provider's
|
|
140
140
|
`apiKey`. The balance is **account-wide** (one balance for both
|
|
141
|
-
`deepseek-v4-pro` and `deepseek-
|
|
141
|
+
`deepseek-v4-pro` and `deepseek-flash`), refreshed on startup and then every
|
|
142
142
|
5 minutes. The line is hidden when no API key is configured or the request
|
|
143
143
|
fails.
|
|
144
144
|
|
|
@@ -172,7 +172,7 @@ rm -rf "$HOME/.cache/opencode/packages/file:/home/mukminov/src/opencode-peak-sch
|
|
|
172
172
|
{
|
|
173
173
|
"$schema": "https://opencode.ai/tui.json",
|
|
174
174
|
"plugin": [
|
|
175
|
-
["/home/mukminov/src/opencode-peak-scheduler", { "peakModel": "deepseek-
|
|
175
|
+
["/home/mukminov/src/opencode-peak-scheduler", { "peakModel": "deepseek-flash" }],
|
|
176
176
|
"/home/mukminov/src/opencode-git-footer"
|
|
177
177
|
]
|
|
178
178
|
}
|
|
@@ -193,7 +193,7 @@ Plugin options (`plugin` tuple):
|
|
|
193
193
|
| Key | Type | Default | Meaning |
|
|
194
194
|
| ----------------- | -------- | ------------------------ | ---------------------------------------- |
|
|
195
195
|
| `providerID` | `string` | `"deepseek"` | Provider part of the target model |
|
|
196
|
-
| `peakModel` | `string` | `"deepseek-
|
|
196
|
+
| `peakModel` | `string` | `"deepseek-flash"` | Model used during peak hours |
|
|
197
197
|
| `offModel` | `string` | `"deepseek-v4-pro"` | Model used off-peak |
|
|
198
198
|
| `timezone` | `string` | `"Asia/Shanghai"` | IANA timezone the schedule runs in |
|
|
199
199
|
| `autoID` | `string` | `"auto"` | Pseudo-model id routed by the window |
|
|
@@ -203,7 +203,7 @@ Provider `scheduler` options (inside `provider.deepseek.options.scheduler`):
|
|
|
203
203
|
|
|
204
204
|
| Key | Type | Default | Meaning |
|
|
205
205
|
| ----------- | -------- | --------------------- | ------------------------------------ |
|
|
206
|
-
| `peakModel` | `string` | `"deepseek-
|
|
206
|
+
| `peakModel` | `string` | `"deepseek-flash"` | Model used during peak hours |
|
|
207
207
|
| `offModel` | `string` | `"deepseek-v4-pro"` | Model used off-peak |
|
|
208
208
|
| `timezone` | `string` | `"Asia/Shanghai"` | IANA timezone the schedule runs in |
|
|
209
209
|
| `autoID` | `string` | `"auto"` | Pseudo-model id routed by the window |
|
|
@@ -229,7 +229,7 @@ Notes:
|
|
|
229
229
|
## Limitations (honest)
|
|
230
230
|
|
|
231
231
|
- **Explicit model choices are always respected.** Picking a concrete model
|
|
232
|
-
(e.g. `deepseek-
|
|
232
|
+
(e.g. `deepseek-flash` during off-peak) bypasses the scheduler entirely —
|
|
233
233
|
only `auto` is routed by the window, and `input.model` wins per turn.
|
|
234
234
|
- **The provider package must be reachable at that exact `file:///` path.** The
|
|
235
235
|
import is resolved at startup; moving or deleting the source directory while
|
|
@@ -250,7 +250,7 @@ Notes:
|
|
|
250
250
|
provider-level routing for `auto`, but no session-row switching or status UI.
|
|
251
251
|
- **Per-model `options` are not applied to `auto`-routed calls.** OpenCode
|
|
252
252
|
computes provider options from the `auto` model entry (which has none), so
|
|
253
|
-
`options` on the `deepseek-v4-pro`/`deepseek-
|
|
253
|
+
`options` on the `deepseek-v4-pro`/`deepseek-flash` entries (e.g.
|
|
254
254
|
`reasoningEffort`) are bypassed for calls routed via `auto`. Put shared
|
|
255
255
|
options at provider level (`provider.deepseek.options`) or on the `auto`
|
|
256
256
|
entry instead.
|
|
@@ -283,8 +283,8 @@ If this plugin saves you money, you can say thanks:
|
|
|
283
283
|
|
|
284
284
|
| QR | Address |
|
|
285
285
|
| --- | --- |
|
|
286
|
-
|  | **BNB Smart Chain (BEP-20):** `0x1Df93A331CF8D5bE9d382B6d55fe227D6489B2a2` |
|
|
287
|
-
|  | **Tron (TRC-20):** `TDfatR9JWqcfx5VuTMHDLQP3BN6f8Ynk5r` |
|
|
286
|
+
|  | **BNB Smart Chain (BEP-20):** `0x1Df93A331CF8D5bE9d382B6d55fe227D6489B2a2` |
|
|
287
|
+
|  | **Tron (TRC-20):** `TDfatR9JWqcfx5VuTMHDLQP3BN6f8Ynk5r` |
|
|
288
288
|
|
|
289
289
|
## License
|
|
290
290
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "opencode-peak-scheduler",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"description": "OpenCode plugin — switch DeepSeek model automatically by Beijing peak/off-peak hours",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|