Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fc6b365
feat: 优化token计量输出格式
May 25, 2026
2e24a62
Merge remote-tracking branch 'upstream/master' into dev
May 26, 2026
6fd08fa
feat: 支持从 GitHub 安装指定版本的插件
May 27, 2026
a6118a5
feat: 增加对账号暂时不可用的处理逻辑及相关测试
May 27, 2026
116883d
feat: 更新账号状态处理逻辑,增加对非池账号的跟踪与测试
May 27, 2026
362c018
fix: 修复使用记录查询引起的性能问题
May 27, 2026
24eca9e
Refactor usage tracking: Usage表字段重构,前端适配
May 27, 2026
26b06a3
refactor: 更新用量模型
May 27, 2026
129a563
feat: 实现基于游标的分页功能,更新使用记录查询逻辑及相关接口
May 27, 2026
afad204
feat: 重构计费逻辑,更新计费覆盖字段及相关测试用例
May 27, 2026
72b0643
feat: 添加启动迁移功能,重构SQL语句处理及相关测试用例
May 27, 2026
2449b9a
feat: 增强数据库初始化检查,添加对缺失数据库和表的错误处理逻辑及相关单元测试
May 27, 2026
16ae369
Merge remote-tracking branch 'upstream/master' into dev
May 27, 2026
dfa66d4
feat: 更新 ListUser 和 ListAdmin 方法的返回值,修复返回类型以支持布尔值和指针
May 27, 2026
3066e53
fix: 修改创建索引逻辑
May 27, 2026
e75e30a
feat: 重构启动迁移逻辑
May 28, 2026
0605f20
Merge remote-tracking branch 'upstream/master' into dev
May 29, 2026
7c81a90
feat: 添加续链请求支持,增强响应亲和性管理
May 29, 2026
6e90223
feat: 修改软粘连优先级
May 29, 2026
83304b9
feat: 添加续链请求容量不足错误处理,增强错误区分能力
May 29, 2026
b558dae
feat: 独立发版
May 29, 2026
a1ad546
chore: use master as release branch
May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [master]

env:
GOPRIVATE: github.com/DouDOU-start/airgate-sdk
GOPRIVATE: github.com/DevilGenius/airgate-sdk

jobs:
ci:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ permissions:
packages: write

env:
GOPRIVATE: github.com/DouDOU-start/airgate-sdk
GOPRIVATE: github.com/DevilGenius/airgate-sdk
REGISTRY: ghcr.io
IMAGE_NAME: doudou-start/airgate-core
IMAGE_NAME: devilgenius/airgate-core

jobs:
# ------------------------------------------------------------
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
echo "Injecting Version=${VERSION}"
mkdir -p bin
cd backend && go build -buildvcs=false -trimpath \
-ldflags "-X 'github.com/DouDOU-start/airgate-core/internal/version.Version=${VERSION}' -s -w" \
-ldflags "-X 'github.com/DevilGenius/airgate-core/internal/version.Version=${VERSION}' -s -w" \
-o ../bin/airgate-core-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/server

- name: Generate SHA256
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 DouDOU-start
Copyright (c) 2026 DevilGenius

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GO := GOTOOLCHAIN=local go

# 版本号:默认从 git 派生(dirty 检测),release workflow 通过 -ldflags 注入。
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -X github.com/DouDOU-start/airgate-core/internal/version.Version=$(VERSION)
LDFLAGS := -X github.com/DevilGenius/airgate-core/internal/version.Version=$(VERSION)

.PHONY: help dev dev-backend dev-frontend dev-plugins dev-plugin-openai dev-plugin-claude dev-plugin-playground dev-plugin-epay dev-plugin-health dev-plugin-kiro dev-plugin-studio \
build build-backend build-frontend \
Expand Down Expand Up @@ -266,7 +266,7 @@ lint: ## 代码检查(需要安装 golangci-lint)
fmt: ## 格式化代码
@cd $(BACKEND_DIR) && \
if command -v goimports > /dev/null 2>&1; then \
goimports -w -local github.com/DouDOU-start .; \
goimports -w -local github.com/DevilGenius .; \
else \
$(GO) fmt ./...; \
fi
Expand Down
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<p><strong>可插件化的统一 AI 网关运行时</strong></p>

