惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
小众软件
小众软件
爱范儿
爱范儿
Y
Y Combinator Blog
博客园 - Franky
美团技术团队
博客园 - 【当耐特】
The Cloudflare Blog
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
IT之家
IT之家
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
WordPress大学
WordPress大学
V
Visual Studio Blog
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
A3M Router v2.0: Now an OpenAI-Compatible AI Gateway with...
Ad Man · 2026-05-18 · via DEV Community

Ad Man

We just shipped A3M Router v2.0.0 — the biggest update since launch.

What started as a simple routing library is now a full AI Gateway.

What's New

1. OpenAI-Compatible Proxy Server

npx a3m-router serve

Enter fullscreen mode Exit fullscreen mode

That's it. You now have an OpenAI-compatible API proxy running on localhost:8787.

# Drop-in replacement — just change the base URL
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8787/v1",
    api_key="not-needed"  # A3M Router handles provider keys
)

response = client.chat.completions.create(
    model="auto",  # Intelligent routing
    messages=[{"role": "user", "content": "Hello"}]
)

Enter fullscreen mode Exit fullscreen mode

Any OpenAI SDK works without code changes. Python, Node, LangChain, LlamaIndex — just point base_url to A3M Router.

2. Real-Time Dashboard

http://localhost:8787/

Enter fullscreen mode Exit fullscreen mode

Live dashboard showing:

  • Request volume and costs
  • Provider status (online/offline)
  • Request log with routing decisions
  • Cost breakdown by provider

3. LangChain Adapter

import { A3MChatModel } from 'adaptive-memory-multi-model-router/langchain';

const model = new A3MChatModel({ modelName: 'auto' });
const response = await model.invoke([new HumanMessage("Hello")]);

Enter fullscreen mode Exit fullscreen mode

Drop-in replacement for ChatOpenAI. Supports streaming, tool calling, and structured output.

4. Guardrails Engine

import { GuardrailEngine } from 'adaptive-memory-multi-model-router';

const guardrail = new GuardrailEngine({
  promptInjection: true,
  piiDetection: true,
  contentFilter: true
});

const result = await guardrail.checkInput(userInput);
if (result.blocked) {
  // Prompt injection or PII detected
  console.log(result.reason);
}

Enter fullscreen mode Exit fullscreen mode

Built-in detection for:

  • Prompt injection attempts
  • PII (emails, phones, SSNs, credit cards, API keys)
  • Harmful content
  • Language detection for routing

5. Semantic Cache

import { SemanticCache } from 'adaptive-memory-multi-model-router';

const cache = new SemanticCache({ similarityThreshold: 0.92 });

// First query: miss, calls provider
const result1 = await cache.get("What is Python?");

// Semantically similar: HIT (no API call!)
const result2 = await cache.get("Tell me about Python");

Enter fullscreen mode Exit fullscreen mode

Catches semantically similar queries using n-gram similarity. No embedding API needed.

6. Cost Analytics

import { CostAnalytics } from 'adaptive-memory-multi-model-router';

const analytics = new CostAnalytics();
analytics.record({ provider: 'groq', cost: 0.001, latency: 420 });

const savings = analytics.getSavings('openai');
// Total saved: $X, XX% cheaper, projected monthly savings: $Y

Enter fullscreen mode Exit fullscreen mode

7. 39 Providers (was 12)

New providers added:

  • Local: Ollama, LM Studio, vLLM
  • Cheap/Fast: DeepInfra, Together AI, Fireworks, Anyscale, Novita, SambaNova
  • Mid-tier: Cohere, Perplexity, AI21
  • Asian: DeepSeek, Moonshot, Qwen, Zhipu, Yi
  • Enterprise: Azure OpenAI, AWS Bedrock, Google Vertex

Quick Start

# Install
npm install adaptive-memory-multi-model-router

# Start the gateway
npx a3m-router serve

# Or use as a library
node -e "const { createA3MRouter } = require('adaptive-memory-multi-model-router'); ..."

Enter fullscreen mode Exit fullscreen mode

The Numbers

Metric v1.9.5 v2.0.0
Providers 12 39
Exports 13 17
Proxy server
Dashboard
LangChain
Guardrails Basic Full engine
Semantic cache
Cost analytics Basic Full analytics

Links

MIT license. Open source. No vendor lock-in.


Built because I was tired of marketing claims. Sharing the data so you don't have to benchmark yourself.