npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-neuralwatt-provider

v1.0.5

Published

Neuralwatt provider extension for pi - Access Kimi, GLM, Qwen, GPT-OSS, Devstral, and MiniMax models through the Neuralwatt API

Downloads

0

Readme

⚡ pi-neuralwatt-provider

Models + energy tracking via Neuralwatt

Kimi, GLM, Qwen, DeepSeek — with real-time ⚡ energy/cost per session for pi.

pi extension license


Energy Reporting Status Widget

Features

  • OpenAI-compatible API - Uses Neuralwatt's /v1/chat/completions endpoint
  • Reasoning models - Support for thinking models with reasoning_effort parameter
  • Vision models - Image input support on Kimi K2.5, K2.6, and Devstral
  • Tool use - Function calling support
  • Streaming - Real-time token streaming
  • Fast variants - Optimized "Fast" versions of popular models for quicker responses
  • Energy reporting - Displays energy consumption (⚡J/mWh/Wh/kWh) and actual billed cost ($) in a dedicated status widget below the editor, tracked per-session
  • Quota display - Shows subscription plan, kWh allocation, and credits remaining from your Neuralwatt account, right-aligned in the status widget
  • Configurable display - Energy and quota can each be shown in the below-editor widget, the built-in status bar, or turned off entirely via a config file

Available Models

| Model | Context | Vision | Reasoning | Input $/M | Output $/M | |-------|---------|--------|-----------|-----------|------------| | Devstral-Small-2-24B-Instruct-2512 | 262K | ✅ | ❌ | $0.12 | $0.35 | | GLM 5.1 long (coherence canary: keep-recent 48k) | 1.0M | ❌ | ✅ | $1.10 | $3.60 | | GLM-5 Fast | 203K | ❌ | ❌ | $1.10 | $3.60 | | GLM-5.1 | 203K | ❌ | ✅ | $1.10 | $3.60 | | GLM-5.1 (flex) | 203K | ❌ | ✅ | $1.10 | $3.60 | | GLM-5.1 Fast | 203K | ❌ | ❌ | $1.10 | $3.60 | | GLM-5.1 Long (Virtual Context) | 1.0M | ❌ | ✅ | $1.10 | $3.60 | | GPT-OSS 20B | 16K | ❌ | ✅ | $0.03 | $0.16 | | Kimi K2.5 | 262K | ✅ | ✅ | $0.52 | $2.59 | | Kimi K2.5 Fast | 262K | ✅ | ❌ | $0.52 | $2.59 | | Kimi K2.6 | 262K | ✅ | ✅ | $0.69 | $3.22 | | Kimi K2.6 (flex) | 262K | ✅ | ✅ | $0.69 | $3.22 | | Kimi K2.6 Fast | 262K | ✅ | ❌ | $0.69 | $3.22 | | Kimi K2.6 Long (Virtual Context) | 1.0M | ✅ | ✅ | $0.69 | $3.22 | | MiniMax M2.5 | 197K | ❌ | ✅ | $0.35 | $1.38 | | Qwen3.5 397B | 262K | ❌ | ✅ | $0.69 | $4.14 | | Qwen3.5 397B Fast | 262K | ❌ | ❌ | $0.69 | $4.14 | | Qwen3.6 35B | 131K | ✅ | ✅ | $0.29 | $1.15 | | Qwen3.6 35B Fast | 131K | ✅ | ❌ | $0.29 | $1.15 | | GLM-5.1 Canary | 203K | ❌ | ✅ | $1.10 | $3.60 | | GLM-5.1 NVFP4 Canary | 203K | ❌ | ✅ | $1.10 | $3.60 | | Kimi K2.6 Canary | 262K | ✅ | ✅ | $0.69 | $3.22 | | GLM-5 Long (MCR 1M) | 1.0M | ❌ | ✅ | $1.10 | $3.60 | | GLM-5.1 Fast Long (MCR 1M) | 1.0M | ❌ | ❌ | $1.10 | $3.60 | | Kimi K2.5 Long (MCR 1M) | 1.0M | ✅ | ✅ | $0.52 | $2.59 | | GLM-5.1 (FP8) | 203K | ❌ | ✅ | $1.10 | $3.60 | | Kimi K2.6 | 262K | ✅ | ✅ | $0.69 | $3.22 | | Qwen3.6 35B (A3B) | 131K | ✅ | ✅ | $0.29 | $1.15 | | Claude Opus (Cached) | 1.0M | ❌ | ✅ | $0.00 | $0.00 |

Authentication

The Neuralwatt API key can be configured in multiple ways (resolved in this order):

  1. auth.json (recommended) — Add to ~/.pi/agent/auth.json:
    { "neuralwatt": { "type": "api_key", "key": "your-api-key" } }
    The key field supports literal values, env var names, and shell commands (prefix with !). See pi's auth file docs for details.
  2. Runtime override — Use the --api-key CLI flag
  3. Environment variable — Set NEURALWATT_API_KEY

Get your API key from neuralwatt.com.

Installation

Option 1: Using pi install (Recommended)

Install directly from GitHub:

