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

@tenzro/ai-provider

v0.4.15

Published

Tenzro AI provider authoring kit — types and helpers for implementing Tenzro-compatible inference providers (LanguageModelV2-shaped surface, stream parts, modality dispatch).

Downloads

157

Readme

@tenzro/ai-provider

Provider authoring kit for Tenzro-compatible inference providers.

Implement LanguageModelV2 to publish a provider package that plugs into @tenzro/ai. The interface matches Vercel AI SDK 6's LanguageModelV2 shape with three Tenzro-specific additions.

pnpm add @tenzro/ai-provider
# @tenzro/ai is a peer dep — your consumers will install it alongside.

Tenzro deltas

A standard LanguageModelV2 provider works almost as-is. The Tenzro additions are:

  1. TenzroProviderContext on the call options. Carries the caller's Signer (TDIP DID + hybrid Ed25519 + ML-DSA-65) and PaymentSpec. Providers that gate on identity check the signed inference preimage; providers that charge per-token pass the payment authorization through to settlement.

  2. Three new stream-part types. Re-exported from @tenzro/ai/types:

    • tenzro-attestation — TEE quote (TDX / SEV-SNP / Nitro / NVIDIA-CC) with binding DID.
    • tenzro-zk-proof — Plonky3 STARK over the inference IO.
    • tenzro-payment-receipt — protocol-tagged settlement receipt (x402 / MPP / channel).
  3. attestation, zkProof, paymentReceipt on the generate result. The non-streaming counterpart of the new stream parts.

Multi-modal helpers (embed, forecast, transcribe, ...) live in @tenzro/ai and dispatch directly to the node JSON-RPC. Providers only implement the chat/completion surface.

Minimal provider

import type {
  LanguageModelV2,
  LanguageModelV2CallOptions,
  LanguageModelV2GenerateResult,
  LanguageModelV2StreamResult,
} from '@tenzro/ai-provider';

export function myModel(modelId: string): LanguageModelV2 {
  return {
    specificationVersion: 'v2',
    provider: 'my-provider',
    modelId,
    supportedUrls: { '*/*': [/^https?:\/\//] },

    async doGenerate(opts: LanguageModelV2CallOptions): Promise<LanguageModelV2GenerateResult> {
      const res = await fetch('https://my-provider.example.com/v1/generate', {
        method: 'POST',
        headers: buildHeaders(opts.providerContext),
        body: JSON.stringify({
          model: modelId,
          messages: opts.prompt,
          temperature: opts.temperature,
          max_tokens: opts.maxOutputTokens,
        }),
        signal: opts.abortSignal,
      });
      const data = await res.json();
      return {
        content: [{ type: 'text', text: data.text }],
        finishReason: data.finish_reason ?? 'stop',
        usage: {
          inputTokens: data.usage.prompt_tokens,
          outputTokens: data.usage.completion_tokens,
          totalTokens: data.usage.total_tokens,
        },
        // Optional Tenzro additions:
        attestation: data.attestation,
        paymentReceipt: data.payment_receipt,
      };
    },

    async doStream(opts: LanguageModelV2CallOptions): Promise<LanguageModelV2StreamResult> {
      // Return a `ReadableStream<TenzroStreamPart>` driven by the provider's
      // SSE endpoint. Emit `text-delta` / `reasoning-delta` / `tool-call` /
      // `finish` as you would for a vanilla LanguageModelV2 provider, plus
      // `tenzro-attestation` / `tenzro-zk-proof` / `tenzro-payment-receipt`
      // when the underlying response carries them.
      // ...
    },
  };
}

TenzroProviderContext

Available on opts.providerContext for both doGenerate and doStream:

interface TenzroProviderContext {
  readonly signer?: Signer;       // Tenzro identity for this call
  readonly payment?: PaymentSpec; // Caller's payment shape
}

If your provider charges per-token, the typical flow is:

  1. Compute the canonical preimage with computeInferencePreimage from @tenzro/ai.
  2. Ask signer for { ed25519, mlDsa65, did } over that preimage.
  3. Forward the signature in your provider's auth header.
  4. Surface the settlement receipt as paymentReceipt on the result (or tenzro-payment-receipt stream part).

Publishing

Provider packages are published to npm under their own scope. Consumers install both packages:

npm install @tenzro/ai @your-org/ai-tenzro-provider

Then construct the provider directly:

import { generateText } from '@tenzro/ai';
import { myModel } from '@your-org/ai-tenzro-provider';

const { text } = await generateText({
  model: myModel('llama-3.3-70b'),
  prompt: 'Hello.',
});

@tenzro/ai's built-in tenzro() factory targets the network's discovery + routing layer — your provider package targets a single provider implementation directly.

Status

Pre-alpha. APIs may change without notice until 1.0.

License

Apache-2.0