sub2api
sub2api copied to clipboard
[Bug] typesafe 转发路径未应用 model_mapping,导致 model 名原样透传上游,非 TypeSafe 官方上游(如百炼)全部 404
- 账号配置:platform: typesafe,type: apikey
- 上游:阿里云百炼 Model Studio(TypeSafe System One 协议兼容)
- base_url: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode
- 官方要求 model 必须为 decision-model-preview(参考阿里云官方 Decision Model API 文档)
- 账号配置 { "name": "百炼-jev", "platform": "typesafe", "type": "apikey", "credentials": { "base_url": "https://ws-xxxx.cn-beijing.maas.aliyuncs.com/compatible-mode", "model_mapping": { "jev-latest": "decision-model-preview", "decision-model-preview": "decision-model-preview" } } } 复现步骤
- 使用上游真实模型名调用
curl -X POST "https://
/v1/systemone"
-H "Authorization: Bearer sk-xxx"
-H "Content-Type: application/json"
-d '{ "model": "decision-model-preview", "state": "Text to evaluate", "questions": { "safety": {"type": "noul", "instructions": "Evaluate whether the text is unsafe"} } }' 响应(400): {"error": {"message": "model must be jev-latest", "type": "invalid_request_error"}} /v1/systemone 端点硬编码只接受 model=jev-latest。 - 使用 jev-latest 调用(model_mapping 已配置 jev-latest → decision-model-preview)
curl -X POST "https://
/v1/systemone"
-H "Authorization: Bearer sk-xxx"
-H "Content-Type: application/json"
-d '{ "model": "jev-latest", "state": "Text to evaluate", "questions": { "safety": {"type": "noul", "instructions": "Evaluate whether the text is unsafe"} } }' 响应(502): {"error": {"message": "Upstream request failed", "type": "upstream_error"}} - 管理端连通性测试暴露真实上游错误 POST /api/v1/admin/accounts/{id}/test(SSE): data: {"type":"test_start","model":"jev-latest"}
data: {"type":"error","error":"API returned 404: {"error":{"message":"Model not exist.","id":"...","type":"invalid_request_error","code":"model_not_found"}}"} 百炼上游返回 model_not_found——收到的模型名是 jev-latest,而不是映射后的 decision-model-preview。