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

@remcostoeten/ai-sdk

v0.2.0

Published

Vercel AI SDK adapter and typed provider factories for the @remcostoeten/ai-core completion seam.

Readme

@remcostoeten/ai-core owns the contracts and the run lifecycle. This package owns what it takes to reach a real provider, and its whole job is that the vendor library stays an implementation detail: no LanguageModel, UIMessage, TextStreamPart or APICallError appears in anything it exports. Vendor packages are optional peer dependencies, so you install only the one you use.

  • Named factories only: createGroqProvider, createGeminiProvider, createAnthropicProvider, createOpenAiCompatibleProvider. There is no fromLanguageModel(unknown) escape hatch
  • Ordering is a guarantee. The model authority is consulted, then the credential resolves, then a socket opens, so an unauthorized model or an unconfigured provider terminalizes with nothing sent
  • maxRetries: 0, always. A 429 is attempted exactly once, because a hidden retry spends budget and time the caller allotted to one attempt
  • No provider response body crosses the boundary. Bodies echo prompts and, from some vendors, a key prefix; only a bounded, status-derived sentence reaches the caller
  • Credentials arrive through a CredentialSource port and model permission through a ModelAuthority port, both yours to implement
  • Nothing here reads process.env or Deno.env, so the package makes no assumption about which runtime it is in

Each of those is asserted by a test, including the one that greps the sources for environment access and the one that asserts the fixture fetch was never called on a refusal.

The adapter is documented in typescript-core.md, worked usage is in examples.md, and the reasoning behind the boundary is ADR 0003.

Install

Install this package, ai-core, and the vendor package for the provider you reach.

npm install @remcostoeten/ai-sdk @remcostoeten/ai-core @ai-sdk/groq

The optional peers are @ai-sdk/groq, @ai-sdk/google, @ai-sdk/anthropic and @ai-sdk/openai-compatible.

Use

import { buildRequest, consumeEvents, createRuntime } from '@remcostoeten/ai-core'
import { createGroqProvider, staticCredential } from '@remcostoeten/ai-sdk'

const provider = await createGroqProvider({
  credentials: staticCredential(process.env.GROQ_API_KEY ?? ''),
  models: { permits: (_, modelId) => modelId === 'llama-3.3-70b-versatile' },
})

const runtime = createRuntime({ providers: [provider] })

From there the run is @remcostoeten/ai-core: build a request, stream it, and consume the events.

Not implemented

No retries and no key rotation. No fallback or routing between providers. No structured output. No model listing or capability discovery. Every adapter test runs against a fixture fetch, so nothing here has been confirmed against a live endpoint.

xxx, Remco Stoeten MIT