当前位置: 首页 > news >正文

AxonHub 开源程序是一个现代 AI 网关系统,提供统一的 OpenAI、Anthropic 和 AI SDK 兼容 API

​一、软件介绍

文末提供程序和源码下载

AxonHub 是一个现代 AI 网关系统,提供统一的 OpenAI、Anthropic 和 AI SDK 兼容的 API 层,通过 Transformer 管道架构将请求转换到各种 AI 提供者。该系统具有全面的跟踪功能,帮助企业更好地管理和监控 AI 服务使用情况。它还包括全面的测试覆盖范围,以确保系统稳定性和可靠性。

二、Core Problems Solved  核心问题解决

Problem  问题AxonHub Solution  AxonHub 解决方案
Vendor Lock-in  供应商锁定🔄 Unified API interface, API format conversion, switch providers anytime
🔄 统一 API 接口,API 格式转换,随时切换供应商
Extensibility  可扩展性Flexible transformer architecture, supports multiple transformers
灵活的 Transformer 架构,支持多个 Transformer
Service Outages  服务中断⚡ Automatic failover, multi-channel redundancy
⚡ 自动故障转移,多通道冗余
Permission Management  权限管理📊 Comprehensive user permission management
📊 全面用户权限管理
Development Complexity  开发复杂性🛠️ Single SDK, unified interface standard
🛠️ 单一 SDK,统一接口标准

核心功能

Supported Features  🚀 支持的功能

Feature  功能Status  状态Description  描述Document  文档
Chat Completion  聊天完成✅ Done  ✅ 完成Conversational interface
对话界面
Chat Completions  聊天补全
Image Generation  图像生成⚠️ Partial   ⚠️ 部分Image generation  图像生成Image Generations  图像生成
Rerank  重排序📝 Todo  📝 待办事项Results ranking  结果排序-
Embedding  嵌入📝 Todo  📝 待办事项Vector embedding generation
向量嵌入生成
-
Realtime  实时📝 Todo  📝 待办事项Live conversation capabilities
实时对话功能

多提供者 AI 网关

Feature  功能Technical Implementation
技术实现
Business Value  商业价值
Unified API Interface  统一 API 接口OpenAI compatible standard, zero learning curve
兼容 OpenAI 标准,零学习曲线
Avoid vendor lock-in, reduce migration risk
避免供应商锁定,降低迁移风险
Automatic Failover  自动故障转移Multi-channel retry + load balancing
多通道重试 + 负载均衡
Service interruption time < 100ms
服务中断时间 < 100ms
Stream Processing  流处理Native SSE support, real-time response
原生 SSE 支持,实时响应
60% user experience improvement
用户体验提升 60%

 API Format Support  🔧 API 格式支持

Format  格式Status  状态Compatibility  兼容性Modalities  模态
OpenAI Chat Completions  OpenAI 聊天补全✅ Done  ✅ 完成Fully compatible  完全兼容Text, Image  文本、图像
Anthropic✅ Done  ✅ 完成Fully supported  完全支持Text  文本
AI SDK⚠️ Partial   ⚠️ 部分Partially supported  部分支持Text  文本
Gemini🔄 Todo  🔄 待办事项--

Permission Control  🏢 权限控制

Security Feature  安全功能Implementation  实现
Fine-grained Permission Control
细粒度权限控制
Role-based access control (RBAC)
基于角色的访问控制(RBAC)
Data Localization  数据本地化Configurable data storage policies
可配置的数据存储策略
API Key Management  API 密钥管理JWT + scope control
JWT + 权限控制

Deployment Guide  🚀 部署指南

💻 Personal Computer Deployment
💻 个人电脑部署

Perfect for individual developers and small teams. No complex configuration required.
非常适合个人开发者和小型团队。无需复杂配置。

Quick Download & Run  快速下载并运行
  1. 从文末夸克网盘 下载最新版本

    • Choose the appropriate version for your operating system:
      选择适合您操作系统的版本:
  2. Extract and run  解压并运行

    # Extract the downloaded file
    unzip axonhub_*.zip
    cd axonhub_*# Add execution permissions (only for Linux/macOS)
    chmod +x axonhub# Run directly - default SQLite database# Install AxonHub to system
    sudo ./install.sh# Start AxonHub service
    ./start.sh# Stop AxonHub service
    ./stop.sh
  3. Access the application  访问应用程序

    <span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>http://localhost:8090
    </code></span></span></span>

🖥️ Server Deployment  🖥️ 服务器部署

For production environments, high availability, and enterprise deployments.
用于生产环境、高可用性和企业部署。

Database Support  数据库支持

