Status: [LIVE] Endpoints found: https://api.openai.com/v1/chat/completions https://api.openai.com/v1/chat https://ark.cn-beijing.volces.com/api/v3/chat Source: https://github.com/lanjing-digital/llm-relay # LLM Relay 大模型中转站,对外暴露 OpenAI 兼容接口,外部调用方统一使用 `deepseek-chat` 作为模型标识,内部根据管理后台配置将请求转发到真正的目标模型和 API 地址。 前端管理页面使用 React + Antd 构建,构建产物内嵌到 Go 二进制中,单文件部署。 ## 功能特性 - OpenAI 兼容的 `/v1/chat/completions` 转发接口,支持流式(SSE)和非流式 - 管理后台可视化配置模型映射(增删改查 + 连通性测试) - SQLite 持久化存储,零外部依赖 - 前端构建产物内嵌到 Go 二进制,单文件部署 - 支持自定义上游 Base URL(兼容 `/v1`、`/v3` 等版本路径) ## 技术栈 | 层 | 技术 | |------|------| | 后端 | Go 1.25+、Gin、GORM、SQLite | | 前端 | React 19、Antd 6、Vite、TypeScript | | 部署 | 单二进制文件(embed 内嵌前端) | ## 项目结构 ``` llm_relay/ ├── cmd/relay/main.go # 后端入口 ├── internal/ │ ├── db/db.go # SQLite 初始化 + 自动迁移 │ ├── model/config.go # Config 数据模型 │ ├── repository/config_repo.go # Config CRUD 数据访问层 │ └── handler/ │ ├── config_handler.go # 配置管理 API + 连通性测试 │ └── proxy_handler.go # OpenAI 兼容转发 + URL 拼接 + SSE 透传 ├── web/ # React 前端 │ ├── src/ │ │ ├── App.tsx # 管理页面主组件 │ │ ├── components/ │ │ │ └── config-form-modal.tsx │ │ ├── api/ │ │ │ ├── client.ts # axios 实例 │ │ │ └── configs.ts # 配置 API 封装 │ │ └── types/config.ts # 类型定义 │ ├── vite.config.ts │ └── package.json ├── web_embed.go # embed 内嵌 web/dist ├── go.mod