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

@sip402/splitter

v0.1.1

Published

sip402 reference seller — resell Venice AI inference billed per token via streaming on-chain draws.

Downloads

48

Readme

@sip402/splitter

npm · repo · SPEC

A reference seller built on sip402: resell Venice AI inference behind an OpenAI-compatible gateway, billed per token as a paid stream — draws settle on-chain in batches while the response streams. Shows the full seller loop end to end.

npm i @sip402/splitter

What's inside

| Export | Purpose | |---|---| | veniceUpstream(privateKey) / localUpstream() | The AI upstream. veniceUpstream is real Venice via x402 (Base mainnet only); localUpstream is a deterministic generator for testnet/dev. | | tokenCostAtoms(), USDC_PER_1K_TOKENS, ATOMS_PER_TOKEN | Per-token USDC pricing (integer atoms, ceil-rounded). | | StreamingDrawer | Accrue token costs and fire an on-chain draw each time the batch threshold is crossed; DryTabError when the cap is hit. | | makeGateway() | A Hono app that wraps an upstream with sip402 metering + a settlement bus + the seller address. |

Stream + draw

import { StreamingDrawer, veniceUpstream, localUpstream, tokenCostAtoms } from "@sip402/splitter";

const drawer = new StreamingDrawer({ sellerPrivateKey, commitment, minBatchAtoms, onEvent });
const up = IS_MAINNET ? veniceUpstream(PRIVATE_KEY) : localUpstream();

for await (const chunk of up.chatStream({ model: "llama-3.3-70b", messages })) {
  process.stdout.write(chunk.text);
  await drawer.record(tokenCostAtoms(chunk.tokens)); // draws on-chain at each threshold
}
await drawer.finalize(); // flush the remainder; throws DryTabError if the cap is dry

OpenAI-compatible gateway

import { serve } from "@hono/node-server";
import { makeGateway, veniceUpstream } from "@sip402/splitter";

const { app, bus, sellerAddress } = makeGateway({
  sellerPrivateKey: SELLER_KEY,
  upstream: veniceUpstream(PRIVATE_KEY),
  minBatchAtoms: toUsdcAtoms("0.25"),
});
serve(app); // POST /v1/chat/completions — pay-per-token over sip402

Related

License

MIT