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

@xpell/xai-providers

v2.0.7

Published

@xpell/xai-providers

Readme

@xpell/xai-providers

Official AI provider implementations for the Xpell AI Runtime.

@xpell/xai-providers contains provider adapters that implement the XAIProvider interface used by @xpell/node and the XAI runtime.

The goal is to provide a consistent API across different AI backends while allowing Xpell applications, modules, and services to switch providers without changing business logic.

Installation

pnpm add @xpell/xai-providers

Available Providers

AzureProvider

Direct integration with Azure OpenAI deployments.

import { AzureProvider } from "@xpell/xai-providers/azure";

Supports:

  • GPT-4o
  • GPT-4o-mini
  • GPT-5
  • Azure OpenAI compatible deployments

AimeProvider

Integration with XAI Router.

Instead of talking directly to Azure/OpenAI, the provider sends requests to an XAI Router instance using an Xpell AI API Key.

import { AimeProvider } from "@xpell/xai-providers/aime";

Supports:

  • XAI Router
  • Usage tracking
  • Token accounting
  • Routing rules
  • Centralized billing
  • Multi-provider routing

MockProvider

Testing provider.

import { MockProvider } from "@xpell/xai-providers/mock";

Useful for:

  • Unit tests
  • Local development
  • Runtime validation

Usage

Registering Providers

Providers are registered through the XAI runtime.

import { _xai } from "@xpell/node"; import { AzureProvider } from "@xpell/xai-providers/azure"; _xai.registerProvider( "azure", new AzureProvider({ endpoint: process.env.AZURE_OPENAI_ENDPOINT!, apiKey: process.env.AZURE_OPENAI_API_KEY!, deployment: process.env.AZURE_OPENAI_DEPLOYMENT!, }) );

Set default provider:

await _x.execute({ _module: "xai", _op: "set_default", _params: { _provider: "azure" } });

Using AimeProvider

import { _xai } from "@xpell/node"; import { AimeProvider } from "@xpell/xai-providers/aime"; _xai.registerProvider( "aime", new AimeProvider({ endpoint: process.env.AIME_ENDPOINT!, apiKey: process.env.AIME_API_KEY!, }) );

Set as default:

await _x.execute({ _module: "xai", _op: "set_default", _params: { _provider: "aime" } });

All XAI calls will now be routed through XAI Router.

XAIProvider Interface

Every provider implements:

interface XAIProvider { generate( input: XAIInput ): Promise; }

XAIInput

type XAIInput = { prompt: string; system?: string; context?: any; response_format?: { type: "text" | "json_object"; }; };

XAIResult

type XAIUsage = { input_tokens?: number; output_tokens?: number; total_tokens?: number; }; type XAIResult = { text: string; raw?: unknown; usage?: XAIUsage; };

Token Usage

Providers should return token usage whenever available.

Example:

{ text: "Hello world", usage: { input_tokens: 14, output_tokens: 10, total_tokens: 24 } }

The XAI runtime, XVibe, XStudio, and XAI Router use this information for:

  • telemetry
  • analytics
  • usage tracking
  • billing
  • routing decisions

Architecture

Application ↓ XAI ↓ XAIProvider ↓ Provider API

Examples:

XVibe ↓ XAI ↓ AzureProvider ↓ Azure OpenAI XVibe ↓ XAI ↓ AimeProvider ↓ XAI Router ↓ Azure/OpenAI/Anthropic

Project Goals

  • Unified provider interface
  • Runtime provider switching
  • Token usage normalization
  • Structured output support
  • Provider-agnostic application code
  • Seamless integration with XAI Router

License

Part of the Xpell AI ecosystem.

https://xpell.ai