<p>
<a href="https://github.com/DouDOU-start/airgate-core/releases"><img src="https://img.shields.io/github/v/release/DouDOU-start/airgate-core?style=flat-square" alt="release" /></a>
<a href="https://github.com/DouDOU-start/airgate-core/pkgs/container/airgate-core"><img src="https://img.shields.io/badge/ghcr.io-airgate--core-blue?style=flat-square&logo=docker" alt="ghcr.io" /></a>
<a href="https://github.com/DouDOU-start/airgate-core/blob/master/LICENSE"><img src="https://img.shields.io/github/license/DouDOU-start/airgate-core?style=flat-square" alt="license" /></a>
<a href="https://github.com/DevilGenius/airgate-core/releases"><img src="https://img.shields.io/github/v/release/DevilGenius/airgate-core?style=flat-square" alt="release" /></a>
<a href="https://github.com/DevilGenius/airgate-core/pkgs/container/airgate-core"><img src="https://img.shields.io/badge/ghcr.io-airgate--core-blue?style=flat-square&logo=docker" alt="ghcr.io" /></a>
<a href="https://github.com/DevilGenius/airgate-core/blob/master/LICENSE"><img src="https://img.shields.io/github/license/DevilGenius/airgate-core?style=flat-square" alt="license" /></a>
<img src="https://img.shields.io/badge/Go-1.25-00ADD8?style=flat-square&logo=go" alt="go" />
<img src="https://img.shields.io/badge/React-19-61DAFB?style=flat-square&logo=react" alt="react" />
</p>
Expand Down Expand Up @@ -42,13 +42,13 @@ AirGate 不是又一个"集成了 N 个 AI 平台"的网关,而是一套**把

