# llm-platform **Repository Path**: qmsh/llm-platform ## Basic Information - **Project Name**: llm-platform - **Description**: 当前比较火的大模型流量出口开源项目,支持低价购买千问、DeepSeek,智谱、ChatGPT等模型,再用另外的价格卖给其他个人,实施流量差价计费。 适合采购国内便宜大模型流量,再美元卖给国外客户,支持中英日三国语言。 JDK8+SpringBoot+MyBatisPlus,支持SSE流量输出,支持OpenClaw,ClaudeCode的代理转发 - **Primary Language**: Java - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 2 - **Created**: 2026-04-28 - **Last Updated**: 2026-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LLM API Platform 一个仿照 SiliconFlow (https://www.siliconflow.com/) 实现的大模型API售卖平台。 ## 技术栈 ### 后端 - JDK 8 - SpringBoot 2.7.18 - MyBatisPlus 3.5.5 - MySQL 5.7 - Redis - Swagger / Knife4j - JWT - 支付宝/微信支付SDK ### 前端 - Vue 3 (Composition API) - Vite - Element Plus - Vue Router - Pinia - Vue I18n - ECharts ## 功能特性 ### 用户端 - 用户注册/登录 (JWT认证) - 模型浏览和筛选 - API密钥管理 - 使用量统计 - 账单和订单管理 - 余额充值 (支付宝/微信) - 多语言支持 (中文/英文/日文) - 日夜主题切换 ### 管理端 - 仪表盘统计 - 用户管理 - 订单管理 - 模型管理 - 财务管理 ### API代理 - OpenAI兼容API (`/v1/chat/completions`) - 实时Token计数 - 按量计费 - 余额检查 - 使用量记录 ## 快速开始 ### 后端启动 1. 配置MySQL数据库 ```bash mysql -u root -p < llm-api-platform/src/main/resources/sql/init.sql ``` 2. 修改配置文件 `application.yml` ```yaml spring: datasource: url: jdbc:mysql://localhost:3306/llm_platform username: root password: your_password redis: host: localhost port: 6379 ``` 3. 启动后端服务 ```bash cd llm-api-platform mvn spring-boot:run ``` 4. 访问Swagger文档 ``` http://localhost:8080/api/doc.html ``` ### 前端启动 1. 安装依赖 ```bash cd llm-platform-frontend npm install ``` 2. 启动开发服务器 ```bash npm run dev ``` 3. 访问前端页面 ``` http://localhost:3000 ``` ## 项目结构 ### 后端结构 ``` llm-api-platform/ ├── src/main/java/com/llm/platform/ │ ├── common/ # 通用模块 │ │ ├── result/ # 统一响应结果 Result │ │ └── exception/ # 全局异常处理 │ ├── config/ # 配置类 │ ├── modules/ # 业务模块 │ │ ├── user/ # 用户模块 │ │ ├── model/ # 模型模块 │ │ ├── billing/ # 账单模块 │ │ ├── usage/ # 使用量模块 │ │ └── proxy/ # API代理模块 │ ├── security/ # 安全模块 │ ├── utils/ # 工具类 │ └── LlmPlatformApplication.java ``` ### 前端结构 ``` llm-platform-frontend/ ├── src/ │ ├── api/ # API请求封装 │ ├── assets/ # 静态资源 │ ├── components/ # 公共组件 │ ├── layouts/ # 布局组件 │ ├── locales/ # 多语言 │ ├── router/ # 路由配置 │ ├── store/ # 状态管理 │ ├── styles/ # 样式文件 │ ├── views/ # 页面组件 │ │ ├── user/ # 用户端页面 │ │ └── admin/ # 管理端页面 │ ├── App.vue │ └── main.js ``` ## API文档 ### 认证相关 - POST `/api/user/login` - 用户登录 - POST `/api/user/register` - 用户注册 - GET `/api/user/info` - 获取用户信息 ### 模型相关 - GET `/api/model/list` - 获取模型列表 - GET `/api/model/{modelId}` - 获取模型详情 - GET `/api/model/hot` - 获取热门模型 ### API密钥相关 - POST `/api/apikey/create` - 创建API密钥 - GET `/api/apikey/list` - 获取API密钥列表 - DELETE `/api/apikey/{keyId}` - 删除API密钥 ### API代理 (OpenAI兼容) - POST `/v1/chat/completions` - 对话补全 - GET `/v1/models` - 模型列表 ### 程序运行截图 ![首页展示](2026-04-28-13_43_21.png) ![英文首页](2026-04-28-13_43_30.png) ![模型选择](2026-04-28-13_43_42.png) ![我的密钥](2026-04-28-13_44_06.png) ![账单统计](2026-04-28-13_44_35.png) ![使用记录](2026-04-28-13_45_47.png) ## 默认账号 ### 管理员 - 用户名: admin - 密码: admin123 ## 注意事项 1. 支付宝/微信支付需要配置真实的商户信息 2. OpenAI API需要配置真实的API Key 3. 生产环境请修改JWT密钥 4. 建议配置HTTPS ## 许可证 GPL 3.0