AxonHub supports multiple databases to meet different scale deployment needs:
AxonHub 支持多种数据库以满足不同规模的部署需求:

Database  数据库Supported Versions  支持的版本Recommended Scenario  推荐场景Auto Migration  自动迁移Links  链接
TiDB Cloud  TiDB 云Starter  入门Serverless, Free tier, Auto Scale
无服务器,免费套餐,自动扩展
✅ Supported  ✅ 支持TiDB Cloud  TiDB 云
TiDB Cloud  TiDB 云Dedicated  专用Distributed deployment, large scale
分布式部署,大规模
✅ Supported  ✅ 支持TiDB Cloud
TiDBV8.0+Distributed deployment, large scale
分布式部署,大规模
✅ Supported  ✅ 支持TiDB
Neon DB-Serverless, Free tier, Auto Scale
无服务器,免费套餐,自动扩展
✅ Supported  ✅ 支持Neon DB
PostgreSQL15+Production environment, medium-large deployments
生产环境,中大型部署
✅ Supported  ✅ 支持PostgreSQL
MySQL8.0+Production environment, medium-large deployments
生产环境,中大型部署
✅ Supported  ✅ 支持MySQL
SQLite3.0+Development environment, small deployments
开发环境,小规模部署
✅ Supported  ✅ 支持SQLite
Configuration  配置

AxonHub uses YAML configuration files with environment variable override support:
AxonHub 使用支持环境变量覆盖的 YAML 配置文件:

# config.yml
server:port: 8090name: "AxonHub"debug: falsedb:dialect: "tidb"dsn: "<USER>.root:<PASSWORD>@tcp(gateway01.us-west-2.prod.aws.tidbcloud.com:4000)/axonhub?tls=true"log:level: "info"encoding: "json"

Environment variables:  环境变量:

AXONHUB_SERVER_PORT=8090
AXONHUB_DB_DIALECT="tidb"
AXONHUB_DB_DSN="<USER>.root:<PASSWORD>@tcp(gateway01.us-west-2.prod.aws.tidbcloud.com:4000)/axonhub?tls=true"
AXONHUB_LOG_LEVEL=info

Docker Compose Deployment
Docker Compose 部署
# Clone project
git clone https://github.com/looplj/axonhub.git
cd axonhub# Set environment variables
export AXONHUB_DB_DIALECT="tidb"
export AXONHUB_DB_DSN="<USER>.root:<PASSWORD>@tcp(gateway01.us-west-2.prod.aws.tidbcloud.com:4000)/axonhub?tls=true"# Start services
docker-compose up -d# Check status
docker-compose ps
Virtual Machine Deployment
虚拟机部署

Download the latest release from GitHub Releases
从 GitHub Releases 下载最新版本

# Extract and run
unzip axonhub_*.zip
cd axonhub_*# Set environment variables
export AXONHUB_DB_DIALECT="tidb"
export AXONHUB_DB_DSN="<USER>.root:<PASSWORD>@tcp(gateway01.us-west-2.prod.aws.tidbcloud.com:4000)/axonhub?tls=true"sudo ./install.sh# Configuration file check
axonhub config check# Start service
#  For simplicity, we recommend managing AxonHub with the helper scripts:# Start
./start.sh# Stop
./stop.sh

📖 Usage Guide  📖 使用指南

1. Initial Setup  1. 初始设置

  1. Access Management Interface
    访问管理界面

    <span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>http://localhost:8090
    </code></span></span></span>
  2. Configure AI Providers  配置 AI 提供者

    • Add API keys in the management interface
      在管理界面中添加 API 密钥
    • Test connections to ensure correct configuration
      测试连接以确保正确配置
  3. Create Users and Roles  创建用户和角色

    • Set up permission management
      设置权限管理
    • Assign appropriate access permissions
      分配适当的访问权限

2. Channel Configuration  2. 频道配置

Configure AI provider channels in the management interface:
在管理界面配置 AI 提供者频道:

# OpenAI channel example
name: "openai"
type: "openai"
base_url: "https://api.openai.com/v1"
credentials:api_key: "your-openai-key"
supported_models: ["gpt-5", "gpt-4o"]
2.1 Test Connection  2.1 测试连接

Click the test button. If the test is successful, the configuration is correct.
点击测试按钮。如果测试成功,则配置正确。

2.2 Enable Channel  2.2 启用通道

After successful testing, click the enable button to activate the channel.
测试成功后,点击启用按钮以激活通道。

3. Add Users  3. 添加用户

  1. Create user accounts  创建用户账户
  2. Assign roles and permissions
    分配角色和权限
  3. Create API keys  创建 API 密钥

