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

@randomknights/aieds

v2.5.0

Published

AiEDs (AI Energy Disclosure Standard) 2.5.0: the reference library that turns tokens and a model into an energy-first disclosure, the JSON Schema for one disclosure, the published coefficient tables, and the aieds command (receipts for Claude Code, Codex,

Readme

@randomknights/aieds

AiEDs, the AI Energy Disclosure Standard, version 2.5.0, as an npm package.

It carries three things, each built from its one canonical file in random-knights/standard:

| What | Import | Source in the repository | | --- | --- | --- | | The reference library: tokens and a model in, an energy-first disclosure out | @randomknights/aieds | lib/ | | The JSON Schema for one disclosure record (JSON Schema 2020-12) | @randomknights/aieds/schema.json | spec/aieds.schema.json | | The published coefficient tables every AiEDs surface reads | @randomknights/aieds/factors.json | spec/v2/aieds-factors.json |

The normative text is the methodology at https://standard.rand0m.ai. This package implements it; it does not replace it.

Install

npm install @randomknights/aieds

Node 20 or newer. ES modules only. TypeScript types are included. No runtime dependencies. The library makes no network calls and needs no keys; the aieds command below can send receipts to your account only after you run aieds connect.

The aieds command

The package installs an aieds command, the same code as the Claude Code and Codex plugin (plugins/random-knights in the repository), and it needs nothing but Node 20 or newer:

npx @randomknights/aieds ollama --model <name> "<prompt>"
npx @randomknights/aieds install copilot
npx @randomknights/aieds receipt --last grok
npx @randomknights/aieds connect

It prints an AiEDs receipt for Ollama, Claude Code, Codex, Grok Build and the Copilot CLI. Until you run aieds connect it makes no network call (except the Ollama server you name) and writes no file. After connect, each response's allowlisted numbers go to your own account. The full command list, the exact list of what is sent, and how each tool was verified are in the plugin README.

Example

import {
  disclosureFromResponse,
  schemaRecordFromDisclosure,
} from "@randomknights/aieds";

const disclosure = disclosureFromResponse({
  provider: "GoogleAI",
  model: "gemini-2.0-flash",
  inputTokens: 412,
  outputTokens: 890,
});

console.log(disclosure.energyWh);    // 0.47663999999999995
console.log(disclosure.carbonGrams); // 0.20447855999999998
console.log(disclosure.provenance);  // "vendor-published"
console.log(disclosure.citation);    // the source of the coefficient

// The subset the published schema validates.
const record = schemaRecordFromDisclosure(disclosure, {
  id: "aieds:example:inference:001",
  subject: { kind: "model", name: "gemini-2.0-flash" },
  scope: "inference",
  window: "PT1S",
  source: "@randomknights/aieds",
});

Energy is modeled first from the per-model coefficient table; carbon is derived from energy. A model that is not in the table gets the unknown provenance rung and says so; it is never given a borrowed number.

To validate a record, load the schema and use any JSON Schema 2020-12 validator:

import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const schema = require("@randomknights/aieds/schema.json");

The library does not bundle a validator.

Versions

The package version is the AiEDs methodology version it implements. The methodology version the library read from its bundled table is exported as METHODOLOGY_VERSION.

License

Two licenses, see NOTICE:

  • The library code (lib/) and the JSON Schema (spec/aieds.schema.json): Apache 2.0, in LICENSE.
  • The coefficient tables (spec/v2/aieds-factors.json): CC BY 4.0, in LICENSE-DOCS. Attribute "Random Knights, LLC, AiEDs" with the version and a link to https://standard.rand0m.ai.

SPDX: Apache-2.0 AND CC-BY-4.0.