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

@ultra-dex/sdk

v1.0.0

Published

Official Ultra-Dex SDK for JavaScript and TypeScript

Downloads

18

Readme

@ultra-dex/sdk

Route AI calls across providers. Cut costs 30–50%. Automatic failover.

Install

npm install @ultra-dex/sdk

Quickstart (5 lines)

import { UltraDex } from '@ultra-dex/sdk'

const dex = new UltraDex({ defaultProvider: 'openai' })

// Register providers
dex.registerProvider('openai', new OpenAIProvider({ apiKey: process.env.OPENAI_KEY }))
dex.registerProvider('anthropic', new AnthropicProvider({ apiKey: process.env.ANTHROPIC_KEY }))

// Enable smart routing
dex.enableRouter({ strategy: 'cheapest' })

// Use it — same API you already know
const response = await dex.chat([{ role: 'user', content: 'Hello' }])
// → Automatically routes to cheapest available provider

Why @ultra-dex/sdk?

| Feature | @ultra-dex/sdk | LiteLLM | Raw OpenAI SDK | |---------|---------------|---------|----------------| | Multi-provider routing | ✅ 4 strategies | ✅ basic | ❌ | | Circuit breakers | ✅ auto-disable unhealthy | ❌ | ❌ | | Cost tracking (p50/p95/p99) | ✅ per-provider | ❌ | ❌ | | Budget limits | ✅ auto-cutoff | ❌ | ❌ | | Middleware pipeline | ✅ logging, retry, cache, rate-limit | ❌ | ❌ | | TypeScript-first | ✅ | ❌ Python | ✅ | | Zero config | ✅ works in 5 lines | ⚠️ proxy server needed | ✅ |

Routing Strategies

cheapest — minimize cost

Routes to the provider with the lowest cost-per-token based on live stats.

fastest — minimize latency

Routes to the provider with the best p50 latency.

round-robin — distribute evenly

Rotates across all healthy providers evenly.

fallback-chain — primary with automatic failover

Uses your preferred order. If one fails, instantly tries the next.

dex.enableRouter({
  strategy: 'fallback-chain',
  fallbackOrder: ['anthropic', 'openai', 'google']
})

Cost Tracking

const stats = dex.getRouterStats()
// → { openai: { avgLatency: 340, totalCost: 12.50, errorRate: 0.02 }, ... }

Middleware

import { loggingMiddleware, retryMiddleware, cacheMiddleware } from '@ultra-dex/sdk'

dex.middleware.use('log', loggingMiddleware())
dex.middleware.use('retry', retryMiddleware({ maxRetries: 3 }))
dex.middleware.use('cache', cacheMiddleware({ ttlMs: 60000 }))

Provider Wrappers

Bring your own provider SDKs and wrap them in ~10 lines:

import OpenAI from 'openai'

class OpenAIProvider {
  constructor({ apiKey, model = 'gpt-4o' }) {
    this.client = new OpenAI({ apiKey })
    this.model = model
  }

  async chat(messages, opts = {}) {
    const res = await this.client.chat.completions.create({
      model: opts.model || this.model,
      messages,
    })
    return {
      content: res.choices[0].message.content,
      usage: {
        promptTokens: res.usage.prompt_tokens,
        completionTokens: res.usage.completion_tokens,
      },
      provider: 'openai',
      model: res.model,
    }
  }

  async *stream(messages, opts = {}) {
    const res = await this.client.chat.completions.create({
      model: opts.model || this.model,
      messages,
      stream: true,
    })
    for await (const chunk of res) {
      yield { content: chunk.choices[0]?.delta?.content || '' }
    }
  }

  async embed(text, opts = {}) {
    const res = await this.client.embeddings.create({
      model: opts.model || 'text-embedding-3-small',
      input: text,
    })
    return { embedding: res.data[0].embedding }
  }
}

Pro Dashboard (optional, $29/mo)

See real-time cost analytics at app.ultra-dex.dev

License

MIT