feat: add app One-Hub

This commit is contained in:
arch3rPro
2025-07-27 20:20:38 +08:00
parent 2cf8dc4568
commit 43852ae871
10 changed files with 312 additions and 3 deletions

View File

@@ -439,7 +439,7 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
<table>
<tr>
<td width="100%" align="center">
<td width="33%" align="center">
<a href="./apps/new-api/README.md">
<img src="./apps/new-api/logo.png" width="60" height="60" alt="New-API">
@@ -451,10 +451,19 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
<kbd>0.8.7.5</kbd> • [官网链接](https://docs.newapi.pro/)
</td>
<td width="100%" align="center">
<td width="33%" align="center">
<a href="./apps/one-hub/README.md">
<img src="./apps/one-hub/logo.png" width="60" height="60" alt="One-Hub">
<br><b>One-Hub</b>
</a>
🔗 统一的AI模型管理和调用平台支持多种大语言模型集成
<kbd>0.14.22</kbd> • [官网链接](https://github.com/one-hub/one-hub)
</td>
<td width="100%" align="center">
<td width="33%" align="center">
</td>
</tr>

View File

@@ -0,0 +1,37 @@
additionalProperties:
formFields:
- default: newapi
edit: true
envKey: PANEL_DB_NAME
labelEn: Database
labelZh: 数据库名
random: true
required: true
rule: paramCommon
type: text
- default: newapi
edit: true
envKey: PANEL_DB_ROOT_PASSWORD
labelEn: Password
labelZh: 数据库密码
random: true
required: true
rule: paramComplexity
type: password
- default: 9khGG1O59Ih4ZWrpsiFKTf8bW7ZqJR01
edit: true
envKey: USER_TOKEN_SECRET
labelEn: Password
labelZh: 用户Token
random: true
required: true
rule: paramComplexity
type: password
- default: 3000
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number

View File

@@ -0,0 +1,60 @@
services:
one-hub:
image: martialbe/one-api:v0.14.22
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:3000
networks:
- 1panel-network
command: --log-dir /app/logs
volumes:
- ./data:/data
- ./logs:/app/logs
environment:
- SQL_DSN=root:${PANEL_DB_ROOT_PASSWORD}@tcp(${CONTAINER_NAME}-mysql:3306)/${PANEL_DB_NAME} # 修改此行,或注释掉以使用 SQLite 作为数据库
- TZ=Asia/Shanghai
- REDIS_CONN_STRING=redis://${CONTAINER_NAME}-redis
- USER_TOKEN_SECRET=${USER_TOKEN_SECRET}
- ERROR_LOG_ENABLED=true # 是否启用错误日志记录
# - STREAMING_TIMEOUT=120 # 流模式无响应超时时间单位秒默认120秒如果出现空补全可以尝试改为更大值
# - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!!!!!!!
# - NODE_TYPE=slave # Uncomment for slave node in multi-node deployment
# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed
# - FRONTEND_BASE_URL=https://openai.justsong.cn # Uncomment for multi-node deployment with front-end URL
depends_on:
- redis
- mysql
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk -F: '{print $$2}'"]
interval: 30s
timeout: 10s
retries: 3
labels:
createdBy: "Apps"
mysql:
image: mysql:8.2
container_name: ${CONTAINER_NAME}-mysql
restart: always
volumes:
- onehub-mysql_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${PANEL_DB_ROOT_PASSWORD} # MySQL root用户密码
- MYSQL_DATABASE=${PANEL_DB_NAME} # 创建的数据库名
networks:
- 1panel-network
redis:
image: redis:latest
container_name: ${CONTAINER_NAME}-redis
restart: always
networks:
- 1panel-network
volumes:
onehub-mysql_data:
networks:
1panel-network:
external: true

View File

@@ -0,0 +1,26 @@
additionalProperties:
formFields:
- default: 3000
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: Asia/Shanghai
edit: true
envKey: TZ
labelEn: Time Zone
labelZh: 时区
required: true
type: text
- default: 9khGG1O59Ih4ZWrpsiFKTf8bW7ZqJR01
edit: true
envKey: USER_TOKEN_SECRET
labelEn: Password
labelZh: 用户Token
random: true
required: true
rule: paramComplexity
type: password

View File

@@ -0,0 +1,26 @@
services:
one-hub:
image: martialbe/one-api:v0.14.22
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:3000
networks:
- 1panel-network
command: --log-dir /app/logs
volumes:
- ./data:/data
- ./logs:/app/logs
environment:
- TZ=${TZ}
- USER_TOKEN_SECRET=${USER_TOKEN_SECRET}
# - SESSION_SECRET=${SESSION_SECRET}
# - REDIS_CONN_STRING=redis://redis
# - NODE_TYPE=slave # 多机部署时从节点取消注释该行
# - SYNC_FREQUENCY=60 # 需要定期从数据库加载数据时取消注释该行
# - FRONTEND_BASE_URL=https://openai.justsong.cn # 多机部署时从节点取消注释该行
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

80
apps/one-hub/README.md Normal file
View File

@@ -0,0 +1,80 @@
# One Hub
OpenAI 接口管理 & 分发系统改自songquanpeng/one-api。支持更多模型加入统计页面完善非openai模型的函数调用。
![](https://cdn.jsdelivr.net/gh/xiaoY233/PicList@main/public/assets/One-Hub.png)
![](https://img.shields.io/badge/Copyright-arch3rPro-ff9800?style=flat&logo=github&logoColor=white)
> 管理员默认账号密码为 root:123456,请登录后及时修改
**请不要和原版混用,因为新增功能,数据库与原版不兼容**
**为了更加简洁,本项目之后,除了新增供应商时会更新程序自带的模型列表,平常不再更新程序自带的模型列表。**
**如果发现缺少新模型,请在`后台-模型价格-更新价格`中更新新增的模型**
> [!WARNING]
> 本项目为个人学习使用,不保证稳定性,且不提供任何技术支持,使用者必须在遵循 OpenAI 的使用条款以及法律法规的情况下使用,不得用于非法用途。
> 根据[《生成式人工智能服务管理暂行办法》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm)的要求,请勿对中国地区公众提供一切未经备案的生成式人工智能服务。
## 功能变化
- 全新的 UI 界面
- 新增用户仪表盘
- 新增管理员分析数据统计界面
- 重构了中转`供应商`模块
- 支持使用`Azure Speech`模拟`TTS`功能
- 渠道可配置单独的 http/socks5 代理
- 支持动态返回用户模型列表
- 支持自定义测速模型
- 日志增加请求耗时
- 支持和优化非 OpenAI 模型的函数调用(支持的模型可以在 lobe-chat 直接使用)
- 支持完成倍率自定义
- 支持完整的分页和排序
- 支持`Telegram bot`
- 支持模型按次收费
- 支持模型通配符
- 支持使用配置文件启动程序
- 支持模型价格更新
- 支持自动获取供应商模型
- 支持仅聊天,开启后如果有传入`function call`参数会跳过该渠道
- 支持支付
- 支持配置用户组 RPM
- 支持`Prometheus`监控
## 文档
请查看[文档](https://github.com/MartialBE/one-hub/wiki)
## 当前支持的供应商
| 供应商 | Chat | Embeddings | Audio | Images | 其他 |
| --------------------------------------------------------------------- | ------------------------ | ---------- | ------ | ----------- | ---------------------------------------------------------------- |
| [OpenAI](https://platform.openai.com/docs/api-reference/introduction) | ✅ | ✅ | ✅ | ✅ | - |
| [Azure OpenAI](https://oai.azure.com/) | ✅ | ✅ | ✅ | ✅ | - |
| [Azure Speech](https://portal.azure.com/) | - | - | ⚠️ tts | - | - |
| [Anthropic](https://www.anthropic.com/) | ✅ | - | - | - | - |
| [Gemini](https://aistudio.google.com/) | ✅ | - | - | - | - |
| [百度文心](https://console.bce.baidu.com/qianfan/overview) | ✅ | ✅ | - | - | - |
| [通义千问](https://dashscope.console.aliyun.com/overview) | ✅ | ✅ | - | - | - |
| [讯飞星火](https://console.xfyun.cn/) | ✅ | - | - | - | - |
| [智谱](https://open.bigmodel.cn/overview) | ✅ | ✅ | - | ⚠️ 图片生成 | - |
| [腾讯混元](https://cloud.tencent.com/product/hunyuan) | ✅ | - | - | - | - |
| [百川](https://platform.baichuan-ai.com/console/apikey) | ✅ | ✅ | - | - | - |
| [MiniMax](https://www.minimaxi.com/user-center/basic-information) | ✅ | ✅ | - | - | - |
| [Deepseek](https://platform.deepseek.com/usage) | ✅ | - | - | - | - |
| [Moonshot](https://moonshot.ai/) | ✅ | - | - | - | - |
| [Mistral](https://mistral.ai/) | ✅ | ✅ | - | - | - |
| [Groq](https://console.groq.com/keys) | ✅ | - | - | - | - |
| [Amazon Bedrock](https://console.aws.amazon.com/bedrock/home) | ⚠️ 仅支持 Anthropic 模型 | - | - | - | - |
| [零一万物](https://platform.lingyiwanwu.com/details) | ✅ | - | - | - | - |
| [Cloudflare AI](https://ai.cloudflare.com/) | ✅ | - | ⚠️ stt | ⚠️ 图片生成 | - |
| [Midjourney](https://www.midjourney.com/) | - | - | - | - | [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) |
| [Cohere](https://cohere.com/) | ✅ | - | - | - | - |
| [Stability AI](https://platform.stability.ai/account/credits) | - | - | - | ⚠️ 图片生成 | - |
| [Coze](https://www.coze.com/open/docs/chat?_lang=zh) | ✅ | - | - | - | - |
| [Ollama](https://github.com/ollama/ollama) | ✅ | ✅ | - | - | - |
| [Suno](https://suno.com/) | - | - | - | - | [Suno-API](https://github.com/Suno-API/Suno-API) |

19
apps/one-hub/data.yml Normal file
View File

@@ -0,0 +1,19 @@
name: One-Hub
tags:
- AI / 大模型
title: OpenAI 接口管理 & 分发系统
description: OpenAI 接口管理 & 分发系统
additionalProperties:
key: one-hub
name: One-Hub
tags:
- AI
shortDescZh: AI模型接口管理与分发系统OpenAI 接口管理 & 分发系统改自songquanpeng/one-api。支持更多模型加入统计页面完善非openai模型的函数调用。
shortDescEn: Access all LLM through the standard OpenAI API format, easy to deploy & use
type: website
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://one-hub.xiao5.info/
github: https://github.com/MartialBE/one-hub
document: https://github.com/MartialBE/one-hub/blob/main/README.md

View File

@@ -0,0 +1,26 @@
additionalProperties:
formFields:
- default: 3000
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: Asia/Shanghai
edit: true
envKey: TZ
labelEn: Time Zone
labelZh: 时区
required: true
type: text
- default: 9khGG1O59Ih4ZWrpsiFKTf8bW7ZqJR01
edit: true
envKey: USER_TOKEN_SECRET
labelEn: Password
labelZh: 用户Token
random: true
required: true
rule: paramComplexity
type: password

View File

@@ -0,0 +1,26 @@
services:
one-hub:
image: martialbe/one-api:latest
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:3000
networks:
- 1panel-network
command: --log-dir /app/logs
volumes:
- ./data:/data
- ./logs:/app/logs
environment:
- TZ=${TZ}
- USER_TOKEN_SECRET=${USER_TOKEN_SECRET}
# - SESSION_SECRET=${SESSION_SECRET}
# - REDIS_CONN_STRING=redis://redis
# - NODE_TYPE=slave # 多机部署时从节点取消注释该行
# - SYNC_FREQUENCY=60 # 需要定期从数据库加载数据时取消注释该行
# - FRONTEND_BASE_URL=https://openai.justsong.cn # 多机部署时从节点取消注释该行
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

BIN
apps/one-hub/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB