pi-deepseek-peak
Pi extension showing DeepSeek peak hour status in the status bar
Package details
Install pi-deepseek-peak from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-deepseek-peak- Package
pi-deepseek-peak- Version
1.3.8- Published
- Nov 6, 2026
- Downloads
- 373/mo · 94/wk
- Author
- psychobarge
- License
- MIT
- Types
- extension
- Size
- 71.8 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"image": "./screenshot.png",
"extensions": [
"./extensions"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-deepseek-peak
Pi extension that shows DeepSeek peak hours in the TUI status bar, and prices the session with the real peak/off-peak rates.

Features
- Status bar indicator: "DS Peak" or "DS Normal", with a countdown to the next price change ("DS Peak for 1h30m") — toggle via
/dsp-countdown - Auto-refresh at 30s / 1m / 5m (default 5m) via
/dsp-refresh - Real session pricing: each assistant reply's stored cost is patched at write time with the rate in effect when the request started (pi's
timestamp), and/dsp-costrecomputes the whole session (peak/off-peak split, per model) - Uses theme colors (warning for peak, success for normal)
- Thats it
Install
pi install npm:pi-deepseek-peak
Restart pi or run /reload to activate.
Usage
Once installed, the status bar shows the current DeepSeek pricing period. Peak and off-peak rules, windows, and current rates live at https://api-docs.deepseek.com/quick_start/pricing/ — in short: peak Mon–Fri 01:00–04:00 and 06:00–10:00 UTC, weekends and Chinese public holidays off-peak in full, off-peak rates are half the peak ones.
Chinese public holidays come from a table bundled in the source, taken from the official State Council notices on https://www.gov.cn/ (2026 and 2027 bundled). The State Council publishes the next year's dates in early November, so refresh CHINA_HOLIDAY_RANGES in extensions/deepseek-peak.ts once a year; from November on, npm test fails with a reminder until the next year is in the table. Make-up workdays (调休) need no entry: they always fall on a Saturday or Sunday, which are off-peak anyway. The countdown switches to days for long off-peak stretches ("DS Normal for 8d22h" during Spring Festival).
Commands
/dsp-countdown # show or hide the countdown next to the dot (menu)
/dsp-refresh # pick the status refresh interval: 30s, 1m or 5m (menu)
/dsp-cost # recompute the whole session's real cost
/dsp-cost re-prices every assistant reply and cache keep-warm (usage) request from its stored model and request-start timestamp, so it is correct for sessions resumed from disk. Tool results and compaction/branch summaries keep pi's stored cost, the same figure the footer shows. It prints:
- current-period rates per model
Total $X (peak $A / off-peak $B)- per-model token and cost lines
- any model id without a rate entry (those keep pi's bundled cost)
The peak/off-peak rate is picked at the instant the request started (pi's timestamp). DeepSeek does not document whether it bills the rate at receipt or at completion, so a request that straddles 01:00/04:00/06:00/10:00 UTC is shown at the rate of its start.
/session and the footer show the stored costs, patched by this extension at write time; /dsp-cost is the only view that recomputes everything.
Settings are saved to $PI_CODING_AGENT_DIR/deepseek-peak.json (default ~/.pi/agent/deepseek-peak.json) as { "countdown": true, "refresh": 300 } and persist across restarts. Changing PI_CODING_AGENT_DIR starts from defaults at the new location.
Models
The extension resolves rates from the id the API reports (responseModel, today deepseek-flash), falling back to the requested id — so retired ids, or ids not in pi's catalogue, still price correctly. Any other id keeps pi's bundled cost.
deepseek-flash is absent from pi's built-in catalogue, but pi overlays the pi.dev catalogue ($PI_CODING_AGENT_DIR/models-store.json, refreshed every 4h), which lists it with vision — so normally nothing to do. Only an offline setup (PI_OFFLINE) needs it added by hand in $PI_CODING_AGENT_DIR/models.json; copy the entry from https://pi.dev/api/models/providers/deepseek.
Development
npm test # self-check for the peak/countdown/pricing logic
Requires Node ≥ 22.18 (built-in TypeScript type stripping; no build step).
To test a local branch, pi install /absolute/path/to/pi-deepseek-peak (it replaces the npm version), then /reload; pi install npm:pi-deepseek-peak to switch back.
Changelog
See CHANGELOG.md for version history.
License
MIT