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

@vdm-nexus/ai-sdk-provider

v0.1.0

Published

Vercel AI SDK provider for VDM Nexus. One-line drop-in that handles the x402 USDC handshake and surfaces the SIR v2 signed-inference receipt via providerMetadata.

Readme

@vdm-nexus/ai-sdk-provider

Vercel AI SDK provider for VDM Nexus — signed inference with one import.

Every call to the AI SDK pays in USDC via x402, and every response carries a cryptographic receipt of exactly what the model returned. The handshake is invisible; the receipt is on providerMetadata.nexus.receipt.

import { createNexus } from "@vdm-nexus/ai-sdk-provider";
import { generateText } from "ai";

const nexus = createNexus({ secretKey: process.env.AGENT_SECRET_KEY! });
const result = await generateText({
  model: nexus("openai/gpt-4o-mini"),
  prompt: "Explain signed inference in one sentence.",
});
console.log(result.text);
console.log(result.providerMetadata?.nexus?.receipt);

Funding your agent

Your AGENT_SECRET_KEY is also a Solana wallet. Before the first paid call, fund it with USDC on Solana mainnet (or Base mainnet). The cheapest way to try this end-to-end without managing a wallet at all is the live playground at https://vdmnexus.com/playground — generate a key in the browser, run a one-shot sponsored call, and inspect the receipt.

To run the SDK against a real agent:

# Generate a fresh 64-byte tweetnacl secret in base58 form.
node -e 'const n = require("tweetnacl"); const bs = require("bs58").default; \
  console.log(bs.encode(n.sign.keyPair().secretKey));'

# Print the matching pubkey (= your Solana wallet address).
node -e 'const n = require("tweetnacl"); const bs = require("bs58").default; \
  const sk = bs.decode(process.env.AGENT_SECRET_KEY); \
  console.log(bs.encode(sk.slice(32)));'

# Send USDC to that pubkey on Solana mainnet (any wallet works).

Per-call default is 0.01 USDC. Topping up a few dollars covers hundreds of calls.

API

createNexus(settings)

createNexus({
  secretKey?: string,           // base58 64-byte tweetnacl secret, OR
  agent?: X402Agent,            // a pre-built @vdm-nexus/x402 agent
  endpoint?: string,            // default: https://nexus.vdmnexus.com/api/v1
  network?: string,             // CAIP-2; default: server's X402_NETWORK
  name?: string,                // providerMetadata key; default: "nexus"
  headers?: Record<string, string>,
  fetch?: typeof fetch,         // optional underlying transport
}): NexusProvider

Returns the same callable shape as @ai-sdk/openai:

const nx = createNexus({ secretKey });
nx("openai/gpt-4o-mini")             // → LanguageModelV3
nx.chatModel("openai/gpt-4o-mini")   // explicit chat model

Reading the receipt

After any successful call, the SIR v2 receipt sits at:

result.providerMetadata?.nexus?.receipt    // SirX402 | null
result.providerMetadata?.nexus?.payment    // X402PaymentResponse | null

receipt.payment.tx_signature is the on-chain settlement; verify it via @vdm-nexus/x402's verifyReceipt or the hosted verifier at verify.vdmnexus.com.

nexus(modelId)

Lazy convenience that reads process.env.AGENT_SECRET_KEY on first call. For non-trivial use prefer createNexus({...}) so secrets are explicit.

Streaming

streamText works — but the underlying /chat/completions endpoint currently returns a fully-buffered response, so the AI SDK exposes the single chunk as a stream of one. Real SSE arrives in a future Nexus release; this provider will transparently upgrade.

Mastra

@vdm-nexus/mastra-provider wraps this package for the Mastra agent framework with the same import shape.

Demo / proof

The example script under examples/generate-text.ts runs against mainnet. Recent demo receipt:

https://vdmnexus.com/r/749fa37c

Run the demo yourself:

AGENT_SECRET_KEY=… NEXUS_NETWORK=solana:mainnet \
  pnpm --filter @vdm-nexus/ai-sdk-provider exec tsx examples/generate-text.ts

License

MIT.