diff --git a/.github/ISSUE_TEMPLATE/bug-report-zh.yml b/.github/ISSUE_TEMPLATE/bug-report-zh.yml
new file mode 100644
index 0000000..0ab21c0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report-zh.yml
@@ -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
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
new file mode 100644
index 0000000..7799db4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -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
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..0ea3890
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -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.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request-zh.yml b/.github/ISSUE_TEMPLATE/feature_request-zh.yml
new file mode 100644
index 0000000..616e21c
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request-zh.yml
@@ -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
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..a6446b0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -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
\ No newline at end of file
diff --git a/.vercelignore b/.vercelignore
deleted file mode 100644
index 91d7ded..0000000
--- a/.vercelignore
+++ /dev/null
@@ -1,2 +0,0 @@
-**/*
-!vercel.json
\ No newline at end of file
diff --git a/Examples/completion.py b/Examples/completion.py
index 64d548b..ee8cd38 100644
--- a/Examples/completion.py
+++ b/Examples/completion.py
@@ -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,
diff --git a/README.md b/README.md
index e8a9065..917328a 100644
--- a/README.md
+++ b/README.md
@@ -6,32 +6,27 @@
- OpenAI API风格接口转发服务
- The fastest way to deploy LLMs api forwarding
+ 一个支持多目标路由、流量控制、自动重试以及一键云端部署的高效代理工具
- + + + - - - - + - + - + - - - - +
@@ -48,9 +43,10 @@ -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`全异步实现,保证了其高效性。 @@ -68,8 +64,8 @@ OpenAI-Forward 提供如下功能: - **实时响应日志**: 支持流式响应的会话日志记录 - **多目标路由**: 能够同时转发多个服务到不同的路由地址 - **自动重试机制**:在请求失败时自动重试 -- **快速部署**: `pip` /`docker` 快速本地安装和部署,支持一键云端部署 -- ... +- **快速部署**: `pip`/`docker` 快速本地安装和部署,支持一键云端部署 + 由本项目搭建的代理服务地址: @@ -77,7 +73,7 @@ OpenAI-Forward 提供如下功能: > https://render.openai-forward.com -注:此代理服务仅供学习和研究目的使用。 +注:此代理服务仅供个人学习和研究目的使用,勿用于任何商业用途。 ## 部署指南 @@ -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` 为例