| 插件 | 类型 | 能力 | 仓库 |
|---|---|---|---|
| **gateway-openai** | gateway | OpenAI Responses / Chat Completions / ChatGPT OAuth / Anthropic 协议翻译 / WebSocket | [DouDOU-start/airgate-openai](https://github.com/DouDOU-start/airgate-openai) |
| **gateway-claude** | gateway | Claude Messages API 网关:OAuth 授权、TLS 指纹、用量监控 | [DouDOU-start/airgate-claude](https://github.com/DouDOU-start/airgate-claude) |
| **gateway-kiro** | gateway | Kiro (AWS CodeWhisperer) 反代网关,兼容 Anthropic Messages API | [DouDOU-start/airgate-kiro](https://github.com/DouDOU-start/airgate-kiro) |
| **airgate-playground** | extension | AI 对话插件:网页聊天、多模型切换、会话管理 | [DouDOU-start/airgate-playground](https://github.com/DouDOU-start/airgate-playground) |
| **airgate-studio** | extension | 面向图片、视频、音频等多模态内容生成的统一创作中心 | [DouDOU-start/airgate-studio](https://github.com/DouDOU-start/airgate-studio) |
| **payment-epay** | extension | 多渠道支付:易支付(虎皮椒/彩虹)/ 支付宝官方 / 微信支付官方,含充值页、订单管理、服务商配置 | [DouDOU-start/airgate-epay](https://github.com/DouDOU-start/airgate-epay) |
| **airgate-health** | extension | AI 提供商健康监控:主动探测、可用率/延迟聚合、对外公开状态页 | [DouDOU-start/airgate-health](https://github.com/DouDOU-start/airgate-health) |
| **gateway-openai** | gateway | OpenAI Responses / Chat Completions / ChatGPT OAuth / Anthropic 协议翻译 / WebSocket | [DevilGenius/airgate-openai](https://github.com/DevilGenius/airgate-openai) |
| **gateway-claude** | gateway | Claude Messages API 网关:OAuth 授权、TLS 指纹、用量监控 | [DevilGenius/airgate-claude](https://github.com/DevilGenius/airgate-claude) |
| **gateway-kiro** | gateway | Kiro (AWS CodeWhisperer) 反代网关,兼容 Anthropic Messages API | [DevilGenius/airgate-kiro](https://github.com/DevilGenius/airgate-kiro) |
| **airgate-playground** | extension | AI 对话插件:网页聊天、多模型切换、会话管理 | [DevilGenius/airgate-playground](https://github.com/DevilGenius/airgate-playground) |
| **airgate-studio** | extension | 面向图片、视频、音频等多模态内容生成的统一创作中心 | [DevilGenius/airgate-studio](https://github.com/DevilGenius/airgate-studio) |
| **payment-epay** | extension | 多渠道支付:易支付(虎皮椒/彩虹)/ 支付宝官方 / 微信支付官方,含充值页、订单管理、服务商配置 | [DevilGenius/airgate-epay](https://github.com/DevilGenius/airgate-epay) |
| **airgate-health** | extension | AI 提供商健康监控:主动探测、可用率/延迟聚合、对外公开状态页 | [DevilGenius/airgate-health](https://github.com/DevilGenius/airgate-health) |

### 安装插件

Expand All @@ -64,7 +64,7 @@ AirGate 不是又一个"集成了 N 个 AI 平台"的网关,而是一套**把

### 写一个自己的插件

只需依赖 [airgate-sdk](https://github.com/DouDOU-start/airgate-sdk),实现 `GatewayPlugin` 接口的几个方法即可:
只需依赖 [airgate-sdk](https://github.com/DevilGenius/airgate-sdk),实现 `GatewayPlugin` 接口的几个方法即可:

```go
type GatewayPlugin interface {
Expand All @@ -76,7 +76,7 @@ type GatewayPlugin interface {
}
```

参考 [airgate-openai](https://github.com/DouDOU-start/airgate-openai) 完整范例,含 Makefile、release workflow、前端嵌入。
参考 [airgate-openai](https://github.com/DevilGenius/airgate-openai) 完整范例,含 Makefile、release workflow、前端嵌入。

## 🛠 技术栈

Expand All @@ -102,7 +102,7 @@ type GatewayPlugin interface {
### 方式 1A:裸金属安装(systemd,自备 PostgreSQL + Redis)

```bash
curl -sSL https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/install.sh | sudo bash
curl -sSL https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/install.sh | sudo bash
```

[install.sh](deploy/install.sh) 会:
Expand Down Expand Up @@ -132,13 +132,13 @@ sudo systemctl enable airgate-core

```bash
# 升级到最新版本(保留配置和数据)
curl -sSL https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/install.sh | sudo bash -s -- upgrade
curl -sSL https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/install.sh | sudo bash -s -- upgrade

# 安装指定版本
curl -sSL https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/install.sh | sudo bash -s -- -v v0.1.0
curl -sSL https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/install.sh | sudo bash -s -- -v v0.1.0

# 卸载(默认保留 /etc/airgate-core 与 /var/lib/airgate-core)
curl -sSL https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/install.sh | sudo bash -s -- uninstall -y
curl -sSL https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/install.sh | sudo bash -s -- uninstall -y
```

**常用命令**:
Expand All @@ -153,7 +153,7 @@ sudo systemctl restart airgate-core # 重启

```bash
mkdir airgate && cd airgate
curl -sSL https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/docker-deploy.sh | bash
curl -sSL https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/docker-deploy.sh | bash

# 检查生成的文件后启动
docker compose up -d
Expand Down Expand Up @@ -289,12 +289,12 @@ sudo journalctl -u caddy -f # 看证书签发日志

**A. 全容器(推荐,宿主机零依赖)**

宿主机只需要 Docker。父目录同时克隆 [`airgate-sdk`](https://github.com/DouDOU-start/airgate-sdk) 与 [`airgate-core`](https://github.com/DouDOU-start/airgate-core):
宿主机只需要 Docker。父目录同时克隆 [`airgate-sdk`](https://github.com/DevilGenius/airgate-sdk) 与 [`airgate-core`](https://github.com/DevilGenius/airgate-core):

```bash
mkdir airgate && cd airgate
git clone https://github.com/DouDOU-start/airgate-sdk.git
git clone https://github.com/DouDOU-start/airgate-core.git
git clone https://github.com/DevilGenius/airgate-sdk.git
git clone https://github.com/DevilGenius/airgate-core.git

cd airgate-core
docker compose -f deploy/docker-compose.dev.yml up
Expand All @@ -304,11 +304,11 @@ docker compose -f deploy/docker-compose.dev.yml up

**B. 宿主机直跑**

需要 Go 1.25+、Node 22+、本地 Postgres + Redis,以及兄弟目录 [`airgate-sdk`](https://github.com/DouDOU-start/airgate-sdk):
需要 Go 1.25+、Node 22+、本地 Postgres + Redis,以及兄弟目录 [`airgate-sdk`](https://github.com/DevilGenius/airgate-sdk):

```bash
git clone https://github.com/DouDOU-start/airgate-sdk.git
git clone https://github.com/DouDOU-start/airgate-core.git
git clone https://github.com/DevilGenius/airgate-sdk.git
git clone https://github.com/DevilGenius/airgate-core.git
cd airgate-core

make install # 安装前后端依赖
Expand Down Expand Up @@ -411,7 +411,7 @@ airgate-core/
> docker run --rm -v <project>_redis_data:/from -v $(pwd)/data/redis:/to alpine cp -a /from/. /to/
> docker run --rm -v <project>_airgate_plugins:/from -v $(pwd)/data/plugins:/to alpine cp -a /from/. /to/
> docker run --rm -v <project>_airgate_uploads:/from -v $(pwd)/data/uploads:/to alpine cp -a /from/. /to/
> curl -O https://raw.githubusercontent.com/DouDOU-start/airgate-core/master/deploy/docker-compose.yml
> curl -O https://raw.githubusercontent.com/DevilGenius/airgate-core/master/deploy/docker-compose.yml
> docker compose up -d
> # 验证一切正常后再删除旧的命名 volume
> docker volume rm <project>_postgres_data <project>_redis_data <project>_airgate_plugins <project>_airgate_uploads
Expand All @@ -420,9 +420,9 @@ airgate-core/

## 🤝 贡献 / 反馈

- Bug / Feature: [Issues](https://github.com/DouDOU-start/airgate-core/issues)
- 插件开发文档: [airgate-sdk](https://github.com/DouDOU-start/airgate-sdk)
- 参考插件实现: [airgate-openai](https://github.com/DouDOU-start/airgate-openai)
- Bug / Feature: [Issues](https://github.com/DevilGenius/airgate-core/issues)
- 插件开发文档: [airgate-sdk](https://github.com/DevilGenius/airgate-sdk)
- 参考插件实现: [airgate-openai](https://github.com/DevilGenius/airgate-openai)

## 📜 License

Expand Down
Loading
Loading