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

@xxanderwp/ai-conductor

v0.1.4

Published

Orchestrate any AI provider through one API.

Downloads

740

Readme

AI Conductor

CI Publish npm version npm downloads Node.js GitHub release License: MIT TypeScript

Orchestrate any AI provider through one API.

AI Conductor connects multiple OpenAI-compatible AI providers and routes chat requests through a single entry point. Prefer cheaper/free tiers with the cheapest strategy, spread load with round-robin, or fail over when a provider is rate-limited.

  • Author: XXanderWP

Install

npm install @xxanderwp/ai-conductor

Quick start

import { Conductor } from '@xxanderwp/ai-conductor';

const conductor = new Conductor({
  configPath: './config.yml',
});

const response = await conductor.chat([
  { role: 'user', content: 'Summarize this ticket for support.' },
]);

console.log(response.content, response.provider, response.strategy);

Or configure entirely in code:

const conductor = new Conductor({
  providers: [
    { id: 'gemini', priority: 100, dailyLimit: 1000, apiKey: process.env.GEMINI_API_KEY },
    { id: 'groq', priority: 90, apiKey: process.env.GROQ_API_KEY },
  ],
  routing: { strategy: 'cheapest' },
  fallback: ['gemini', 'groq', 'openrouter'],
  apiKeys: {
    openrouter: process.env.OPENROUTER_API_KEY!,
  },
});

YAML configuration

See examples/config.yml:

providers:
  - id: gemini
    priority: 100
    dailyLimit: 1000
    apiKey: ${GEMINI_API_KEY}
    model: gemini-flash-latest

  - id: groq
    priority: 90
    apiKey: ${GROQ_API_KEY}

routing:
  strategy: cheapest

fallback:
  - gemini
  - groq
  - openrouter

${ENV_VAR} placeholders are expanded from the environment. Keys can also come from apiKeys in the constructor or common env vars (GEMINI_API_KEY, GROQ_API_KEY, OPENAI_API_KEY, AI_CONDUCTOR_<ID>_API_KEY, …).

Built-in providers

Built-in OpenAI-compatible providers:

ollama, gemini, groq, cerebras, mistral, nvidia, github, zai, puter, opencode, huggingface, openrouter, cohere, openai, openai_compatible

Routing strategies

| Strategy | Behavior | | -------------------- | ------------------------------------------------------------- | | cheapest (default) | Prefer free-tier / likely-free models, then higher priority | | priority | Highest priority first | | failover | Try providers in config order until one succeeds | | round-robin | Rotate eligible providers | | first-available | Always use the first eligible provider |

fallback appends extra providers after the primary ordered list. dailyLimit soft-skips a provider for the rest of the UTC day once the cap is reached.

Providers, models, and probes

// Built-in registry vs current config
conductor.getAvailableProviders();
conductor.getConfiguredProviders();

// Parse OpenAI-compatible model catalogs
const geminiModels = await conductor.listModels('gemini');
const allModels = await conductor.listModels();

// Connectivity (API key + /models) vs real chat
await conductor.testProvider('gemini'); // real omitted → connectivity
await conductor.testProvider('gemini', { real: true });
await conductor.testProviders({ real: true });

Compress dialog context

const { messages } = await conductor.compressContext(history, {
  keepLast: 4, // keep the last 4 user/assistant messages
});
// messages[0] is a system note about earlier turns; the rest is the recent tail

Development

npm install
npm run typecheck
npm run lint
npm test
npm run build
npm run docs:sync

Playground (CLI TUI)

cp config.yml.example config.yml   # gitignored — add your keys
npm run playground

Commands inside the chat: /status, /clear, /provider <id|auto>, /test-all (confirm), /quit (Tab completes commands and provider ids).

LLM agents

  • AGENTS.md — how agents should navigate this project
  • skills/ — focused skill files (each includes a self-update instruction)

Package

| Field | Value | | ------- | ------------------------- | | Name | @xxanderwp/ai-conductor | | Version | 0.1.4 | | Author | XXanderWP | | License | MIT | | Node | >=18 |

Repository layout

.github/
.github/workflows/
.github/workflows/ci.yml
.github/workflows/publish.yml
scripts/
scripts/playground.mts
scripts/sync-docs.mjs
skills/
skills/api.md
skills/docs.md
skills/tech.md
src/
src/conductor.ts
src/config/
src/config/load.ts
src/config/types.ts
src/index.ts
src/providers/
src/providers/mock.ts
src/providers/openai-client.ts
src/providers/registry.ts
src/routing/
src/routing/order.ts
src/routing/usage.ts
src/types.ts
src/utils/
src/utils/suggest.ts
src/utils.ts
tests/
tests/conductor.test.ts
tests/suggest.test.ts

Skills for LLM agents

npm scripts

| Script | Purpose | | ----------------------- | ----------------------------------------------------- | | npm run build | Compile TypeScript to dist/ (CJS + ESM + typings) | | npm test | Run Jest unit tests | | npm run test:coverage | Run tests with coverage report | | npm run lint | ESLint check | | npm run format | Format with Prettier | | npm run typecheck | TypeScript --noEmit check | | npm run playground | Interactive CLI chat against root config.yml | | npm run docs:sync | Refresh generated README / AGENTS sections | | npm run docs:check | Fail if generated docs are stale | | npm run release | Publish to npm (prepublishOnly runs checks + build) |