GPTGateway
1.0.0
創建的一個安息的Web服務,旨在提供一個簡單的API,用於使用基於不同提供商的各種GPT模型生成文本。無論您是想將聊天完成介紹到應用程序中還是探索不同GPT模型的功能,該項目都可以覆蓋。依靠Xtekky/gpt4free。
一個示例應用程序,以展示如何使用此API的演示。下面的應用程序將YouTube視頻轉換為可以編輯的Markdown博客。
# Clone the repository
git clone https://github.com/nagarajpandith/GPTGateway.git
# Navigate to the project directory
cd GPTGateway
# Create a virtual environment
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
# Install the required packages
pip3 install -r requirements.txt創建.ENV文件並填充API_KEY var。
python3 app.pycurl curl -X POST -H " Content-Type: application/json " -d ' {"content": "YOUR_PROMPT", "api_key":"API_KEY_HERE", "provider": "PROVIDER_NAME", "stream": false} ' http://127.0.0.1:5000/chat_completion{
"content" : " YOUR_PROMPT " ,
"api_key" : " API_KEY_HERE " ,
"provider" : " PROVIDER_NAME " ,
"stream" : false
}筆記
您可以自己託管此API,但是如果您想使用已經託管的API,則可以直播在https://gptgateway.onrender.com上。
| 端點 | 描述 | 方法 | 示例身體 |
|---|---|---|---|
/chat_completion | 使用基於提供商的模型生成文本 | 郵政 | {"content": "YOUR_PROMPT", "api_key": "API_KEY_HERE", "provider": "PROVIDER_NAME", "stream": false} |
/working_providers | 檢索工作提供商列表 | 得到 | {} |
提示
提供商和流參數是可選的。如果未提供,則將默認提供商設置為“ bing”,默認流將設置為true。如果將流設置為false,則響應將以直接的最終輸出格式為單位。
上次在9-12-2023上使用“流” = false測試
筆記
了解提供商及其模型是指這個。
狀態值
重要的
如果提供商不起作用,則可能是因為它需要特殊的ARG,例如auth ='cookie'或'jwt',或者網絡驅動程序無法連接,因為這裡的大多數提供商需要網絡刮擦或IP地址阻止等。因此,請不要將下面的結果視為最終真實源。要自己測試,請運行python3 test.py腳本。
| 提供者 | 本地/託管/兩者 | 平均響應時間 |
|---|---|---|
| aitianhuspace | 沒有任何 | 0.0000 |
| Aichatonline | 兩個都 | 1.7414 |
| 詩人 | 沒有任何 | 0.0000 |
| bing | 兩個都 | 7.5283 |
| chatbase | 兩個都 | 11.0944 |
| 查爾福萊 | 沒有任何 | 0.0000 |
| chatgpt4online | 沒有任何 | 0.0000 |
| Chatgptai | 兩個都 | 4.0048 |
| chatgptnext | 兩個都 | 1.1684 |
| Deepinfra | 兩個都 | 2.9104 |
| 假貨 | 沒有任何 | 0.0000 |
| gptalk | 沒有任何 | 0.0000 |
| Geekgpt | 託管 | 2.6676 |
| gptchatly | 沒有任何 | 0.0000 |
| gptforlove | 沒有任何 | 0.0000 |
| GPTGO | 當地的 | 1.0809 |
| gpttalkru | 兩個都 | 1.3263 |
| hashnode | 兩個都 | 14.0748 |
| 擁抱 | 沒有任何 | 0.0000 |
| 無尾熊 | 當地的 | 2.3503 |
| 養育機器人 | 沒有任何 | 0.0000 |
| Llama2 | 沒有任何 | 0.0000 |
| myshell | 當地的 | 9.0187 |
| 在線遊戲 | 兩個都 | 2.3497 |
| Openaichat | 沒有任何 | 0.0000 |
| 困惑 | 當地的 | 10.8567 |
| Phind | 兩個都 | 0.4872 |
| pi | 當地的 | 8.9026 |
| 坡 | 沒有任何 | 0.0000 |
| 射線廣播 | 沒有任何 | 0.0000 |
| RetryProvider | 沒有任何 | 0.0000 |
| Talkai | 當地的 | 13.3812 |
| theb | 沒有任何 | 0.0000 |
| thebapi | 沒有任何 | 0.0000 |
| 你 | 當地的 | 1.6147 |
| yqcloud | 沒有任何 | 0.0000 |
我手動測試了這些提供商,發現它們是最可靠和快速的提供商。
| 提供者 | 本地/託管/兩者 | 平均響應時間 |
|---|---|---|
| gpttalkru | 兩個都 | 2-3s |
| Geekgpt | 兩個都 | 6-8 |
| Chatgptai | 兩個都 | 5s |
| chatgptnext | 兩個都 | 7-8 |
| Aichatonline | 當地的 | 4s |
| gptchatly | 當地的 | 4-5 |
| 在線遊戲 | 當地的 | 4s |
| bing | 兩個都 | 15-20 |
| chatbase | 兩個都 | 12-13 |
| 無尾熊 | 當地的 | 4s |
| GPTGO | 當地的 | 12s |
| 你 | 當地的 | 10s |
| myshell | 當地的 | 11s |
| pi | 當地的 | 11s |
| 困惑 | 當地的 | 14s |
| hashnode | 兩個都 | 18歲 |
| Talkai | 當地的 | 20年代 |
| Deepinfra | 兩個都 | 31-47 |
| theb | 當地的 | 12s |
重要的
只是一個愛好的項目,沒有任何進一步發展的意圖,因為它只是圍繞GPT4Free項目的簡單包裝。就我個人而言,我不建議提供生產用途的提供商,它們可能隨時會下降,而且非常不可靠。而是親自託管任何開源LLM。我的個人選擇是Mistral-7B,其性能要比Meta的Llama2-13b型號要好得多。在此處結帳開源LLMS和Arena排行榜的列表(由公眾投票)。