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

@propio-ai/providers

v0.1.3

Published

Provider adapters for LLM APIs (Anthropic, Bedrock, Ollama, OpenRouter, OpenAI, Gemini, xAI, Cloudflare) with a unified streaming chat interface

Readme

@propio-ai/providers

Provider adapters for LLM APIs with a unified streaming chat interface. Supports Anthropic (Claude), AWS Bedrock, Ollama, OpenRouter, OpenAI, Google Gemini, xAI (Grok), and Cloudflare Workers AI.

Extracted from propio-agent, which uses it as its provider layer.

Install

npm install @propio-ai/providers

Requires Node.js >= 20. ESM only.

Usage

import { createProvider, type ChatStreamEvent } from "@propio-ai/providers";

const provider = createProvider({
  name: "claude",
  type: "anthropic",
  models: [
    {
      name: "Claude Sonnet",
      key: "claude-sonnet-4-6",
      contextWindowTokens: 200000,
    },
  ],
  defaultModel: "claude-sonnet-4-6",
  apiKey: process.env.ANTHROPIC_API_KEY,
});

for await (const event of provider.streamChat({
  model: "claude-sonnet-4-6",
  messages: [{ role: "user", content: "Hello!" }],
})) {
  if ("type" in event && event.type === "assistant_text") {
    process.stdout.write(event.delta);
  }
}

OpenAI

The first-party OpenAI provider uses the Responses API. Supply an API key directly or set OPENAI_API_KEY:

import { createProvider } from "@propio-ai/providers";

const openai = createProvider({
  name: "openai",
  type: "openai",
  models: [
    {
      name: "GPT-5.5",
      key: "gpt-5.5",
      contextWindowTokens: 1_050_000,
    },
    {
      name: "GPT-5.4",
      key: "gpt-5.4",
      contextWindowTokens: 1_050_000,
    },
    {
      name: "GPT-5.4 mini",
      key: "gpt-5.4-mini",
      contextWindowTokens: 400_000,
    },
  ],
  defaultModel: "gpt-5.5",
  apiKey: process.env.OPENAI_API_KEY,
});

Model support is configuration-driven. To adopt a newly generally available model, add its model ID, display name, and documented context window to models, then optionally select it as defaultModel. The provider does not contain a model-name allowlist or version-specific routing. Check OpenAI's model catalog for current IDs and limits before changing configuration.

The provider streams assistant text, function calls, and OpenAI-provided reasoning summaries through the shared event contract. Tool-call continuation preserves encrypted OpenAI reasoning state internally; raw chain-of-thought is never exposed as an event.

API

Factory

  • createProvider(config, modelKey?, onDiagnosticEvent?, debugLoggingEnabled?, retryConfig?) — instantiate an LLMProvider from a ProviderConfig
  • extractModelFromConfig(config) — read the default model key from a provider config

Provider contract

LLMProvider exposes name, getCapabilities(), and streamChat(request), which yields ChatStreamEvent values (assistant_text, thinking_delta, tool_calls, status, reasoning_summary, terminal).

ProviderCapabilities.supportsSyntheticToolCallHistory is false for providers (currently Gemini) that reject caller-fabricated assistant tool-call history; callers should inline such content into a user message instead.

Configuration

  • validateProvidersConfig(value) — validate an arbitrary parsed value as a ProvidersConfig
  • resolveProvider(config, name?) / resolveModelKey(provider, key?)
  • getDefaultProviderModelSelection(config) / updateDefaultProviderModelSelection(config, providerName, modelKey?)
  • loadProvidersConfig(filePath, options?) / loadProvidersConfigAsync(filePath, options?) — load + validate from an explicit file path; options.missingMessage customizes the missing-file error
  • writeProvidersConfig(filePath, config) — atomic write
  • updateDefaultProviderModelSelectionInFile(filePath, providerName, modelKey?)

Errors

ProviderError and subclasses ProviderAuthenticationError, ProviderRateLimitError, ProviderCapacityError, ProviderModelNotFoundError, ProviderContextLengthError.

Diagnostics

Pass a ProviderDiagnosticListener to createProvider to receive ProviderDiagnosticEvents (currently provider_retry, emitted when a request is retried).

Development

npm install
npm test              # unit tests
npm run test:integration  # live-API tests (needs provider credentials)
npm run build

License

MIT