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.2.5

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 { resolveCostEvidenceForEvent, runStatelessDetectors } from "@inferock/measure/stateless";

const cost = resolveCostEvidenceForEvent(canonicalEvent);
const costUsd = cost.amountUsd; // null when unpriced or partial; never a fabricated zero
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.
  • Tagged billed, estimated, allocated, and unpriced cost evidence 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 between Anthropic messages/count_tokens and the pinned local estimator. Billed usage is excluded from calibration and the learned residual tolerance is capped at 16 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 recounts use Anthropic's count_tokens estimate on delivered output. Per-model overhead and tolerance are calibrated only against the pinned local Xenova tokenizer and delivered text; billed usage is excluded, and tolerance is capped at 16 tokens. The residual limitation is that count_tokens remains provider-assisted and the local Claude 1/2-era tokenizer is approximate, so correlated or systematic tokenizer bias can remain. Evidence is capped at grade B pending an official current public Anthropic tokenizer.

@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 is source-available under FSL-1.1-ALv2, and @inferock/measure is Apache-2.0. Together they are the source-available measurement layer of Inferock, the hosted billing-integrity and reliability gateway.