Skip to content

Commit

Permalink
chore: update env && add issue template (#79)
Browse files Browse the repository at this point in the history
* update env

* Add issue template
  • Loading branch information
KenyonY authored Sep 28, 2023
1 parent f97bd6f commit 3bbf3fa
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 131 deletions.
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-zh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: 🐞 发现一个Bug!
description: 报告一个bug或不正常的行为
labels: [unconfirmed bug]

body:
- type: markdown
attributes:
value: 感谢你贡献问题!

- type: checkboxes
id: checks
attributes:
label: 初始检查
description: |
请确认以下所有项均被满足
options:
- label: 我运行的`openai-forward`版本不低于v0.6.0
required: true

- type: textarea
id: description
attributes:
label: 问题描述
description: |
请描述你遇到的问题,以及你期望看到的结果。
validations:
required: true

- type: textarea
id: example
attributes:
label: 配置/代码示例和输出
description: >
如果可能,请添加一个最小化的、可复现该问题的代码/配置示例,以便开发者能够更好地理解你的问题。
- type: textarea
id: idea
attributes:
label: 我的见解
description: >
你对于这个bug的任何想法
- type: textarea
id: version
attributes:
label: 环境
description: |
Python版本、操作系统和`openai-forward`版本
在终端执行以下命令,以查看输出版本:
```bash
python -c "import sys,platform; print('python: {}\nOS: {}'.format(sys.version, platform.system()));"
python -c "import openai_forward; print('openai_forward: {}'.format(openai_forward.__version__));"
```
validations:
required: true


- type: checkboxes
id: checklist-final
attributes:
label: 最后一步
description: 回顾你的回答
options:
- label: 我认为上述的描述已经足够详细,开发者能够复现该问题
required: true
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: 🐞 Bug Report
description: Report a bug or unexpected behavior in openai-forward above (v0.6.0)
labels: [unconfirmed bug]

body:
- type: markdown
attributes:
value: Thank you for contributing to openai-forward!


- type: checkboxes
id: checks
attributes:
label: Initial Checks
description: |
Just a few checks to make sure you need to create a bug report.
options:
- label: My `openai-forward` version is not lower than v0.6.0
required: true

- type: textarea
id: description
attributes:
label: Issue Description
description: |
Please describe the problem you encountered and what you expected to see.
validations:
required: true

- type: textarea
id: example
attributes:
label: Configuration/Code Example and Output
description: >
If possible, please provide a minimized, reproducible code/configuration example so developers can better understand your issue.
- type: textarea
id: idea
attributes:
label: My Insight
description: >
Any thoughts you have regarding this bug
- type: textarea
id: version
attributes:
label: Environment
description: |
Python version, operating system, and `openai-forward` version
Run the following commands in the terminal to see the output versions:
```bash
python -c "import sys,platform; print('python: {}\nOS: {}'.format(sys.version, platform.system()));"
python -c "import openai_forward; print('openai_forward: {}'.format(openai_forward.__version__));"
```
validations:
required: true

- type: checkboxes
id: checklist-final
attributes:
label: Final Step
description: Review your answers
options:
- label: I believe my description above is detailed enough for developers to reproduce the issue.
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Join the Telegram channel
url: https://t.me/openai_forward
about: Join the official channel and stay tuned for news, updates and announcements.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request-zh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ✨ 功能请求
description: Suggest ideas, new features or enhancements
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Checklist
options:
- label: 我相信这个想法很棒并且将使框架变得更好
required: true
- label: 我已在issue中搜索了类似请求,包括已关闭的请求
required: true

- type: textarea
attributes:
label: 详细描述
description: 提供一份对该请求的详细描述
placeholder: 描述...
validations:
required: true
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ✨ Feature request

description: Suggest ideas, new features or enhancements
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Checklist
options:
- label: I believe the idea is awesome and would benefit the framework
required: true
- label: I have searched in the issue tracker for similar requests, including closed ones
required: true

- type: textarea
attributes:
label: Detailed Description
description: Provide a detailed description of the request
placeholder: Description...
validations:
required: true
2 changes: 0 additions & 2 deletions .vercelignore

This file was deleted.

1 change: 0 additions & 1 deletion Examples/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
user_content = "现在让我们使用泰勒展开推导出牛顿法迭代公式: \n"
from sparrow import MeasureTime

mt = MeasureTime().start()
resp = openai.Completion.create(
model="gpt-3.5-turbo-instruct",
prompt=user_content,
Expand Down
50 changes: 23 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,27 @@
<br>
</h1>
<p align="center">
<b> OpenAI API风格接口转发服务 <br/>
The fastest way to deploy LLMs api forwarding </b>
一个支持多目标路由、流量控制、自动重试以及一键云端部署的高效代理工具
</p>

<p align="center">
<a href="https://pypi.org/project/openai-forward/"><img src="https://img.shields.io/pypi/v/openai-forward?color=brightgreen" alt="PyPI version" ></a>
<a href="https://pypi.org/project/openai-forward/">
<img src="https://img.shields.io/pypi/v/openai-forward?color=brightgreen&style=flat-square" alt="PyPI version" >
</a>
<a href="https://github.com/beidongjiedeguang/openai-forward/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/beidongjiedeguang/openai-forward.svg?color=blue&style=flat-square">
</a>
<a href="https://github.com/beidongjiedeguang/openai-forward/releases">
<img alt="Release (latest by date)" src="https://img.shields.io/github/v/release/beidongjiedeguang/openai-forward">
</a>
<a href="https://github.com/beidongjiedeguang/openai-forward">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/beidongjiedeguang/openai-forward">
<img alt="Release (latest by date)" src="https://img.shields.io/github/v/release/beidongjiedeguang/openai-forward?&style=flat-square">
</a>
<a href="https://hub.docker.com/r/beidongjiedeguang/openai-forward">
<img alt="docker image size" src="https://img.shields.io/docker/image-size/beidongjiedeguang/openai-forward?style=flat&label=docker image">
<img alt="docker image size" src="https://img.shields.io/docker/image-size/beidongjiedeguang/openai-forward?style=flat-square&label=docker image">
</a>
<a href="https://github.com/beidongjiedeguang/openai-forward/actions/workflows/ci.yml">
<img alt="tests" src="https://img.shields.io/github/actions/workflow/status/beidongjiedeguang/openai-forward/ci.yml?label=tests">
<img alt="tests" src="https://img.shields.io/github/actions/workflow/status/beidongjiedeguang/openai-forward/ci.yml?style=flat-square&label=tests">
</a>
<a href="https://pypistats.org/packages/openai-forward">
<img alt="pypi downloads" src="https://img.shields.io/pypi/dm/openai_forward">
</a>
<a href="https://codecov.io/gh/beidongjiedeguang/openai-forward">
<img alt="codecov" src="https://codecov.io/gh/beidongjiedeguang/openai-forward/branch/dev/graph/badge.svg">
<img alt="pypi downloads" src="https://img.shields.io/pypi/dm/openai_forward?style=flat-square">
</a>
</p>

Expand All @@ -48,9 +43,10 @@

</div>

OpenAI-Forward
是一个专为大型语言模型设计的高级转发服务,提供包括用户请求速率控制、Token速率限制和自定义API密钥等增强功能。该服务可用于代理本地模型(如 [LocalAI](https://github.com/go-skynet/LocalAI)
)或云端模型(如 [openai](https://api.openai.com))。
openai-forward
是一个专为大型语言模型设计的高级转发服务,提供包括用户请求速率控制、Token速率限制和自定义API密钥等增强功能。
该服务可用于代理本地模型(如 [LocalAI](https://github.com/go-skynet/LocalAI))或云端模型(如 [OpenAI](https://api.openai.com))。
服务由 `fastapi`,`aiohttp`,`asyncio`全异步实现,保证了其高效性。



Expand All @@ -68,16 +64,16 @@ OpenAI-Forward 提供如下功能:
- **实时响应日志**: 支持流式响应的会话日志记录
- **多目标路由**: 能够同时转发多个服务到不同的路由地址
- **自动重试机制**:在请求失败时自动重试
- **快速部署**: `pip` /`docker` 快速本地安装和部署,支持一键云端部署
- ...
- **快速部署**: `pip`/`docker` 快速本地安装和部署,支持一键云端部署


由本项目搭建的代理服务地址:

> https://api.openai-forward.com
> https://render.openai-forward.com
<font size=2 >
注:此代理服务仅供学习和研究目的使用
注:此代理服务仅供个人学习和研究目的使用,勿用于任何商业用途
</font>

## 部署指南
Expand Down Expand Up @@ -129,16 +125,19 @@ INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
```

### 代理OpenAI API:
### 代理OpenAI模型:

这也是`aifd run`的默认选项
`aifd run`的默认选项便是代理`https://api.openai.com`

#### 在三方应用中使用
下面以搭建好的服务地址`https://api/openai-forward.com` 为例

<details >
<summary> 点击展开</summary>

基于开源项目[ChatGPT-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web)搭建自己的chatgpt服务
#### 在三方应用中使用


基于开源项目[ChatGPT-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web)中接入:
替换docker启动命令中的 `BASE_URL`为自己搭建的代理服务地址

```bash
Expand All @@ -150,7 +149,6 @@ docker run -d \
yidadaa/chatgpt-next-web
```

</details>

#### 在代码中接入

Expand All @@ -164,8 +162,6 @@ docker run -d \
openai.api_key = "sk-******"
```

<details >
<summary>更多(点击展开)</summary>

**JS/TS**

Expand Down Expand Up @@ -220,7 +216,7 @@ curl --location 'https://api.openai-forward.com/v1/images/generations' \
### 代理其它云端模型
- **适用场景:**
例如,通过 [claude-to-chatgpt](https://github.com/jtsang4/claude-to-chatgpt) 可以将 claude 的 API 格式转换为 openai 的api格式,
然后使用 `openai-forward` 进行代理
然后使用本服务进行代理

(更多)

Expand Down
13 changes: 0 additions & 13 deletions _worker.js

This file was deleted.

Loading

0 comments on commit 3bbf3fa

Please sign in to comment.