@mikefreno/omp-neuralwatt
v0.1.1
Published
NeuralWatt model provider and quota/energy billing command for omp (port of @aliou/pi-neuralwatt)
Maintainers
Readme
omp-neuralwatt
NeuralWatt model provider for omp, with an API-key login flow and a quota + energy billing command.
Port notice: this is a port of @aliou/pi-neuralwatt to omp's
ExtensionAPI. The provider registration, quota TUI and energy billing logic are adapted from that package; see Attribution below.
Get API Key
Sign up here to get an API key (referral link)
If you already have an account.
Then paste it with /login neuralwatt.
Features
- Provider — registers
neuralwattas an OpenAI-compatible provider (https://api.neuralwatt.com/v1) with the current model catalog (18 models: DeepSeek, GLM, Kimi, Qwen, Gemma — IDs, context windows, output limits and pricing). /login neuralwatt— paste your API key (sk-...); it is validated against the gateway and stored as a provider-scoped credential.- Live models, zero upkeep — the model catalog (IDs, context windows, output limits, pricing) is fetched from the public
/v1/modelsendpoint via omp's dynamic-model hook (ProviderConfig.fetchDynamicModels). There is no baked model list: new models and price changes appear automatically, so the package needs no maintenance when NeuralWatt changes its catalog. Results run through omp's SQLite model cache (~/.omp/agent/models.db, 24 h TTL — the same cache built-in providers use): if the API is unreachable the last good list keeps working, and a failed fetch is retried on the next refresh. /neuralwatt:quota— a TUI with four tabs:- Subscription — plan, energy quota progress bar, overage flag, billing period
- Credits — credit balance with progress bar, accounting method
- Usage & Key — monthly usage (cost, requests, tokens, energy), key info, key allowance, rate limits
- Energy — energy rate billing: charged vs consumed kWh with the flex discount, rolled-up period totals (cost, requests, tokens, cached tokens), and daily energy consumption
- Non-interactive modes (print/RPC) emit a JSON summary
{ quotas, energy, summary }.
Install
Publish + install as a plugin (npm source):
omp plugin install @mikefreno/omp-neuralwattor via a marketplace catalog (see marketplace.json in this repo).
Then:
/login neuralwattand paste your API key.- Run
/neuralwatt:quotato see usage, quota and energy billing.
Key bindings in the quota view: Tab / Shift+Tab switch tabs, r refreshes, q / Esc closes.
Note: if you previously had the extension as a local file in
~/.omp/agent/extensions/neuralwatt.ts, remove it after installing the plugin to avoid double registration.
Configuration
- API key:
~/.omp/agent/auth.json(written by/login neuralwatt) or theNEURALWATT_API_KEYenvironment variable. - Billing accounting method is
energy(kWh); the Energy tab shows charged vs consumed kWh so flex discounts are visible.
Development
npm install
npm run typecheckThe package manifest lives in package.json under the omp field:
"omp": {
"name": "NeuralWatt",
"extensions": ["./extension.ts"]
}Release
npm version patch
npm publishAttribution
- Port origin: @aliou/pi-neuralwatt (v0.11.x) — provider registration, quota API client, and the quota/usage/energy display were ported from it, adapted to omp's SDK (
@oh-my-pi/pi-coding-agent/@oh-my-pi/pi-tui). - API: api.neuralwatt.com — quota and usage endpoints documented at portal.neuralwatt.com/docs.
License
MIT — see LICENSE.