4. Claude Code/Codex Integration
4. Claude 代码/Codex 集成

4.1 Using AxonHub in Claude Code:
4.1 在 Claude 代码中使用 AxonHub:
# Set Claude Code to use AxonHub
export ANTHROPIC_API_KEY="your-axonhub-api-key"
export ANTHROPIC_BASE_URL="http://localhost:8090/anthropic"
4.2 Using AxonHub in Codex:
4.2 在 Codex 中使用 AxonHub:

configure the model provider in the codex config file: ${HOME}/.codex/config.toml
在 codex 配置文件中配置模型提供者:${HOME}/.codex/config.toml

model = "gpt-5"
model_provider = "axonhub-chat-completions"[model_providers.axonhub-chat-completions]
# Name of the provider that will be displayed in the Codex UI.
name = "AxonHub using Chat Completions"
# The path `/chat/completions` will be amended to this URL to make the POST
# request for the chat completions.
base_url = "http://127.0.0.1:8090/v1"
# If `env_key` is set, identifies an environment variable that must be set when
# using Codex with this provider. The value of the environment variable must be
# non-empty and will be used in the `Bearer TOKEN` HTTP header for the POST request.
env_key = "AXONHUB_API_KEY"
# Valid values for wire_api are "chat" and "responses". Defaults to "chat" if omitted.
wire_api = "chat"
# If necessary, extra query params that need to be added to the URL.
# See the Azure example below.
query_params = {}
4.3. Model Profiles Feature
4.3. 模型配置功能

AxonHub introduces a powerful model profiles feature that allows you to configure multiple model mapping profiles for your API keys. This feature is particularly useful for scenarios where you need to:
AxonHub 引入了一个强大的模型配置文件功能,允许您为您的 API 密钥配置多个模型映射配置文件。此功能在您需要以下场景时特别有用:

  • Quick Model Switching: Switch between different models without changing your API key configuration
    快速模型切换:无需更改 API 密钥配置即可在不同模型之间切换
  • Cost Optimization: Map expensive model requests to more cost-effective alternatives automatically
    成本优化:自动将昂贵的模型请求映射到更具成本效益的替代方案
  • Model Fallback: Configure fallback mappings when certain models are unavailable
    模型回退:当某些模型不可用时配置回退映射
4.4 How Profiles Work  4.4 配置文件的工作原理

When an active profile has model mappings configured, the system will automatically map requested models to their target models during API requests. For example:
当一个活跃配置文件中配置了模型映射时,系统会在 API 请求期间自动将请求的模型映射到它们的目标模型。例如:

  • Request claude-sonnet-20241022 → Actually use deepseek-v3.1 (model mapping)
    请求 claude-sonnet-20241022 → 实际使用 deepseek-v3.1 (模型映射)
  • Use regex patterns to match multiple models at once
    使用正则表达式模式一次性匹配多个模型
4.5 Claude Code/Codex + Profiles Workflow
4.5 Claude Code/Codex + 配置文件工作流

With the profiles feature, you only need to configure Claude Code once:
通过配置文件功能,您只需配置一次 Claude Code:

  1. Configure your API key profiles in the AxonHub management interface
    在 AxonHub 管理界面配置您的 API 密钥配置文件
  2. Set up model mappings for different providers (zhipu, deepseek, moonshot, etc.)
    为不同提供商(如 zhipu、deepseek、moonshot 等)设置模型映射
  3. Switch active profiles as needed without changing Claude Code configuration
    根据需要切换活动配置文件,而无需更改 Claude Code 配置
  4. Claude Code automatically uses the model mappings from your active profile
    Claude Code 会自动使用您活动配置文件中的模型映射

It eliminates the need to switch API keys or model names in development environments.
它消除了在开发环境中切换 API 密钥或模型名称的需要。


5. SDK Usage  5. SDK 使用

