国产大模型统一管理工具 —— 基于 Electron + Express 的桌面应用,提供 OpenAI 兼容 的本地 API 网关,让你用同一套接口调用智谱、DeepSeek 等国产模型。
- 🖥️ 桌面 GUI:一键配置 API Key、切换模型、测试连通性
- 🔌 OpenAI 兼容:暴露
/v1/chat/completions与/v1/models,可直接被 LangChain、各类 SDK、Cherry Studio 等客户端使用 - 🧠 多模型支持:内置智谱 GLM-4、DeepSeek Chat,可扩展
- 💾 本地持久化:配置保存到本地
config.json,API Key 不出本机 - 🚀 一键启动:Windows / macOS / Linux 通用启动脚本
需要 Node.js 16+。
npm installWindows:
start.batmacOS / Linux:
chmod +x start.sh
./start.sh脚本会自动在后台启动 API 服务,并打开桌面 GUI。
# 终端 1:启动后端 API 网关
npm run server
# 终端 2:启动桌面 GUI
npm start- 启动应用后,在 GUI 中为目标模型填入 API Key 并保存
- 点击模型卡片上的「选择」将其设为默认模型
- 点击「测试」验证连通性
- 在你的应用中将 Base URL 指向
http://localhost:3000/v1,即可像调用 OpenAI 一样调用国产模型
| 提供商 | 申请地址 |
|---|---|
| 智谱 GLM | https://open.bigmodel.cn |
| DeepSeek | https://platform.deepseek.com |
服务监听在 http://localhost:3000。
# 聊天补全
curl http://localhost:3000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "zhipu-glm-4",
"messages": [{"role": "user", "content": "你好"}]
}'
# 模型列表
curl http://localhost:3000/v1/models请求体里的 model 字段可省略,缺省使用 GUI 中选中的模型。
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /health |
健康检查 |
| GET | /api/models |
获取所有模型配置 |
| POST | /api/models/:key |
更新指定模型的配置(如 apiKey) |
| POST | /api/select |
切换默认模型 |
.
├── main.js # Electron 主进程
├── server.js # Express API 网关
├── index.html # GUI 界面
├── config.json # 本地配置(运行时生成,已在 .gitignore 中)
├── start.bat # Windows 启动脚本
├── start.sh # Unix 启动脚本
└── package.json
在 server.js 的 getDefaultConfig() 中新增模型定义,并在 /v1/chat/completions 的 provider 分支里实现对应的请求适配即可。
config.json包含明文 API Key,已在.gitignore中,请勿提交到公开仓库- 服务默认监听
0.0.0.0:3000,如需仅本地访问可改为127.0.0.1 - 当前未做鉴权,不要直接暴露到公网
MIT