pi install https://github.com/monotykamary/pi-neuralwatt-provider

Option 2: With npm

Install from npm:

npm install pi-neuralwatt-provider

Option 3: Manual Clone

Then authenticate and run pi:

# Recommended: add to auth.json
# See Authentication section below

# Or set as environment variable
export NEURALWATT_API_KEY=your-api-key-here

pi
  1. Clone this repository:

    git clone [email protected]:monotykamary/pi-neuralwatt-provider.git
    cd pi-neuralwatt-provider
  2. Configure your Neuralwatt API key:

    # Recommended: add to auth.json
    # See Authentication section below
    
    # Or set as environment variable
    export NEURALWATT_API_KEY=your-api-key-here
  3. Run pi with the extension:

    pi -e /path/to/pi-neuralwatt-provider

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | NEURALWATT_API_KEY | No | Your Neuralwatt API key (fallback if not in auth.json) |

Configuration

Compat Settings

Neuralwatt's API now provides compatibility and capability metadata (pricing, reasoning, vision, developer_role, reasoning_effort, max_images) directly in the /v1/models response. The update-models.js script reads these and writes them into models.json. Only genuinely incorrect API data needs a manual override in patch.json.

Currently configured compat settings (all sourced from the API):

  • supportsDeveloperRole: false — All models. vLLM doesn't support the developer role; pi sends system prompts as system messages instead.
  • supportsReasoningEffort: true — GPT-OSS. Sends reasoning_effort parameter (maps to pi's /reasoning command levels).

Custom Stream Handler

This extension registers a custom streamSimple provider (api: "neuralwatt") that wraps pi-ai's built-in streamOpenAICompletions. A temporary globalThis.fetch override tees the HTTP response body so the OpenAI SDK handles all standard chunk parsing (text, thinking, tool calls, usage) while the extension reads the tee for Neuralwatt's SSE comment lines (: energy {...}, : cost {...}) that the SDK discards.

Pi Configuration

Add to your pi configuration for automatic loading:

{
  "extensions": [
    "/path/to/pi-neuralwatt-provider"
  ]
}

Usage

Once loaded, select a model with:

/model neuralwatt kimi-k2.5

Or use /models to browse all available Neuralwatt models.

Reasoning Effort

For reasoning models, control thinking depth:

/reasoning high

Values: none, low, medium, high

Display Configuration

Energy and quota are independently configurable. Create ~/.pi/agent/extensions/neuralwatt.json:

{
  "energy": "widget",
  "quota": "widget"
}

The file is auto-populated with defaults on first run.

| Key | Values | Default | Description | |-----|--------|---------|-------------| | energy | "widget", "statusbar", "off" | "widget" | Energy/cost display mode | | quota | "widget", "statusbar", "off" | "widget" | Quota display mode |

Display modes:

  • "widget" — Shown in the dedicated below-editor status line. Energy on the left, quota on the right, padded to terminal width.
  • "statusbar" — Shown in the built-in pi status bar. When both are set to "statusbar", they're combined with a | separator: ⚡X J $Y | plan ● kWh ∙ $bal.
  • "off" — Hidden entirely. For "quota": "off", the /v1/quota API fetch is also skipped (saving a network round-trip). Energy data is still parsed from the SSE stream and persisted to the session even when "off".

Example — custom quota footer: If you use your own unified quota footer extension, disable the built-in quota display to avoid duplication:

{
  "energy": "widget",
  "quota": "off"
}

Energy Reporting

Neuralwatt provides real-time energy consumption data with every API response. This extension captures it and displays a running total in a dedicated status widget between the editor and the pi footer:

| Segment | Meaning | |---------|----------| | ⚡0.8mWh | Cumulative session energy consumption (auto-scaled: J → mWh → Wh → kWh) | | $0.003952 | Cumulative session actual billed cost from Neuralwatt | | pro | Your Neuralwatt subscription plan | | | Subscription status indicator (● = active, ⊘ = past due/paused) | | 31.7/33.0 kWh | kWh remaining / kWh included in your plan | | ∙ $64.55 | Credits remaining on your account | | 🔑 .../.../mo | Key allowance usage (if set on your API key) |

The energy and cost data comes from Neuralwatt's SSE stream comments (: energy and : cost), which the standard OpenAI SDK discards. This extension uses a custom stream handler that parses raw SSE to capture them.

Energy is measured directly from GPU hardware using NVIDIA's NVML. For concurrent requests, Neuralwatt uses token-weighted attribution to fairly calculate your share. See Neuralwatt's energy methodology for details.

Persistence

Energy and cost data is persisted per-request as custom session entries. On session resume or tree navigation, the totals are rebuilt by replaying all events in the current branch. This means:

  • Session resume — Energy/cost totals are restored when you continue a session
  • Branching — Navigating to a different point in the session tree shows the correct totals for that branch
  • Forking — Forked sessions carry their energy history forward

API Documentation

  • Neuralwatt API: https://api.neuralwatt.com/v1
  • Models endpoint: https://api.neuralwatt.com/v1/models
  • Chat completions: https://api.neuralwatt.com/v1/chat/completions

License

MIT