AA

ahwanulm/amrouter

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

15 stars 质量 66 趋势 17MIT

ahwanulm/amrouter 是从 https://github.com/ahwanulm/amrouter. 导入的特工技能候选人。

概览

ahwanulm/amrouter 是从 https://github.com/ahwanulm/amrouter. 导入的特工技能候选人。

概述(AI 翻译)

自托管的AI网关——一个终端,多个供应商,自动备份。

9Router v2 是 9Router 的解耦重写,明确区分了专用的 Express 后端 和 Vite + React 前端。它提供了一个兼容 OpenAI 的 REST API,能够通过自动负载均衡、备回和密钥轮换,代理数十个 AI 提供者之间的请求。


截图

登录页面 配额追踪器

特色

  • OpenAI 兼容 API — 支持任何支持 /v1/chat/completions、/v1/images/generations、/v1/audio/speech、/v1/embeddings 等的客户端。
  • 多服务提供商路由 — Cloudflare Workers AI、OpenAI、Anthropic、Gemini、Groq 等众多平台
  • Cloudflare Workers AI 自动化 — 通过 Playwright + 2Captcha + Ammail 临时邮件自动注册和提取 API 密钥
  • 仪表盘界面 — 通过现代暗模式界面管理提供者、连接、代理池、CLI工具和自动化
  • OIDC / 密码认证 — 单点登录或本地凭证
  • 代理技能 — 适用于Claude、Gemini、Codex及其他AI编码代理的现成型 SKILL.md 文件

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

9Router v2

A self-hosted AI gateway — one endpoint, many providers, auto-fallback.

9Router v2 is a decoupled rewrite of 9Router with a clean separation between a dedicated Express backend and a Vite + React frontend. It exposes an OpenAI-compatible REST API that proxies requests across dozens of AI providers with automatic load balancing, fallback, and key rotation.


Screenshots

Login Page Quota Tracker

Features

  • OpenAI-compatible API — works with any client that supports /v1/chat/completions, /v1/images/generations, /v1/audio/speech, /v1/embeddings, etc.
  • Multi-provider routing — Cloudflare Workers AI, OpenAI, Anthropic, Gemini, Groq, and many more
  • Cloudflare Workers AI Automation — automates account registration and API key extraction with Playwright + 2Captcha + Ammail temp mail
  • Dashboard UI — manage providers, connections, proxy pools, CLI tools, and automation from a modern dark-mode interface
  • OIDC / Password authentication — single sign-on or local credentials
  • Agent Skills — ready-to-use SKILL.md files for Claude, Gemini, Codex, and other AI coding agents
  • SQLite backend — zero-dependency local database, no external services required

Architecture

AMRouter/
├── backend/          # Express server (port 3001)
│   └── src/
│       ├── routes/   # Auto-routed endpoints (/v1, /api, /auth, ...)
│       ├── db/       # SQLite via better-sqlite3
│       └── automation/ # Playwright automation scripts
├── frontend/         # Vite + React SPA (port 5177)
│   └── src/
│       ├── pages/    # Dashboard pages
│       └── shared/   # Components, hooks, constants
└── skills/           # Agent SKILL.md files

Quick Start

Requirements

  • Node.js 20+
  • Python 3.10+ (for automation features)
  • Chromium (for Playwright automation)

Install

git clone https://github.com/ahwanulm/AMRouter.git
cd AMRouter
npm install

Development

npm run dev          # Start both backend + frontend concurrently
npm run backend      # Backend only (port 3001)
npm run frontend     # Frontend only (port 5177)

Environment Variables

Copy and configure the backend environment:

cp backend/.env.template backend/.env

Key variables:

Variable Description
PORT Backend server port (default: 3001)
REQUIRE_LOGIN Enable authentication (true/false)
JWT_SECRET Secret for JWT signing
ADMIN_PASSWORD Dashboard admin password

Production Deployment

1. Build Frontend

cd frontend && npm run build

2. Start Backend

cd backend && npm start

3. Nginx Reverse Proxy

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add ahwanulm/amrouter
新手?先看 mcpskill.org 教程 →