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

@swoosh-dev/sdk

v0.2.0

Published

Batteries-included drop-in for swoosh — createRouter() with the enriched default catalog and AI-SDK providers auto-wired from your API keys.

Downloads

576

Readme

@swoosh-dev/sdk

The batteries-included drop-in for swoosh. One install, one call — the enriched default catalog plus AI-SDK provider adapters auto-wired from whatever API keys are in your environment. Also re-exports the whole toolkit, so it's a single import surface.

npm install @swoosh-dev/sdk ai @ai-sdk/openai   # add more @ai-sdk/* providers as you like
import { createRouter } from "@swoosh-dev/sdk";

const router = await createRouter();        // catalog + providers, wired from your keys

const out = await router.generateObject({
  task: "support.triage",
  input: ticket,
  prompt: `Classify: ${ticket}`,
  inputModalities: ["text"],
  requiresFeatures: ["structured_output"],
  preference: "cheapest",
});

OPENAI_API_KEY present + @ai-sdk/openai installed → OpenAI is live. Add ANTHROPIC_API_KEY + @ai-sdk/anthropic and Anthropic joins automatically. Providers without a key, or without their package installed, are simply skipped.

createRouter(options?)

| Option | Default | Notes | | --- | --- | --- | | catalog | defaultCatalog() from @swoosh-dev/capabilities | Any CapabilityCatalog. | | providers | auto-wired from API keys | Pass your own adapters to opt out of auto-wiring. | | defaultPreference | "balanced" | Used when a request omits preference. | | env | process.env | Source for key detection. | | load | dynamic import | Module loader (injectable for tests). |

Returns a Promise<ModelRouter> — it's async because provider packages are loaded on demand.

Bring-your-own-keys apps

Because providers are chosen from whatever keys are present, you can build a BYO-keys app without branching on provider in your code — pass the user's keys as the env and the router wires whatever they brought:

// Per request / per tenant — the user supplies whichever keys they have.
const router = await createRouter({
  env: {
    OPENAI_API_KEY: user.keys.openai,
    OPENROUTER_API_KEY: user.keys.openrouter, // one key, hundreds of models
    ANTHROPIC_API_KEY: user.keys.anthropic,
  },
});
// Same call regardless of who they are; the router routes across what they brought.
const out = await router.generateObject({ task, input, requiresFeatures: ["structured_output"] });

Users never configure models — the catalog supplies them, so new models become routable as the dataset updates, with no code change. A user with only an OpenRouter key gets routed across the OpenRouter catalog; a user with raw provider keys gets routed across those. "Bring me your keys, I'll handle the rest."

Auto-wiring details

autoProviders() is also exported if you want the adapters without the router. It maps each provider id to its @ai-sdk/* package via providerRegistry, checks hasApiKey, dynamically imports the package, and builds an adapter that resolves models through the provider factory. Requires ai; returns [] if ai isn't installed.

When to reach past the drop-in

This package trades a heavier dependency footprint for zero-config. If you want a lean install or full control, compose the granular packages directly — @swoosh-dev/router (zero-dep core), @swoosh-dev/ai-sdk, @swoosh-dev/capabilities, @swoosh-dev/judge. The drop-in is built entirely from them.

// Everything is also re-exported here:
import { byBenchmark, llmJudgePolicy, filterCapabilityCatalog, defaultCatalog } from "@swoosh-dev/sdk";