Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
040c01f
Add differences between current implementation and Newapi
CassiopeiaCode Dec 24, 2025
8df487e
feat: align with upstream differences (health, debug cache, ranks, re…
Dec 25, 2025
05be075
fix(web): replace Drawer with SideSheet for RecentCalls
Dec 25, 2025
9d1aab0
ci: publish Docker images to GHCR
Dec 25, 2025
e171af2
fix(go): remove unused fmt import
Dec 25, 2025
8d54cbc
fix(go): restore build (controller utils + error types)
Dec 25, 2025
0911c18
NO7: 强制在请求日志记录客户端IP (client_ip)
Dec 25, 2025
b8dd797
fix: rpm exempt user ids save/refresh
Dec 25, 2025
cbe769f
fix: guard model health hourly data
Dec 25, 2025
c4f58e6
fix: normalize /api/models response shape
Dec 25, 2025
e2ebf0f
relay: improve stream handling across providers
Dec 25, 2025
e2470ce
fix: /api/models returns array for dashboard
Dec 25, 2025
38a975f
fix: linuxdo oauth multi-site state
Dec 25, 2025
327c95f
force: always record client IP in consume/error logs
Dec 25, 2025
75a1941
feat: public model health page + admin-only console query
Dec 25, 2025
d4c91a8
Per-channel role mappings
Dec 25, 2025
cc8691f
fix: random redemption code generation
Dec 25, 2025
f533efd
Fix model health hourly hour_start_ts integer division
Dec 25, 2025
d3cb882
fix: use enabled models for hourly model health
Dec 25, 2025
0a83308
fix(channel settings): accept model_role_mappings string/object; add …
Dec 25, 2025
715a519
feat: 模型健康度页面增加总成功次数列,按总成功次数降序排序,无数据小时用平均值填充
Dec 25, 2025
2eb3c8b
fix: Form.Select 受控模式下默认值不显示问题
Dec 25, 2025
f12e987
feat: 模型健康度页面小时列按时间倒序排列,最近的在左边
Dec 25, 2025
1cc6c4a
v0.1.24
Dec 25, 2025
e6b4fdf
feat: 实现公共模型健康度缓存 (Redis + 内存 fallback)
Dec 25, 2025
daca892
美化模型健康度页面
Dec 25, 2025
3004a35
fix: 添加用户小时调用排行等模块到侧边栏配置
Dec 25, 2025
c0bea79
ci: remove arm64 build to speed up docker image build
Dec 25, 2025
1483a4d
merge: sync upstream/main
Dec 25, 2025
ed3fd6d
chore: bump version to v0.1.29
Dec 25, 2025
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
151 changes: 0 additions & 151 deletions .github/workflows/docker-image-alpha.yml

This file was deleted.

138 changes: 0 additions & 138 deletions .github/workflows/docker-image-arm64.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/ghcr-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish Docker image to GHCR

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Detect semver tag
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "IS_SEMVER=true" >> "$GITHUB_ENV"
else
echo "IS_SEMVER=false" >> "$GITHUB_ENV"
fi

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ env.IS_SEMVER == 'true' }}

- name: Build and push (amd64 only)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# ============================================
# 以下是原来的 QEMU 多架构构建配置(已注释)
# 如需恢复 arm64 支持,取消注释 platforms 行
# ============================================
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# platforms: linux/amd64,linux/arm64
10 changes: 10 additions & 0 deletions Difference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 和Newapi上游的区别

1. 实现维护模型健康度(健康度是一个时间的比值,每5分钟一个单位,如果该单位内只有失败的请求,那么记为失败时间片,如果有一个或多个成功请求并且(返回的byte长度大于1k或完成token大于2或实际响应模型回复大于2char),记为成功时间片,可查看不同小时时间段的模型成功率),实现后端和对应前端,,设计数据结构和新表实现良好性能。实现对非管理员隐藏可自定义模型和时间的查询(在控制台),并实现在导航栏添加新的页面(新页面所有用户即使非登录也可查看),显示所有模型最近24小时每小时的健康度。
2. 若Newapi无法实现在对所有用户限速的情况下,使用标签解除对应的限速(而不是其他限速),那么添加管理员豁免用户限速RPM【已实现】
3. 实现缓存最近100次API调用的请求和返回信息到内存里(包括报错,记录客户端原始请求和上游原始响应(包括上游原始流式响应)),提供UI查阅,实现后端和对应前端,设计数据结构和新表实现良好性能【已实现】
4. 实现按可选定的小时统计用户的总调用次数(可分别显示成功次数或报错次数)并降序显示,实现后端和对应前端,设计数据结构和新表实现良好性能
5. 实现生成随机兑换码(输入最小值和最大值,以及其他普通兑换码具有的字段,并且支持设置生成的兑换码前缀,生成随机的兑换码并提供文件下载),实现后端和对应前端
6. 实现模型自定义配置没有将特定role转换为另一种role的功能的话实现它。不是全局模型映射,而是每个渠道一个配置,加入渠道额外设置
7. 实现强制在日志记录IP,即使用户关闭IP记录【已实现】
8. web\public\oauth-redirect.html 多站点重定向登录【已实现】
11 changes: 11 additions & 0 deletions PROJECT_CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PROJECT_CONTEXT

本文档用于快速理解仓库的“特点与环境信息(开发/构建/CI)”,便于后续维护与交接。

## 约定

- 约定:`tag++` 的默认含义
- 先提交所有工作区
- 执行 `git tag --sort=-creatordate | head -n 10` 拉取最近 10 个 tag
- 从中解析出“最新的可自增 tag”(优先 semver,例如 `vX.Y.Z`),将其 `+1`(默认补丁号 `Z+1`)
- 创建并推送新的 tag 到仓库(用于触发发布流水线)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.1.29
4 changes: 4 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ var EmailLoginAuthServerList = []string{
var DebugEnabled bool
var MemoryCacheEnabled bool

// HourlyCallRankCountFailedEnabled 控制“用户小时调用排行”是否把失败请求计入 total_calls。
// 需求口径是“总调用次数”,默认应计入失败(只要发生调用就算)。
var HourlyCallRankCountFailedEnabled = true

var LogConsumeEnabled = true

var SMTPServer = ""
Expand Down
Loading