feat: add app GPT-Load

This commit is contained in:
arch3rPro
2025-08-26 15:24:38 +00:00
parent 3cb2a42921
commit 9cb8f5bb02
12 changed files with 352 additions and 14 deletions

5
.gitignore vendored
View File

@@ -15,4 +15,7 @@
.cursor
# CodeBuddy
.codebuddy
.codebuddy
# Qoder
.qoder

View File

@@ -523,14 +523,14 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
</td>
<td width="33%" align="center">
<a href="./apps/flowise/README.md">
<img src="./apps/flowise/logo.png" width="60" height="60" alt="Flowise">
<br><b>Flowise</b>
<a href="./apps/gpt-load/README.md">
<img src="./apps/gpt-load/logo.png" width="60" height="60" alt="GPT-Load">
<br><b>GPT-Load</b>
</a>
🔮 开源可视化AI工作流构建平台拖拽式设计LLM应用
🚀 智能密钥轮询的多渠道AI代理高性能企业级AI接口透明代理服务
<kbd>3.0.5s</kbd> • [官网链接](https://github.com/FlowiseAI/Flowise)
<kbd>1.0.22.1</kbd> • [官网链接](https://github.com/tbphp/gpt-load)
</td>
</tr>
@@ -540,6 +540,18 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
<tr>
<td width="33%" align="center">
<a href="./apps/flowise/README.md">
<img src="./apps/flowise/logo.png" width="60" height="60" alt="Flowise">
<br><b>Flowise</b>
</a>
🔮 开源可视化AI工作流构建平台拖拽式设计LLM应用
<kbd>3.0.5</kbd> • [官网链接](https://github.com/FlowiseAI/Flowise)
</td>
<td width="33%" align="center">
<a href="./apps/inspector/README.md">
<img src="./apps/inspector/logo.png" width="60" height="60" alt="MCP Inspector">
<br><b>MCP Inspector</b>
@@ -562,6 +574,11 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
<kbd>2.4.10</kbd> • [官网链接](https://github.com/metatool-ai/metamcp)
</td>
</tr>
</table>
<table>
<tr>
<td width="33%" align="center">
<a href="./apps/higress/README.md">
@@ -574,11 +591,6 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
<kbd>latest</kbd> • [官网链接](https://github.com/alibaba/higress)
</td>
</tr>
</table>
<table>
<tr>
<td width="33%" align="center">
<a href="./apps/searxng/README.md">
@@ -593,9 +605,6 @@ AI驱动的开源代码知识库与文档协作平台支持多模型、多数
</td>
<td width="33%" align="center">
</td>
<td width="33%" align="center">
</td>
</tr>
</table>

View File

@@ -0,0 +1,43 @@
# 服务器配置
PORT=3001
HOST=0.0.0.0
# 服务器读取、写入和空闲连接的超时时间(秒)
SERVER_READ_TIMEOUT=60
SERVER_WRITE_TIMEOUT=600
SERVER_IDLE_TIMEOUT=120
SERVER_GRACEFUL_SHUTDOWN_TIMEOUT=10
# 从节点标识
IS_SLAVE=false
# 时区
TZ=Asia/Shanghai
# 认证配置 是必需的,用于保护管理 API 和 UI 界面
AUTH_KEY=sk-123456
# 数据库配置 默认不填写,使用./data/gpt-load.db的SQLite
# MySQL 示例:
# DATABASE_DSN=root:123456@tcp(mysql:3306)/gpt-load?charset=utf8mb4&parseTime=True&loc=Local
# PostgreSQL 示例:
# DATABASE_DSN=postgres://postgres:123456@postgres:5432/gpt-load?sslmode=disable
# Redis配置 默认不填写,使用内存存储
# REDIS_DSN=redis://redis:6379/0
# 并发数量
MAX_CONCURRENT_REQUESTS=100
# CORS配置
ENABLE_CORS=true
ALLOWED_ORIGINS=*
ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
ALLOWED_HEADERS=*
ALLOW_CREDENTIALS=false
# 日志配置
LOG_LEVEL=info
LOG_FORMAT=text
LOG_ENABLE_FILE=true
LOG_FILE_PATH=./data/logs/app.log

View File

@@ -0,0 +1,19 @@
additionalProperties:
formFields:
- default: 3001
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: "gpt-load-sk"
edit: true
envKey: AUTH_KEY
labelEn: API Authentication Key
labelZh: API认证密钥
random: true
required: true
rule: paramComplexity
type: password

View File

@@ -0,0 +1,18 @@
services:
gpt-load:
image: ghcr.io/tbphp/gpt-load:v1.0.22.1
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:3001
networks:
- 1panel-network
volumes:
- ./data:/app/data
environment:
- AUTH_KEY=${AUTH_KEY}
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

32
apps/gpt-load/README.md Normal file
View File

@@ -0,0 +1,32 @@
# GPT-Load
一个高性能、企业级的 AI 接口透明代理服务,专门为需要集成多种 AI 服务的企业和开发者设计。采用 Go 语言开发,具备智能密钥管理、负载均衡和完善的监控功能,专为高并发生产环境而设计。
![](https://cdn.jsdelivr.net/gh/xiaoY233/PicList@main/public/assets/GPT-Load.png)
![](https://img.shields.io/badge/Copyright-arch3rPro-ff9800?style=flat&logo=github&logoColor=white)
详细请查看[官方文档](https://www.gpt-load.com/docs)
## 功能特性
- **透明代理**: 完全保留原生 API 格式,支持 OpenAI、Google Gemini 和 Anthropic Claude 等多种格式
- **智能密钥管理**: 高性能密钥池,支持分组管理、自动轮换和故障恢复
- **负载均衡**: 支持多上游端点的加权负载均衡,提升服务可用性
- **智能故障处理**: 自动密钥黑名单管理和恢复机制,确保服务连续性
- **动态配置**: 系统设置和分组配置支持热重载,无需重启即可生效
- **企业级架构**: 分布式主从部署,支持水平扩展和高可用
- **现代化管理**: 基于 Vue 3 的 Web 管理界面,直观易用
- **全面监控**: 实时统计、健康检查、详细请求日志
- **高性能设计**: 零拷贝流式传输、连接池复用、原子操作
- **生产就绪**: 优雅关闭、错误恢复、完善的安全机制
- **双重认证体系**: 管理端与代理端认证分离,代理认证支持全局和分组级别密钥
## 支持的 AI 服务
GPT-Load 作为透明代理服务,完整保留各 AI 服务商的原生 API 格式:
- **OpenAI 格式**: 官方 OpenAI API、Azure OpenAI、以及其他 OpenAI 兼容服务
- **Google Gemini 格式**: Gemini Pro、Gemini Pro Vision 等模型的原生 API
- **Anthropic Claude 格式**: Claude 系列模型,支持高质量的对话和文本生成

107
apps/gpt-load/README_en.md Normal file
View File

@@ -0,0 +1,107 @@
# GPT-Load
A high-performance, enterprise-grade AI API transparent proxy service designed specifically for enterprises and developers who need to integrate multiple AI services. Built with Go, featuring intelligent key management, load balancing, and comprehensive monitoring capabilities, designed for high-concurrency production environments.
![](https://cdn.jsdelivr.net/gh/xiaoY233/PicList@main/public/assets/GPT-Load.png)
![](https://img.shields.io/badge/Copyright-arch3rPro-ff9800?style=flat&logo=github&logoColor=white)
For detailed information, please check the [Official Documentation](https://www.gpt-load.com/docs)
## Features
- **Transparent Proxy**: Fully preserves native API formats, supporting OpenAI, Google Gemini, Anthropic Claude, and other formats
- **Intelligent Key Management**: High-performance key pool with group management, automatic rotation, and fault recovery
- **Load Balancing**: Supports weighted load balancing across multiple upstream endpoints to improve service availability
- **Smart Fault Handling**: Automatic key blacklist management and recovery mechanism to ensure service continuity
- **Dynamic Configuration**: System settings and group configurations support hot reload, taking effect without restart
- **Enterprise Architecture**: Distributed master-slave deployment with horizontal scaling and high availability support
- **Modern Management**: Vue 3-based web management interface, intuitive and user-friendly
- **Comprehensive Monitoring**: Real-time statistics, health checks, detailed request logging
- **High-Performance Design**: Zero-copy streaming, connection pool reuse, atomic operations
- **Production Ready**: Graceful shutdown, error recovery, comprehensive security mechanisms
- **Dual Authentication System**: Separation of management and proxy authentication, proxy authentication supports global and group-level keys
## Supported AI Services
GPT-Load serves as a transparent proxy service, fully preserving the native API formats of various AI service providers:
- **OpenAI Format**: Official OpenAI API, Azure OpenAI, and other OpenAI-compatible services
- **Google Gemini Format**: Native API for Gemini Pro, Gemini Pro Vision, and other models
- **Anthropic Claude Format**: Claude series models, supporting high-quality conversation and text generation
## Quick Start
### Default Configuration
After deployment, access the service through your web browser to begin setup. For first-time use, it's recommended to:
1. Configure API keys for different AI service providers
2. Set up load balancing and failover policies
3. Configure monitoring and logging preferences
4. Test the proxy endpoints with your applications
### API Integration
GPT-Load maintains full compatibility with original AI service APIs, allowing seamless integration:
- Use your existing OpenAI SDK/libraries
- Simply change the base URL to your GPT-Load instance
- All request/response formats remain unchanged
- Authentication handled transparently
## Core Capabilities
### Intelligent Key Management
- **Key Pool**: Centralized management of API keys across multiple providers
- **Auto Rotation**: Intelligent key switching based on usage quotas and rate limits
- **Fault Recovery**: Automatic detection and recovery of failed keys
- **Group Management**: Organize keys by project, team, or usage patterns
### Load Balancing & High Availability
- **Multi-Upstream Support**: Distribute requests across multiple AI service endpoints
- **Weighted Routing**: Configure traffic distribution based on endpoint capacity
- **Health Monitoring**: Continuous endpoint health checks and automatic failover
- **Circuit Breaker**: Prevent cascade failures with intelligent request routing
### Monitoring & Analytics
- **Real-time Metrics**: Request rates, response times, error rates, and usage statistics
- **Detailed Logging**: Comprehensive request/response logging for debugging and audit
- **Health Dashboard**: Visual monitoring of system status and performance metrics
- **Alert System**: Configurable alerts for system anomalies and threshold breaches
### Security & Compliance
- **Authentication**: Dual-level authentication for management and API access
- **Rate Limiting**: Configurable rate limits per key, user, or endpoint
- **Access Control**: Fine-grained permissions and access policies
- **Data Privacy**: No request content logging, ensuring data privacy compliance
## Architecture
### Distributed Deployment
- **Master-Slave Architecture**: Scalable deployment with automatic failover
- **Horizontal Scaling**: Add instances dynamically based on load requirements
- **State Synchronization**: Consistent configuration and state across instances
- **Zero-Downtime Updates**: Rolling updates without service interruption
### Performance Optimization
- **Connection Pooling**: Efficient connection reuse for upstream services
- **Streaming Support**: Zero-copy streaming for large responses
- **Caching**: Intelligent response caching where appropriate
- **Async Processing**: Non-blocking request handling for maximum throughput
## Related Links
- **Official Website**: [https://www.gpt-load.com](https://www.gpt-load.com)
- **GitHub Repository**: [https://github.com/tbphp/gpt-load](https://github.com/tbphp/gpt-load)
- **Official Documentation**: [https://www.gpt-load.com/docs](https://www.gpt-load.com/docs)
- **API Reference**: [https://www.gpt-load.com/docs/api](https://www.gpt-load.com/docs/api)
---
For detailed configuration and usage instructions, please refer to [GPT-Load Official Documentation](https://www.gpt-load.com/docs).

27
apps/gpt-load/data.yml Normal file
View File

@@ -0,0 +1,27 @@
name: GPT-Load
tags:
- AI / 大模型
title: 智能密钥轮询的多渠道 AI 代理
description: GPT-Load 是一个高性能、企业级的 AI 接口透明代理服务,专门为需要集成多种 AI 服务的企业和开发者设计。采用 Go 语言开发,具备智能密钥管理、负载均衡和完善的监控功能。
additionalProperties:
key: gpt-load
name: GPT-Load
tags:
- AI
shortDescZh: 智能密钥轮询的多渠道 AI 代理
shortDescEn: Intelligent key rotation multi-channel AI proxy
description:
en: A high-performance, enterprise-grade AI API transparent proxy service designed specifically for enterprises and developers who need to integrate multiple AI services. Built with Go, featuring intelligent key management, load balancing, and comprehensive monitoring capabilities.
zh: 一个高性能、企业级的 AI 接口透明代理服务,专门为需要集成多种 AI 服务的企业和开发者设计。采用 Go 语言开发,具备智能密钥管理、负载均衡和完善的监控功能。
zh-Hant: 一個高性能、企業級的 AI 接口透明代理服務,專門為需要集成多種 AI 服務的企業和開發者設計。採用 Go 語言開發,具備智能密鑰管理、負載均衡和完善的監控功能。
type: website
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://www.gpt-load.com
github: https://github.com/tbphp/gpt-load
document: https://www.gpt-load.com/docs
memoryRequired: 1024
architectures:
- amd64
- arm64

View File

@@ -0,0 +1,43 @@
# 服务器配置
PORT=3001
HOST=0.0.0.0
# 服务器读取、写入和空闲连接的超时时间(秒)
SERVER_READ_TIMEOUT=60
SERVER_WRITE_TIMEOUT=600
SERVER_IDLE_TIMEOUT=120
SERVER_GRACEFUL_SHUTDOWN_TIMEOUT=10
# 从节点标识
IS_SLAVE=false
# 时区
TZ=Asia/Shanghai
# 认证配置 是必需的,用于保护管理 API 和 UI 界面
AUTH_KEY=sk-123456
# 数据库配置 默认不填写,使用./data/gpt-load.db的SQLite
# MySQL 示例:
# DATABASE_DSN=root:123456@tcp(mysql:3306)/gpt-load?charset=utf8mb4&parseTime=True&loc=Local
# PostgreSQL 示例:
# DATABASE_DSN=postgres://postgres:123456@postgres:5432/gpt-load?sslmode=disable
# Redis配置 默认不填写,使用内存存储
# REDIS_DSN=redis://redis:6379/0
# 并发数量
MAX_CONCURRENT_REQUESTS=100
# CORS配置
ENABLE_CORS=true
ALLOWED_ORIGINS=*
ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
ALLOWED_HEADERS=*
ALLOW_CREDENTIALS=false
# 日志配置
LOG_LEVEL=info
LOG_FORMAT=text
LOG_ENABLE_FILE=true
LOG_FILE_PATH=./data/logs/app.log

View File

@@ -0,0 +1,19 @@
additionalProperties:
formFields:
- default: 3001
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: "gpt-load-sk"
edit: true
envKey: AUTH_KEY
labelEn: API Authentication Key
labelZh: API认证密钥
random: true
required: true
rule: paramComplexity
type: password

View File

@@ -0,0 +1,18 @@
services:
gpt-load:
image: ghcr.io/tbphp/gpt-load:latest
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:3001
networks:
- 1panel-network
volumes:
- ./data:/app/data
environment:
- AUTH_KEY=${AUTH_KEY}
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

BIN
apps/gpt-load/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB