Chuyển đến nội dung chính

deepseek-cheap-or-peak-tokens

Đã xác minh

@silver-kiwi/deepseek-cheap-or-peak-tokens · v1.0.1 · MIT · Giao diện web

DeepSeek off-peak (half-price) token countdown: a durable dual-face plugin providing the deepseek_cheap_tokens tool plus an ambient 24h peak/off-peak dock widget.

Cài đặt

dsh plugin add @silver-kiwi/deepseek-cheap-or-peak-tokens

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Thẻ

Tác giả

Readme

@silver-kiwi/deepseek-cheap-or-peak-tokens

A dual-face DeepSeek Harness plugin that tells you how many hours until DeepSeek API tokens are cheap (off-peak, half price).

Dock widget screenshot

  • Host half — registers the deepseek_cheap_tokens model tool. Just ask "how many hours until cheap tokens?" and it answers with hours, minutes, and the exact UTC start of the next off-peak window.
  • Client half — an ambient dock widget above the composer: a live 24h peak/off-peak timeline with a "now" marker and a countdown, refreshing every 60 s.

The peak/off-peak schedule is parsed live from the official pricing page — Models & Pricing — which currently states:

Off-peak rates are half of the peak rates. Peak hours are 01:00 – 04:00 and 06:00 – 10:00 UTC (all other hours are off-peak).

The plugin re-checks the page every 6 h, so if DeepSeek ever changes the windows, the tool and widget follow. If the fetch fails it falls back to the schedule above.

Install

Requires a DSH web profile (the web profile is auto-initialized on first use).

# from anywhere; installs the package and activates it as a bundle layer
dsh plugin --profile web add @silver-kiwi/deepseek-cheap-or-peak-tokens

Then restart your dsh web server (new bundle layers load at boot):

dsh web

That's it — no manual cordis.patch.yml editing. The package declares dsh.bundle, so dsh plugin automatically appends it to the profile's dsh.profile.bundles and its cordis.patch.yml registers the plugin row.

Use

  • Ask your agent: "how many hours until cheap tokens?" — it calls deepseek_cheap_tokens.
  • Or just look above the composer: the dock shows green when off-peak ("Cheap now · half price") or amber with a countdown when inside a peak window, plus the 24h timeline and the next off-peak start time (UTC).

Development

The package lives in this repository (see lib/index.js for the host half, lib/client.js for the browser bundle). Changes take effect on the next server restart.

How it works

Piece Mechanism
Schedule source https://api-docs.deepseek.com/quick_start/pricing/ (fetched via the host web service, re-checked every 6 h)
Model tool ctx.tools.register — durable host registration
Widget data Generic Connection RPC channel /cheap-tokens (loopback-trusted), polled by the client bundle
Client UI __ModuleLoader__ bundle registering conversation.input.dock (id cheap-tokens, order 30)

License

MIT — see LICENSE.