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

@adaline/gateway

v1.12.0

Published

Adaline Gateway

Readme

Adaline Gateway

npm bundle size npm type definitions ESLint NPM NPM version

The only fully local production-grade Super SDK that provides a simple, unified, and powerful interface for calling more than 200+ LLMs.

  • Production-ready and used by enterprises.
  • Fully local and NOT a proxy. You can deploy it anywhere.
  • Comes with batching, retries, caching, callbacks, and OpenTelemetry support.
  • Supports custom plugins for caching, logging, HTTP client, and more. You can use it like LEGOs and make it work with your infrastructure.
  • Supports plug-and-play providers. You can run fully custom providers and still leverage all the benefits of Adaline Gateway.

Features

  • 🔧 Strongly typed in TypeScript
  • 📦 Isomorphic - works everywhere
  • 🔒 100% local and private and NOT a proxy
  • 🛠️ Tool calling support across all compatible LLMs
  • 📊 Batching for all requests with custom queue support
  • 🔄 Automatic retries with exponential backoff
  • ⏳ Caching with custom cache plug-in support
  • 📞 Callbacks for full custom instrumentation and hooks
  • 🔍 OpenTelemetry to plug tracing into your existing infrastructure
  • 🔌 Plug-and-play custom providers for local and custom models

Quickstart

Install packages

npm install @adaline/gateway @adaline/types @adaline/openai @adaline/anthropic 

Create a Gateway object

Gateway object maintains the queue, cache, callbacks, implements OpenTelemetry, etc. You should use the same Gateway object everywhere to get the benefits of all the features.

import { Gateway } from "@adaline/gateway";

const gateway = new Gateway();

Create a provider object

Provider object stores the types/information about all the models within that provider. It exposes the list of all the chat openai.chatModelLiterals() and embedding openai.embeddingModelLiterals() models.

import { Anthropic } from "@adaline/anthropic";
import { OpenAI } from "@adaline/openai";

const openai = new OpenAI();
const anthropic = new Anthropic();

Create a model object

Model object enforces the types from roles, to config, to different modalities that are supported by that model. You can also provide other keys like baseUrl, organization, etc.

Model object also exposes functions:

  • transformModelRequest that takes a request formatted for the provider and converts it into the Adaline super-types.
  • getStreamChatData that is then used to compose other provider calls. For example, calling an Anthropic model from Bedrock.
  • and many more to enable deep composability and provide runtime validations.
const gpt4o = openai.chatModel({
  modelName: "gpt-4o",
  apiKey: "your-api-key",
});

const haiku = anthropic.chatModel({
  modelName: "claude-3-haiku-20240307",
  apiKey: "your-api-key",
});

Create the config object

Config object provides type checks and also accepts generics that can be used to add max, min, and other validation checks per model.

import { Config } from "@adaline/types";

const config = Config().parse({
  maxTokens: 200,
  temperature: 0.9,
});

Create the messages object

Message object is the Adaline super-type that supports all the roles and modalities across 200+ LLMs.

import { MessageType } from "@adaline/types";

const messages: MessageType[] = [
  {
    role: "system",
    content: [{
      modality: "text",
      value: "You are a helpful assistant. You are extremely concise.
    }],
  },
  {
    role: "user",
    content: [{
      modality: "text",
      value: `What is ${Math.floor(Math.random() * 100) + 1} + ${Math.floor(Math.random() * 100) + 1}?`,
    }],
  },
];

Stream chat using Gateway

await gateway.streamChat({
  model: gpt4o,
  config: config,
  messages: messages,
});

Complete chat using Gateway

await gateway.completeChat({
  model: haiku,
  config: config,
  messages: messages,
});