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

@spendgraph/llms

v0.15.0

Published

Read any LLM provider reply into one shape. Records usage through @spendgraph/sdk.

Readme

@spendgraph/llms

Read any LLM provider reply into one shape. Records usage through @spendgraph/sdk.

npm install @spendgraph/llms
import { Llm } from "@spendgraph/llms";

const llm = new Llm({ client: anthropic, model: "claude-opus-5" });
const reply = await llm.call([{ role: "user", content: "Summarise this." }]);

reply.output;
reply.inputTokens;

What you get

  • Zero dependencies, no provider SDK imported. It takes plain objects and calls your client by duck typing.
  • Six wire families, one shape back — Anthropic, OpenAI, Responses, Bedrock, Gemini, Perplexity, and every gateway that copies one of them. The Claude Code CLI's claude -p output reads the same way.
  • All six token counts on every reply, so they can be summed without guarding each one.
  • Fallbacks for a bad day, and a retry for a provider that refuses over headroom it was never going to use.
  • A history you can check before you send it — unpaired names the tool calls nothing answered, which is what a strict provider rejects the whole request over.

Docs

| | | | --- | --- | | Overview | One call, and what is recorded | | Making a call | Options, fallbacks, paying for headroom | | Streaming | When usage arrives, and a broken stream | | Tools | The loop, and a truncated call | | Structured output | One schema, three providers | | Providers | Six shapes, and reading a reply yourself |

License

Apache-2.0