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

@agentprodready/ai-provider

v1.0.3

Published

Provider-neutral AI contracts for AgentProdReady — execute, stream, tools, and embeddings without vendor lock-in at the boundary.

Readme

@agentprodready/ai-provider

Vendor-neutral AI contracts for AgentProdReady — chat, embeddings, streaming, and tool-calling shapes without locking your app to a single model vendor.

| | | |---|---| | Status | Production contracts published (1.0.x) | | Install | npm install @agentprodready/ai-provider | | Module | ESM | | License | MIT |


Installation

npm install @agentprodready/ai-provider

# OpenAI adapter (optional)
npm install @agentprodready/ai-provider-openai

Set OPENAI_API_KEY when using the OpenAI adapter.


Features

| Feature | Description | |---|---| | Chat adapter contract | AiProviderAdapter — generate / stream | | Embedding adapter contract | AiEmbeddingAdapter — parallel surface (chat adapters need not embed) | | Normalized messages | AiMessage, roles, tool calls | | Streaming events | content / usage / completed / failed / cancelled | | Tool calling shapes | NormalizedToolCall, continuation message builders | | Reference adapters | Deterministic CI adapters (no network) | | AbortSignal | Cancellation on requests |


Why use this instead of the OpenAI SDK directly?

Your app / Runtime
        ↓
@agentprodready/ai-provider  (contracts)
        ↓
@agentprodready/ai-provider-openai | reference | future Anthropic…

Swap providers in Composition / Capability Resolution without rewriting business logic.


Usage (conceptual)

import type { AiProviderAdapter, AiMessage } from '@agentprodready/ai-provider';

declare const ai: AiProviderAdapter; // from Composition

const messages: AiMessage[] = [
  { role: 'system', content: 'You are a helpful assistant.' },
  { role: 'user', content: 'Hello!' },
];

const result = await ai.generate({
  messages,
  // model, tools, signal, … per contract
});

console.log(result);

Streaming

for await (const event of ai.stream({ messages, signal: controller.signal })) {
  switch (event.type) {
    case 'content':
      process.stdout.write(event.text);
      break;
    case 'completed':
    case 'failed':
    case 'cancelled':
      // exactly one terminal event
      break;
  }
}

Tool calling

  • Assistant turns may include toolCalls?: NormalizedToolCall[]
  • Use buildToolContinuationMessages(...) for ordered continuations
  • Guide: Tools

Reference adapters (CI)

| Adapter | Role | |---|---| | Reference chat | Deterministic responses; tool triggers like USE_TOOL_ECHO: | | ReferenceEmbeddingAdapter | Deterministic 32-d vectors, no network |

Never treat reference adapters as production models.


Related packages

| Package | Role | |---|---| | @agentprodready/ai-provider-openai | OpenAI implementation | | @agentprodready/runtime | Retries, timeouts, cancel | | @agentprodready/capability-resolution | Provider selection / fallback |


Documentation


License

MIT © 2026 ameenmari