Closed hongyi-zhao closed 2 weeks ago
After trial and error, the following method work:
$ cat config_claude.json
{
"api_key": "123456",
"debug": false,
"load_balancing": "random",
"proxy": {
"type": "http",
"http_proxy": "http://127.0.0.1:8080",
"strategy": "default"
},
"services": {
"claude": [
{
"models": [
"claude/claude-3-5-sonnet-20240620"
],
"enabled": true,
"credentials": {
"api_key": "sk-ant-xxx"
},
"model_redirect": {
"claude.ai/claude-3-5-sonnet-20240620": "claude-3-5-sonnet-20240620"
},
"server_url": "https://api.anthropic.com/v1/messages",
"use_proxy": true
}
],
"openai": [
{
"models": [
"my-claude-3-5-sonnet-20240620"
],
"enabled": true,
"credentials": {
"api_key": "sk-xxx"
},
"model_redirect": {
"my-claude-3-5-sonnet-20240620": "claude-3-5-sonnet-20240620"
},
"server_url": "https://api.gptsapi.net/v1/chat/completions"
}
]
}
}
In the above config file, model_redirect
can also be replaced by model_map
, and no other changes are needed.
The original failure was due to the following two reasons:
If I want to use
claude-3-5-sonnet-20240620
from different providers/channels with the following "model_map" method basedconfig.json
:But the access to these models failed:
On the other hand, how to do it with
model_redirect
?