一个部署Deno Deploy上在 Azure OpenAI API 的代理工具,可以将一个 OpenAI 请求转化为 Azure OpenAI 请求,方便作为各类开源 ChatGPT 的后端使用,无需服务器,免费使用。
- 相比于cloudflare workers,可以无需代理,直连使用
- 支持自定义二级域名(*.deno.dev)或者绑定自己的域名
- 支持打字机模式的流式响应
- 支持mapper,可以自定义模型映射规则,也支持直接透传模型名
- 无需服务器,免费在线部署,每月10万次请求额度
- 23.4.12 更新支持mapper模型映射规则
-
访问 https://dash.deno.com 并注册登录(可以直接使用github账号)
-
点击New Project新建项目
-
点击playground右侧的play进入编辑模式
-
将本项目的 main.ts中的内容复制并粘贴到编辑器中
-
修改对应的 resourceName 和 mapper mapper设置例子:如果你在azure上部署的gpt-3.5-turbo和gpt-4的模型deployment name为gpt35和gpt4,那么mapper按照如下设置
const mapper:any = { 'gpt-3.5-turbo': 'gpt35', 'gpt-4': 'gpt4' };
其他的map规则直接按这样的格式续写即可
-
点击save and deploy进行保存并部署
-
返回到project的settings中自定义自己的二级域名或者绑定自己的域名
将自己自定义的二级域名或绑定的自定义域名填写到自己所使用的gpt项目的api url中,选择设定过mapper的模型,并在api key 中填写自己的azure openai key即可使用。
MIT
有问题的话欢迎提issue,觉得该项目对你有帮助的话欢迎star!
Inspired by https://github.com/haibbo/cf-openai-azure-proxy