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

llm-cost-router-mcp

v0.2.0

Published

MCP server that advises LLM model routing & cost BEFORE the call — estimate_cost, recommend_model, should_offload_local. Pure logic, no API keys, $0 to run.

Readme

💸 LLM Cost Router — MCP

Know what an LLM call will cost before you make it — and route it to the cheapest model that can actually do the job (including free local Ollama).

An MCP server that gives your AI assistant (Claude Code, Cursor, Cline…) cost-awareness in context. Pure logic, no API keys, $0 to run — it never calls a paid API, it just advises.

Why

LLM gateways (LiteLLM, OpenRouter, Helicone…) sit in the request path and measure spend after the fact. This MCP does the opposite and the thing they can't: it advises before the call, right inside the assistant's reasoning loop, so the model can decide to offload to free local compute or pick a cheaper cloud model — without any proxy.

Tools

| Tool | What it does | |------|--------------| | estimate_cost | USD cost of a call for a given model + prompt/tokens. | | recommend_model | Cheapest model capable of the task (complexity-scored), + a free local option + alternatives. | | should_offload_local | Boolean: can this run free on local Ollama? + the USD you'd save vs cloud. | | list_models | Known models, pricing (per 1M tokens), capability tier, context window. |

All pure logic: a pricing table + a complexity heuristic. No network, no keys, no per-call cost.

Install

// Claude Code / Cursor MCP config
{
  "mcpServers": {
    "llm-cost-router": { "command": "npx", "args": ["-y", "llm-cost-router-mcp"] }
  }
}

Or run directly: npx -y llm-cost-router-mcp

Example

"Before answering, ask llm-cost-router whether this can run locally."

recommend_model({ "prompt": "write a regex to validate an email in python", "priority": "cost" })
→ { "recommended_model": "ollama:qwen2.5-coder:7b", "estimated_cost_usd": 0,
    "complexity": { "label": "mid" },
    "best_capable": { "model": "gemini-2.5-pro", "cost_usd": 0.000654 } }

Custom pricing

Override or add models without touching code:

MODEL_PRICING_JSON='{"my-model":{"provider":"x","in":1,"out":3,"tier":2,"ctx":128000}}'

Free vs Pro

  • Free (this package)estimate_cost, recommend_model, should_offload_local, list_models.
  • Pro (coming) — budget rules & alerts, per-project policies, multi-provider live pricing sync, local-first presets, team config.

License

MIT © Frederic Suretat