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

inferwise

v1.0.0

Published

FinOps CLI for LLM API costs: scan code, estimate token spend, and block over-budget PRs.

Readme

inferwise

Smart model selection and cost enforcement for LLM API calls.

Inferwise scans your codebase for LLM API calls, recommends the cheapest model that can handle each task, estimates per-token costs, and enforces budget guardrails. Works with any CI system or locally as a git hook.

Note: Inferwise tracks pay-as-you-go API costs (billed per token to your API key). It does not track flat-rate subscriptions like Claude Code, Cursor, Copilot, or ChatGPT Plus.

Quick Start

# See what your LLM calls cost
npx inferwise estimate .

# Get smart model recommendations
npx inferwise audit .

# Set up guardrails: config + git hooks + CI
npx inferwise init

Or install globally:

npm install -g inferwise

Commands

inferwise init

Set up config file, git hooks (husky/lefthook/plain git), and print CI setup instructions for GitHub Actions, GitLab CI, Bitbucket, and more.

inferwise estimate [path]

Scan for LLM API calls and estimate costs.

inferwise estimate .
inferwise estimate ./src --volume 5000
inferwise estimate . --format json

inferwise diff [path]

Compare token costs between two git refs. Enforces budget policy from inferwise.config.json.

inferwise diff
inferwise diff --base main --head HEAD
inferwise diff --fail-on-increase 500

inferwise check [path]

Verify total LLM costs are within budget. Exits with code 1 if exceeded. For AI agents and automation.

inferwise check . --max-monthly-cost 10000
inferwise check . --max-cost-per-call 0.05

inferwise calibrate [path]

Fetch real usage from provider APIs (Anthropic, OpenAI, OpenRouter) and compute correction factors for more accurate estimates.

ANTHROPIC_ADMIN_API_KEY=sk-ant-admin-... inferwise calibrate .
OPENROUTER_API_KEY=sk-or-... inferwise calibrate .  # All providers via OpenRouter
inferwise calibrate . --dry-run

inferwise audit [path]

Find cost optimizations with smart, capability-aware model recommendations. Infers what each LLM call does from prompts in your code and suggests cheaper models that can handle the task — with reasoning and confidence levels.

inferwise fix [path]

Auto-apply model swap recommendations from audit. Rewrites model IDs in source files.

inferwise fix .                    # Apply all recommendations
inferwise fix . --dry-run          # Preview without modifying files
inferwise fix . --min-savings 500  # Only apply fixes saving >$500/mo

inferwise price [provider] [model]

Look up model pricing. Compare models side-by-side. Designed for humans and AI agents.

inferwise price anthropic claude-sonnet-4
inferwise price --compare anthropic/claude-sonnet-4 openai/gpt-4o
inferwise price --list-all

Budget Enforcement

Add budgets to inferwise.config.json (created by inferwise init):

{
  "budgets": {
    "warn": 2000,
    "block": 50000,
    "requireApproval": 10000,
    "approvers": ["platform-eng"]
  }
}
  • warn — flags the PR with a warning label
  • block — fails the CI check, blocks merge (emergency brake)
  • requireApproval — requests review from approvers before merge

SDK (Programmatic API)

import { estimateAndCheck } from "inferwise/sdk";

const result = await estimateAndCheck("./src", { maxMonthlyCost: 10000 });
if (!result.ok) {
  console.error("Over budget:", result.violations);
}

Pure data, no console output, no process.exit — safe for embedding in agent orchestration, pipelines, or automation.

Supported Providers

Anthropic, OpenAI, Google AI, xAI, Perplexity — with LangChain, Vercel AI SDK, AWS Bedrock, Azure OpenAI, and LiteLLM pattern detection.

File types: .ts, .tsx, .js, .jsx, .mjs, .cjs, .py

Documentation

See the main repo for full documentation, CI setup guides, and estimation methodology.

License

Apache 2.0