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

@verevoir/llm

v0.8.1

Published

Provider-agnostic LLM call surface with token + cost accounting. SDK adapters in subpaths.

Readme

@verevoir/llm

Provider-agnostic LLM call surface with token + cost accounting. The core export holds the contract and shared types; provider SDK adapters live in subpaths so consumers only pay for the SDK they actually use.

Status

0.1.0 — first deliberate release. Pre-stable: the 0.x line communicates that the API surface can shift before 1.0. Bumps to 1.0 follow validation by the first real consumer.

Install

npm install @verevoir/llm @anthropic-ai/sdk

Each provider SDK is an optional peer dependency — install only the SDK(s) that match the subpath(s) you import.

Quickstart (Anthropic)

import { anthropic } from '@verevoir/llm/anthropic';

const reply = await anthropic.chat({
  systemPrompt: 'You are a helpful assistant.',
  turns: [{ role: 'user', content: 'Hello' }],
  apiKey: process.env.ANTHROPIC_API_KEY!,
  modelClass: 'reasoning',
});

console.log(reply.content);
// reply.usage → { provider, model, direction, inputTokens, outputTokens, ... }

Why subpaths

The core export (@verevoir/llm) carries provider-agnostic types — TokenUsage, PerModelUsage, ModelClass, the chat() contract, cost-accounting helpers. Each adapter lives under its own subpath so the unused provider SDK never enters the consumer's bundle:

| Subpath | SDK dep | Status | | ------------------------- | ------------------- | ----------------------- | | @verevoir/llm | none | shipped | | @verevoir/llm/anthropic | @anthropic-ai/sdk | shipped | | @verevoir/llm/google | @google/genai | chat() only (0.4.0) | | @verevoir/llm/openai | openai | chat() only (0.5.0) | | @verevoir/llm/deepseek | openai | chat() only (0.6.0) |

Multi-provider deployments depend on the same chat() contract; consumers switch backends by importing a different subpath, not by changing call sites.

Cost accounting

Every call returns a TokenUsage shaped as { provider, model, direction, inputTokens, outputTokens, ... }. The package exports sumUsages, formatTokensCompact, and a per-model rate table so per-conversation / per-project rollups need no external lookups. The direction field tracks the model-class semantic (reasoning / extraction) so rollups can break down "spent X on reasoning + Y on extraction" natively.

See also

  • llms.txt — LLM-agent-facing description of this package.
  • CHANGELOG.md — release history.
  • examples/ — runnable usage examples per subpath (land with the extraction slice).

License

Apache-2.0 — see LICENSE.