claude to chatgpt
v0.4.0
该项目将人类Claude模型的API转换为OpenAI Chat API格式。
claude-instant-1 , claude-2模型您可以使用Cloudflare工人或Docker运行此项目:
通过使用CloudFlare工人,您无需服务器即可部署此项目。
cloudflare-worker.js中Cloudfalre工人每天支持100K请求,如果您需要拨打更多的电话,则可以使用Docker如下部署。
docker run -p 8000:8000 wtzeng/claude-to-chatgpt:latestdocker-compose up然后,API将在http:// localhost:8000上提供。 API端点: /v1/chat/completions
将模型参数输入为gpt-3.5-turbo或gpt-3.5-turbo-0613时,它将用claude-instant-1代替。否则, claude-2将被使用。
以下是一些推荐的GUI软件,支持该项目:
curl http://localhost:8000/v1/chat/completions
-H " Content-Type: application/json "
-H " Authorization: Bearer $CLAUDE_API_KEY "
-d ' {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
} ' Claude完成API具有端点/v1/complete
{
"prompt" : " nn Human: Hello, AI. nn Assistant: " ,
"model" : " claude-instant-1 " ,
"max_tokens_to_sample" : 100 ,
"temperature" : 1 ,
"stream" : true
}并以选择和完成的方式返回JSON。
OpenAI聊天API具有类似的/v1/chat/completions端点,该端点为:
{
"model" : " gpt-3.5-turbo " ,
"messages" : [
{
"role" : " user " ,
"content" : " Hello, AI. "
}
],
"max_tokens" : 100 ,
"temperature" : 1 ,
"stream" : true
}并用响应字符串返回JSON。
该项目在这两个API之间转换,从Claude模型中获得完成,并将其格式化为OpenAI聊天响应。
该项目是根据MIT许可证获得许可的 - 有关详细信息,请参见许可证文件。