Python SDK
from openai import OpenAIclient = OpenAI(api_key="your-axonhub-api-key",base_url="http://localhost:8090/v1"
)response = client.chat.completions.create(model="gpt-4o",messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
Node.js SDK
import OpenAI from "openai";const openai = new OpenAI({apiKey: "your-axonhub-api-key",baseURL: "http://localhost:8090/v1",
});const completion = await openai.chat.completions.create({messages: [{ role: "user", content: "Hello!" }],model: "gpt-4o",
});

🛠️ Development Guide  🛠️ 开发指南

Architecture Design  架构设计

AxonHub implements a sophisticated bidirectional data transformation pipeline that ensures seamless communication between clients and AI providers:
AxonHub 实现了一个复杂的双向数据转换管道,确保客户端和 AI 提供者之间的无缝通信:

Pipeline Components  管道组件
Component  组件Purpose  目的Key Features  主要功能
Client  客户端Application layer  应用层Web apps, mobile apps, API clients
Web 应用、移动应用、API 客户端
Inbound Transformer  入站转换器Request preprocessing  请求预处理Parse, validate, normalize input
解析、验证、规范化输入
Unified Request  统一请求Core processing  核心处理Route selection, load balancing, failover
路由选择、负载均衡、故障转移
Outbound Transformer  外向式转换器Provider adaptation  提供者适配Format conversion, protocol mapping
格式转换,协议映射
Provider  提供者AI services  AI 服务OpenAI, Anthropic, DeepSeek, etc.
OpenAI、Anthropic、DeepSeek 等

This architecture ensures:
该架构确保:

  • ⚡ Low Latency: Optimized processing pipeline
    ⚡低延迟:优化处理流程
  • 🔄 Auto Failover: Seamless provider switching
    🔄 自动故障转移:无缝服务提供商切换
  • 📊 Real-time Monitoring: Complete request tracing
    📊 实时监控:完整请求跟踪
  • 🛡️ Security & Validation: Input sanitization and output verification
    🛡️ 安全与验证:输入清理和输出验证

Technology Stack  技术栈

Backend Technology Stack  后端技术栈
  • Go 1.24+ - High-performance backend
    Go 1.24+ - 高性能后端
  • Gin - HTTP framework  Gin - HTTP 框架
  • Ent ORM - Type-safe ORM
    Ent ORM - 类型安全的 ORM
  • gqlgen - GraphQL code generation
    gqlgen - GraphQL 代码生成
  • JWT - Authentication  JWT - 认证
Frontend Technology Stack
前端技术栈
  • React 19 - Modern UI framework
    React 19 - 现代化 UI 框架
  • TypeScript - Type safety  TypeScript - 类型安全
  • Tailwind CSS - Styling framework
    Tailwind CSS - 样式框架
  • TanStack Router - File-based routing
    TanStack Router - 基于文件的路由
  • Zustand - State management
    Zustand - 状态管理

Development Environment Setup
开发环境设置

# Clone project
git clone https://github.com/looplj/axonhub.git
cd axonhub# Start backend
make build-backend
./axonhub# Start frontend (new terminal)
cd frontend
pnpm install
pnpm dev

Build Project

make build

三、软件下载

夸克网盘

本文信息来源于GitHub作者地址:https://github.com/looplj/axonhub

http://www.dtcms.com/a/486566.html

相关文章:

  • 【运维心得】playbook远程清理windows亲测步骤
  • 【学习AI-相关路程-mnist手写数字分类-一段学习的结束:自我学习AI-复盘-代码-了解原理-综述(5) 】
  • 免费的cms视频网站模板3000款免费软件app下载
  • 网站模板没有html文件下载网站建设中忽略的字体侵权行为
  • QT学习和代码练习
  • 把 Python 应用打包成 Windows 可执行程序 — 完整指南
  • 阿里云代理商:什么是阿里云CDN配额?
  • 做推广任务的网站制作图片的软件加字体
  • 做公司网站优劣势成都建设网站那个好
  • vLLM 推理 AWQ 量化后的模型
  • **发散创新:游戏物理引擎的深入探究**一、引言随着游戏产业的飞速发展,游戏物理引擎作为游戏开发中不可或缺的一部分,
  • 上海网站制作网站wordpress 显示文章作者
  • QT 中的元对象系统(七):Q_GADGET 机制
  • 德阳做网站公司实体店线上线下运营模式
  • Agentlightning环境准备
  • 创建网站哪个好卫生计生加强门户网站建设
  • 申请建设活动中心网站管理咨询公司有哪些方面
  • Windows Server 2019 IP黑名单设置,保护云服务器安全
  • K8s存储-PV与PVC
  • k8s中PV 与 PVC
  • 免费网站推广网站破解版网站建设具体工作
  • 目标检测项目核心笔记:从任务定义到算法流程
  • 网站建设的基本步骤是中国设备网
  • 建设网站的优点跟缺点要看网现在的地址是多少
  • 前端学习总结——AI主流前沿方向篇
  • 制作网页的网站哪个好用产品市场营销策划方案
  • [Linux]学习笔记系列 -- lib/zlib DEFLATE压缩与解压缩
  • 为电力设备装上“感知神经”:AHE100无线温湿度传感器,守护安全运行的隐形卫士
  • RocketMQ如何保证消息不丢失
  • CC1-二叉树的最小深度