Files
sub2api-cn-relay-manager/packs/openai-cn-pack/README.md
phamnazage-jpg f797047727 feat(pack): add official provider templates and loader test
- Add first batch of 10 official provider templates (qwen, glm, kimi, minimax, deepseek, step)
- Add TestLoadPathIncludesFirstBatchOfficialProviders to verify pack loads all templates
- Regenerate checksums.txt with all official provider files
- Bump pack version 1.0.1 -> 1.1.0
- Update README with provider manifest index and import examples
2026-05-21 23:07:07 +08:00

69 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# openai-cn-pack
这是 `sub2api-cn-relay-manager` 的最小模型包样例。
它不是宿主原生插件,而是一个可被控制面读取的 `model_pack`,用于描述国产模型 provider 的默认接入模板、默认模型映射、默认套餐和导入约束。
当前目录现在同时包含:
- 真实可校验包:`pack.json``providers/deepseek.json``checksums.txt`
- 协议样例:`pack.json.example``providers/deepseek.json.example`
当前 pack 除了历史中转 provider也已经内置首批官方 provider 模板:
- `qwen-official.json`
- `qwen-coder-official.json`
- `deepseek-chat-official.json`
- `deepseek-reasoner-official.json`
- `glm-5-1-official.json`
- `glm-4-7-official.json`
- `kimi-k2-5-official.json`
- `kimi-k2-thinking-official.json`
- `minimax-m2-7-official.json`
- `step-3-5-flash-official.json`
对应的 `provider_id` 与首选模型如下:
- `qwen-official`
- `qwen-plus`, `qwen-max`
- `qwen-coder-official`
- `qwen3-coder-plus`, `qwen3-coder-flash`
- `deepseek-chat-official`
- `deepseek-chat`
- `deepseek-reasoner-official`
- `deepseek-reasoner`
- `glm-5-1-official`
- `glm-5.1`
- `glm-4-7-official`
- `glm-4.7`
- `kimi-k2-5-official`
- `kimi-k2.5`
- `kimi-k2-thinking-official`
- `kimi-k2-thinking`
- `minimax-m2-7-official`
- `MiniMax-M2.7-highspeed`, `MiniMax-M2.5-highspeed`
- `step-3-5-flash-official`
- `step-3.5-flash`
一旦这些 provider 模板已经内置到 pack后续新增同类官方 key 的导入就不需要再改代码或重写 provider JSON直接走标准导入命令即可。例如导入 Qwen
```bash
go run ./cmd/cli import-provider \
--host-base-url https://sub2api.example.com \
--host-api-key <sub2api-admin-key> \
--pack-dir ./packs/openai-cn-pack \
--provider-id qwen-official \
--keys <dashscope-api-key-1>,<dashscope-api-key-2> \
--access-mode self_service \
--access-api-key <user-gateway-key>
```
如果你要导入的不是这 10 个模板之一,而是一个全新的官方 provider那么仍然需要先补一个新的 provider manifest再做一键导入。
后续真实交付时,还可以继续扩展更多 provider
- `kimi.json`
- `qwen.json`
- `glm.json`
- `minimax.json`