@khaosoigai/pi-ds-pricing-regime 0.1.0 → 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 +22 -9
- package/extensions/deepseek-peak-offpeak.ts +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@ display in the machine's local timezone — nothing is hardcoded.
|
|
|
9
9
|
|
|
10
10
|
| State | Footer text (bottom-left) |
|
|
11
11
|
| --- | --- |
|
|
12
|
-
| Peak hours |
|
|
13
|
-
| Off-peak |
|
|
14
|
-
| Weekend (Beijing time) |
|
|
12
|
+
| Peak hours | `DeepSeek PEAK — until 12:00 local` (amber) |
|
|
13
|
+
| Off-peak | `DeepSeek off-peak — next peak 09:00 local` (green) |
|
|
14
|
+
| Weekend (Beijing time) | `DeepSeek off-peak (weekend flat rate) — next peak Monday 09:00 local` (green) |
|
|
15
15
|
|
|
16
16
|
When the next boundary is not today (e.g. on a weekend morning), the label
|
|
17
17
|
includes the boundary's local weekday so `09:00` is not mistaken for today's
|
|
@@ -33,8 +33,8 @@ It publishes two keys, sorted alphabetically there:
|
|
|
33
33
|
|
|
34
34
|
| Status key | Shows |
|
|
35
35
|
| --- | --- |
|
|
36
|
-
| `zz-deepseek-regime` |
|
|
37
|
-
| `zz-deepseek-balance` |
|
|
36
|
+
| `zz-deepseek-regime` | `DeepSeek PEAK — until 12:00 local` (see table above) |
|
|
37
|
+
| `zz-deepseek-balance` | `¥12.34` — DeepSeek platform credit balance, warning-coloured under the `LOW_BALANCE` thresholds |
|
|
38
38
|
|
|
39
39
|
For a configurable multi-line footer we recommend
|
|
40
40
|
[pi-footer](https://github.com/wobondar/pi-footer) (`pi install
|
|
@@ -64,6 +64,20 @@ All are constants at the top of
|
|
|
64
64
|
(`PEAK_WINDOWS`, `WEEKEND_OFFPEAK_UTC`, `DEEPSEEK_PROVIDER`) — edit them if
|
|
65
65
|
DeepSeek changes the regime.
|
|
66
66
|
|
|
67
|
+
## Pricing
|
|
68
|
+
|
|
69
|
+
The Flash series was repriced effective `2026-09-10T04:00:00Z` (12:00 Beijing
|
|
70
|
+
on 2026-09-10). Per 1M tokens:
|
|
71
|
+
|
|
72
|
+
| | Input (cache hit) | Input (cache miss) | Output |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| Off-peak | $0.003 | $0.15 | $0.60 |
|
|
75
|
+
| Peak (double) | $0.006 | $0.30 | $1.20 |
|
|
76
|
+
|
|
77
|
+
`deepseek-v4-flash` (internally V4.1-Flash) is the only served model: V4 Pro
|
|
78
|
+
and the experimental vision model are deprecated. The peak/off-peak windows
|
|
79
|
+
and the weekend flat-rate rule are unchanged by the repricing.
|
|
80
|
+
|
|
67
81
|
## Install
|
|
68
82
|
|
|
69
83
|
Install as a pi package from npm:
|
|
@@ -78,17 +92,16 @@ package is listed with the `pi-package` keyword for the [package gallery](https:
|
|
|
78
92
|
|
|
79
93
|
### From git (alternative)
|
|
80
94
|
|
|
81
|
-
The source repo can also be installed directly
|
|
82
|
-
repo is private and SSH keys are configured):
|
|
95
|
+
The source repo can also be installed directly from git:
|
|
83
96
|
|
|
84
97
|
```sh
|
|
85
|
-
pi install git:
|
|
98
|
+
pi install git:github.com/khaosoi/pi-ds-pricing-regime
|
|
86
99
|
```
|
|
87
100
|
|
|
88
101
|
Pi clones it to `~/.pi/agent/git/github.com/khaosoi/pi-ds-pricing-regime/` and
|
|
89
102
|
runs `npm install` there; restart pi (or `/reload`) to load it. The settings
|
|
90
103
|
entry has no pinned ref, so `pi update --extensions` pulls latest `main`.
|
|
91
|
-
Pin a ref with `pi install git:
|
|
104
|
+
Pin a ref with `pi install git:github.com/khaosoi/pi-ds-pricing-regime@<ref>`.
|
|
92
105
|
|
|
93
106
|
> Alternative: copy `extensions/deepseek-peak-offpeak.ts` into `.pi/extensions/`
|
|
94
107
|
> of a project for a project-local install.
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
* Since 2026-08-22T16:00:00Z (= 2026-08-23 00:00 Beijing), Saturdays and
|
|
24
24
|
* Sundays (Beijing calendar time) have no peak tiers at all: every call
|
|
25
25
|
* is billed at the uniform off-peak rate.
|
|
26
|
+
*
|
|
27
|
+
* Flash series pricing effective 2026-09-10T04:00:00Z (= 12:00 Beijing on
|
|
28
|
+
* 2026-09-10), per 1M tokens, off-peak: $0.003 input cache hit, $0.15
|
|
29
|
+
* input cache miss, $0.60 output. Peak hours are exactly double
|
|
30
|
+
* ($0.006 / $0.30 / $1.20). `deepseek-v4-flash` (internally V4.1-Flash) is
|
|
31
|
+
* now the only served model: V4 Pro and the experimental vision model are
|
|
32
|
+
* deprecated.
|
|
26
33
|
*/
|
|
27
34
|
|
|
28
35
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
@@ -173,7 +180,7 @@ export function parseBalance(body: unknown): { total: number; currency: string;
|
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
/**
|
|
176
|
-
* The rendered balance status: "
|
|
183
|
+
* The rendered balance status: "¥12.34", low-balances in the theme's
|
|
177
184
|
* warning colour. Precision: integers lose the decimals ("¥12"), anything
|
|
178
185
|
* else keeps two. Unknown currencies render as "12.34 EUR".
|
|
179
186
|
*/
|
|
@@ -184,7 +191,7 @@ export function formatBalance(balance: { total: number; currency: string }): {
|
|
|
184
191
|
const { total, currency } = balance;
|
|
185
192
|
const amount = Number.isInteger(total) ? String(total) : total.toFixed(2);
|
|
186
193
|
const symbol = CURRENCY_SYMBOLS[currency];
|
|
187
|
-
const text = symbol ?
|
|
194
|
+
const text = symbol ? `${symbol}${amount}` : `${amount}${currency ? ` ${currency}` : ""}`;
|
|
188
195
|
const threshold = LOW_BALANCE[currency] ?? FALLBACK_LOW_BALANCE;
|
|
189
196
|
return { text, low: total < threshold };
|
|
190
197
|
}
|
|
@@ -194,17 +201,17 @@ export function statusText(now: Date): { text: string; color: "warning" | "succe
|
|
|
194
201
|
const boundary = nextBoundaryUtc(now);
|
|
195
202
|
const label = `${formatLocalDayPrefix(now, boundary)}${formatLocalTime(boundary)}`;
|
|
196
203
|
if (inPeak(now)) {
|
|
197
|
-
return { color: "warning", text:
|
|
204
|
+
return { color: "warning", text: `DeepSeek PEAK — until ${label} local` };
|
|
198
205
|
}
|
|
199
206
|
if (now.getTime() >= WEEKEND_OFFPEAK_UTC && isWeekendBeijing(now)) {
|
|
200
207
|
return {
|
|
201
208
|
color: "success",
|
|
202
|
-
text:
|
|
209
|
+
text: `DeepSeek off-peak (weekend flat rate) — next peak ${label} local`,
|
|
203
210
|
};
|
|
204
211
|
}
|
|
205
212
|
return {
|
|
206
213
|
color: "success",
|
|
207
|
-
text:
|
|
214
|
+
text: `DeepSeek off-peak — next peak ${label} local`,
|
|
208
215
|
};
|
|
209
216
|
}
|
|
210
217
|
|