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

metercore

v0.1.0

Published

AI Workflow Cost Optimization Simulator — CLI for cost-aware model selection, qualification, and lifecycle management

Readme

MeterCore

AI Workflow Cost Optimization Simulator
CLI, REST API, and Web Dashboard for cost-aware model selection, automated qualification, and AI execution lifecycle management.

npm version License: MIT


⚡ Overview

MeterCore is a local-first simulation engine modeling the end-to-end optimization loop for AI workflows. Rather than routing all traffic to expensive frontier LLMs, MeterCore demonstrates how to safely evaluate, qualify, and dynamically allocate traffic to cheaper candidate configurations while strictly honoring quality, latency, context, and reliability contracts.

Measure → Generate Candidates → Qualify → Optimize → Allocate → Observe → Demote/Fallback

Key Capabilities

  • Simulated Profiles & Heuristics: Tokenization and cost estimation across GPT-4o, Claude 3.5 Sonnet, Llama 3 70B, Mistral Small, and adapted configurations.
  • Capability Contracts & Multi-Dataset Qualification: Evaluates candidates against Gold, Rolling, and Failure evaluation datasets.
  • Configuration Lifecycle Management: Full state transitions across COLD, WARM, HOT, CANARY, DEGRADED, and RETIRED.
  • Live Traffic Simulation: Real-time Shadow and Canary simulation modes.
  • Interactive REST API: Built on Hono with 22 structured endpoints.
  • Embedded Web Dashboard: Modern React + Tailwind + Vite visualization suite.

📦 Installation

Global CLI

npm install -g metercore
# or via npx
npx metercore --help

In a Project

npm install metercore

🚀 Quick Start

Initialize the baseline dataset and models:

meter init

List available model configurations and their lifecycle states:

meter configs

Run cost analysis on an input payload:

meter analyze examples/damaged-item.json

Run the complete optimization decision loop:

meter optimize examples/damaged-item.json

Start the REST API server and web dashboard:

meter serve --port 3001

Open http://localhost:3001 in your browser.


🛠️ CLI Commands Reference

| Command | Description | |---|---| | meter init | Seeds default workflows, models, datasets, and baseline configurations | | meter models | Lists all registered LLM profiles with token costs & qualities | | meter configs | Lists execution configurations and their lifecycle states (COLD, WARM, HOT, etc.) | | meter analyze <file> | Analyzes an input file for tokens, structure, and classification | | meter evaluate -c <id> -d <id> | Evaluates a configuration against an evaluation dataset | | meter qualify <configId> | Executes qualification across Gold, Rolling, and Failure datasets | | meter optimize <file> | Runs full optimization loop to pick the cheapest qualified model | | meter trace [traceId] | Inspects decision traces and optimization rationale | | meter shadow <configId> [count] | Runs a shadow simulation alongside production traffic | | meter canary <configId> [percent] | Runs a canary deployment simulation at a given traffic split | | meter simulate-degradation <id> | Triggers simulated quality degradation, demoting model to DEGRADED | | meter serve [--port <number>] | Starts the Hono REST API server (and serves dashboard if built) |


🌐 Programmatic API Usage

MeterCore can also be imported directly as a TypeScript/JavaScript library:

import { bootstrap, TOKENS } from 'metercore';
import type { IAllocator, ExecutionConfiguration } from 'metercore';

const container = await bootstrap();
const allocator = container.get<IAllocator>(TOKENS.Allocator);

const bestConfig = await allocator.selectBest({
  taskComplexity: 'moderate',
  minQuality: 0.85,
  maxCostPerCall: 0.005,
});

console.log(`Selected configuration: ${bestConfig.id} (${bestConfig.modelId})`);

🧪 REST API Endpoints

When running meter serve:

  • GET /api/health — Service health & uptime
  • GET /api/overview — Aggregated KPI metrics (savings, allocations, counts)
  • GET /api/models — Registered model profiles
  • GET /api/configs — Execution configurations & qualification states
  • POST /api/configs/:id/qualify — Trigger candidate qualification
  • POST /api/optimize — Run optimization loop on submitted payload
  • GET /api/traces — Audit trail of optimization decisions
  • GET /api/evidence — Qualification proof records & evaluation runs
  • POST /api/simulations/shadow — Run shadow evaluation simulation
  • POST /api/simulations/canary — Run canary traffic routing simulation

📄 License

MIT © MikeyA-yo