Skip to content

Commit

Permalink
upload readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hbsgithub committed Apr 12, 2023
1 parent f13a885 commit 4b5c8ff
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,31 @@
1. 相比于cloudflare workers,可以无需代理,直连使用
2. 支持自定义二级域名(*.deno.dev)或者绑定自己的域名
3. 支持打字机模式的流式响应
4. 无需服务器,免费在线部署,每月10万次请求额度
4. 支持mapper,可以自定义模型映射规则,也支持直接透传模型名
5. 无需服务器,免费在线部署,每月10万次请求额度
# 更新
- 23.4.12 更新支持mapper模型映射规则
# 部署方法
1. 访问 https://dash.deno.com 并注册登录(可以直接使用github账号)
2. 点击New Project新建项目
3. 点击playground右侧的play进入编辑模式
4. 将本项目的 [main.ts](https://github.com/hbsgithub/deno-azure-openai-proxy/blob/main/main.ts)中的内容复制并粘贴到编辑器中
5. 修改对应的 resourceName 和 deployName
5. 修改对应的 resourceName 和 mapper
![部署方法](https://user-images.githubusercontent.com/1295315/229705215-e0556c99-957f-4d98-99a6-1c51254110b9.png)
**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规则直接按这样的格式续写即可

1. 点击save and deploy进行保存并部署
2. 返回到project的settings中自定义自己的二级域名或者绑定自己的域名
# 使用方法
将自己自定义的二级域名或绑定自定义域名填写到自己所使用的gpt项目的api url中,并在api key 中填写自己的azure openai key即可使用。
将自己自定义的二级域名或绑定的自定义域名填写到自己所使用的gpt项目的api url中,选择设定过mapper的模型,并在api key 中填写自己的azure openai key即可使用。
## License
MIT

Expand Down
21 changes: 15 additions & 6 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,32 @@ A proxy tool deployed on Deno Deploy that can convert an OpenAI request into an
1. Compared to Cloudflare Workers, it can be used directly without a proxy.
2. Support for custom second-level domain names (*.deno.dev) or binding your own domain name.
3. Support for typewriter mode of streaming responses.
4. No server required, free online deployment, with a monthly limit of 100,000 requests.
4. Supports mapper, which allows for custom model mapping rules,also supports directly passing through the model name.
5. No server required, free online deployment, with a monthly limit of 100,000 requests.
# Deployment Method

1. Visit https://dash.deno.com/ and register and log in (you can directly use your GitHub account).
2. Click "New Project" to create a new project.
3. Click "play" on the right side of the code editor to enter edit mode.
4. Copy and paste the contents of [main.ts](https://github.com/hbsgithub/deno-azure-openai-proxy/blob/main/main.ts) from this repository into the editor.
5. Modify the corresponding "resourceName" and "deployName".
5. Modify the corresponding "resourceName" and "mapper".

![img](https://user-images.githubusercontent.com/1295315/229705215-e0556c99-957f-4d98-99a6-1c51254110b9.png)

6. Click "save and deploy" to save and deploy the project.
7. Customize your own secondary domain or bind your own domain in the project settings.
**Mapper configuration example**: If you have deployed the GPT-3.5 Turbo and GPT-4 models on Azure with deployment names 'gpt35' and 'gpt4', respectively, then the mapper should be configured as follows.
```
const mapper:any = {
'gpt-3.5-turbo': 'gpt35',
'gpt-4': 'gpt4'
};
```
Other map rules can be continued directly in this format.

1. Click "save and deploy" to save and deploy the project.
2. Customize your own secondary domain or bind your own domain in the project settings.

# Usage

Fill in your custom secondary domain or bound domain in the GPT API project you're using, and fill in your own Azure OpenAI key in the API key field to use.
Fill in your custom secondary domain or bound domain in the GPT API project you're using, select a model that has been set up with a mapper and fill in your own Azure OpenAI key in the API key field to use.
## License
MIT
# Remarks
Expand Down

0 comments on commit 4b5c8ff

Please sign in to comment.