dsh-is-power-of-two
Run the following command in DeepSeek Harness:
dsh plugin install uckkk/dsh-is-power-of-two
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install uckkk/dsh-is-power-of-two in the DeepSeek Harness terminal to install this plugin; the full source repository is at https://github.com/uckkk/dsh-is-power-of-two
About this plugin
In model inference pipelines, parameters such as attention head counts, KV-cache shard sizes, and quantization group sizes are expected to be powers of two; a single misconfiguration can cause silent corruption or runtime failures far downstream. dsh-is-power-of-two reduces that check to a single zero-dependency pure Node function: no network I/O, no async overhead, just a boolean returned immediately.
Its entire job is one: given a non-negative integer, return whether it is a power of two. There are no callbacks, no promises, no configuration surface. Under the hood it relies on the classic bit trick n & (n - 1), yielding an O(1) check that stays invisible even on hot paths that validate parameters thousands of times per second.
It fits naturally into inference-service startup self-checks, parameter-validation middleware, or CLI scaffolding where a lightweight assertion is needed. Licensed under MIT, it is a single portable file that drops into any Node project without adding a transitive dependency tree.
Use Cases
- Validating attention head counts and KV-cache shard sizes at inference service startup
- Checking quantization group-size parameters during model loading
- Performing instant assertions on user input in CLI scaffolding
Best For
- Engineers needing lightweight parameter checks in inference pipelines
- Developers building zero-dependency Node.js toolchains
- Teams running fast config self-checks in CI/CD
Related Plugins
ModLens is a vision plugin for DeepSeek Harness that gives text-only models sight by reading images pasted directly into chat, with zero-config setup and multiple vision engines.
On-demand vision for text-only DeepSeek Harness agents: built-in free keyless vision chain and 14 vision tools, routing image turns as tool calls to vision models with pixel fidelity, no Python needed, one-command install.
Give text-only models in DeepSeek Harness eyes, enabling image Q&A, long-screenshot OCR, UI restoration, and GUI visual tasks.
An armor-breaking plugin for DeepSeek: rewrites instruction priority, expands refusal-blocked phrases, persists across sessions, and shows a green active indicator.