gateway
adaline/gateway
Fully Local, Production-Grade Super SDK for Calling More Than 300+ LLMs
Overview
Adaline Gateway provides a simple, unified interface to call over 200 Language Learning Models (LLMs) locally with features such as batching, retries, caching, callbacks and OpenTelemetry support.
Categories
Tags
Similar tools
ECC
affaan-m/ECC
The agent harness performance optimization system
AutoGPT
Significant-Gravitas/AutoGPT
AutoGPT: Build, Deploy, and Run AI Agents
ollama
ollama/ollama
Get up and running with Kimi-K2.6, GLM-5.1, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
prompts.chat
f/prompts.chat
The world's largest open-source prompt library for AI
transformers
huggingface/transformers
๐ค Transformers: the model-definition framework for state-of-the-art machine learning models
JavaGuide
Snailclimb/JavaGuide
Snailclimb/JavaGuide: ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Install
npm install gatewayREADME
Adaline Gateway
The only fully local, production-grade Super SDK that provides a simple, unified, and powerful interface for calling more than 300+ LLMs.
- Production-ready and trusted by enterprises
- Fully local and NOT a proxy - deploy it anywhere
- Built-in batching, retries, caching, callbacks, and OpenTelemetry support
- Extensible with custom plugins for caching, logging, HTTP clients, and more - use it like building blocks to integrate with your infrastructure
- Supports plug-and-play providers - run fully custom providers while leveraging all the benefits of Adaline Gateway
Features
- ๐ง Strongly typed in TypeScript
- ๐ฆ Isomorphic - works everywhere
- ๐ 100% local, 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 comprehensive instrumentation and hooks
- ๐ OpenTelemetry integration for existing infrastructure
- ๐ Plug-and-play custom providers for local and custom models
Providers
| Provider | Chat Models | Embedding Models |
|---|---|---|
| OpenAI | โ | โ |
| Anthropic | โ | โ |
| Google AI Studio | โ | โ |
| Google Vertex | โ | โ |
| xAi | โ | โ |
| AWS Bedrock | โ | โ |
| Azure OpenAI | โ | โ |
| Groq | โ | โ |
| Together AI | โ | โ |
| Open Router | โ | โ |
| Custom (OpenAI-like) | โ | โ |
| Voyage | โ | โ |
Installation
Core packages
npm install @adaline/gateway @adaline/types
Provider packages
Dependencies for providers are optional. You can install them as needed. For example:
npm install @adaline/openai @adaline/anthropic @adaline/google @adaline/open-router @adaline/bedrock
Quickstart
Chat
This example demonstrates how to invoke an LLM with a simple text prompt in both non-streaming and streaming modes.
import { Gateway } from "@adaline/gateway";
import { OpenAI } from "@adaline/openai";
import { Config, ConfigType, MessageType } from "@adaline/types";
const OPENAI_API_KEY = "your-api-key"; // Replace with your OpenAI API key
const gateway = new Gateway();
const openai = new OpenAI();
const gpt4o = openai.chatModel({
modelName: "gpt-4o",
apiKey: OPENAI_API_KEY,
});
const config: ConfigType = Config().parse({
temperature: 0.7,
maxTokens: 300,
});
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}?`,
}],
},
];
// * Complete chat
async function runCompleteChat() {
const completeChat = await gateway.completeChat({
model: gpt4o,
config,
messages,
tools: [],
});
console.log(completeChat.provider.request); // HTTP Request sent to Provider
console.log(completeChat.provider.response); // HTTP Response from Provider
console.log(completeChat.cached); // Whether the response was cached
console.log(completeChat.latencyInMs); // Latency in milliseconds
console.log(completeChat.request); // Request in Gateway types
console.log(completeChat.response); // Response in Gateway types, E.g.:
// {
// "messages": [
// {
// "role": "assistant",
// "c