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

@inferock/measure

v0.1.10

Published

TypeScript primitives for LLM token usage, billing integrity, cost, reliability, and failure receipt measurement.

Readme

@inferock/measure

TypeScript primitives behind inferock-bench: canonical provider events, token-count checks, billing-integrity signals, pricing, and receipt-ready loss rows.

Use it for local Claude/GPT token usage checks, OpenAI/Anthropic/Gemini/OpenRouter cost evidence (OpenRouter dollar pricing is endpoint-evidence-gated in the public app), billing-integrity tests, and receipt math when you do not need the local proxy process.

Use this package when you want the measurement math without running the local proxy.

| Need | Start here | | --- | --- | | Event shape | Canonical Event Schema | | Signal semantics | Public Signal Semantics | | Receipt ledgers | The Inferock Standard | | Local proxy and captures | inferock-bench README |

import { estimateCostUsd, runStatelessDetectors } from "@inferock/measure/stateless";

const costUsd = estimateCostUsd(canonicalEvent);
const signals = runStatelessDetectors(canonicalEvent);

The CLI and full public docs live at https://github.com/inferock/inferock-bench.

What ships

  • Canonical provider event types, including OpenAI, Anthropic, Gemini, and OpenRouter-compatible events; OpenRouter public-app dollar pricing is restricted to pinned observed endpoints.
  • Broken-output, billed-empty, refusal, latency, availability, token-count, and billing-integrity detectors.
  • Pricing helpers for observed provider usage.
  • Receipt-oriented signal fields for spent dollars, bill-bounded money loss, time loss, provider-recognized recovery, recognition gap, and separate invoice-check exposure accounting.

Anthropic Token Recount

Anthropic output-token cross-checks use anthropic_count_tokens_recount_v1 only after runtime per-model calibration against Anthropic messages/count_tokens. Evidence is capped at provider-assisted grade B. Offline estimates use the vendored MIT Xenova/claude-tokenizer at revision cae688821ea05490de49a6d3faa36468a4672fad; see src/vendor/claude-tokenizer/LICENSE-Xenova-claude-tokenizer.md.

Anthropic does not publish a local tokenizer for Claude 3 or later models, and no API returns an independent recount of billed output tokens. Anthropic-side token recounts in this standard are computed against Anthropic's own count_tokens endpoint (documented by Anthropic as an estimate) applied to the delivered output text, with per-model calibration constants and a stated tolerance band; offline estimates use the last tokenizer Anthropic published (Claude 1/2-era, MIT) and are labeled approximate. This is an approximation pending an official public Anthropic tokenizer and will be replaced by it on release.

@inferock/measure is Apache-2.0. The inferock-bench CLI is the local proxy that captures real calls and feeds this library.

What to read next

inferock-bench and @inferock/measure are the open-source measurement layer of Inferock, the hosted billing-integrity and reliability gateway.