remove name

This commit is contained in:
jax 2023-12-18 03:23:26 +08:00
parent c7a8aa5965
commit 0f4cb2d0bd
18 changed files with 73 additions and 95 deletions

View File

@ -2,7 +2,7 @@ blank_issues_enabled: false
contact_links: contact_links:
- name: 项目群聊 - name: 项目群聊
url: https://openai.justsong.cn/ url: https://openai.justsong.cn/
about: QQ 群828520184自动审核备注 One API about: QQ 群828520184自动审核备注 Fly API
- name: 赞赏支持 - name: 赞赏支持
url: https://iamazing.cn/page/reward url: https://iamazing.cn/page/reward
about: 请作者喝杯咖啡,以激励作者持续开发 about: 请作者喝杯咖啡,以激励作者持续开发

View File

@ -3,12 +3,12 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/songquanpeng/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a> <a href="https://github.com/loks666/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a>
</p> </p>
<div align="center"> <div align="center">
# One API # Fly API
_✨ Access all LLM through the standard OpenAI API format, easy to deploy & use ✨_ _✨ Access all LLM through the standard OpenAI API format, easy to deploy & use ✨_
@ -18,13 +18,13 @@ _✨ Access all LLM through the standard OpenAI API format, easy to deploy & use
<a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE"> <a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE">
<img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license"> <img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://hub.docker.com/repository/docker/justsong/one-api"> <a href="https://hub.docker.com/repository/docker/justsong/one-api">
<img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull"> <img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api"> <a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
@ -37,7 +37,7 @@ _✨ Access all LLM through the standard OpenAI API format, easy to deploy & use
· ·
<a href="#usage">Usage</a> <a href="#usage">Usage</a>
· ·
<a href="https://github.com/songquanpeng/one-api/issues">Feedback</a> <a href="https://github.com/loks666/one-api/issues">Feedback</a>
· ·
<a href="#screenshots">Screenshots</a> <a href="#screenshots">Screenshots</a>
· ·
@ -129,9 +129,9 @@ sudo service nginx restart
The initial account username is `root` and password is `123456`. The initial account username is `root` and password is `123456`.
### Manual Deployment ### Manual Deployment
1. Download the executable file from [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) or compile from source: 1. Download the executable file from [GitHub Releases](https://github.com/loks666/one-api/releases/latest) or compile from source:
```shell ```shell
git clone https://github.com/songquanpeng/one-api.git git clone https://github.com/loks666/one-api.git
# Build the frontend # Build the frontend
cd one-api/web cd one-api/web
@ -164,9 +164,9 @@ For more detailed deployment tutorials, please refer to [this page](https://iama
Please refer to the [environment variables](#environment-variables) section for details on using environment variables. Please refer to the [environment variables](#environment-variables) section for details on using environment variables.
### Deployment on Control Panels (e.g., Baota) ### Deployment on Control Panels (e.g., Baota)
Refer to [#175](https://github.com/songquanpeng/one-api/issues/175) for detailed instructions. Refer to [#175](https://github.com/loks666/one-api/issues/175) for detailed instructions.
If you encounter a blank page after deployment, refer to [#97](https://github.com/songquanpeng/one-api/issues/97) for possible solutions. If you encounter a blank page after deployment, refer to [#97](https://github.com/loks666/one-api/issues/97) for possible solutions.
### Deployment on Third-Party Platforms ### Deployment on Third-Party Platforms
<details> <details>
@ -199,7 +199,7 @@ If you encounter a blank page after deployment, refer to [#97](https://github.co
6. Automatic deployment will start, but please cancel it for now. Go to the Variable tab, add a `PORT` with a value of `3000`, and then add a `SQL_DSN` with a value of `<username>:<password>@tcp(<addr>:<port>)/one-api`. Save the changes. Please note that if `SQL_DSN` is not set, data will not be persisted, and the data will be lost after redeployment. 6. Automatic deployment will start, but please cancel it for now. Go to the Variable tab, add a `PORT` with a value of `3000`, and then add a `SQL_DSN` with a value of `<username>:<password>@tcp(<addr>:<port>)/one-api`. Save the changes. Please note that if `SQL_DSN` is not set, data will not be persisted, and the data will be lost after redeployment.
7. Select Redeploy. 7. Select Redeploy.
8. In the Domains tab, select a suitable domain name prefix, such as "my-one-api". The final domain name will be "my-one-api.zeabur.app". You can also CNAME your own domain name. 8. In the Domains tab, select a suitable domain name prefix, such as "my-one-api". The final domain name will be "my-one-api.zeabur.app". You can also CNAME your own domain name.
9. Wait for the deployment to complete, and click on the generated domain name to access One API. 9. Wait for the deployment to complete, and click on the generated domain name to access Fly API.
</div> </div>
</details> </details>
@ -214,16 +214,16 @@ After the system starts, log in as the `root` user to further configure the syst
## Usage ## Usage
Add your API Key on the `Channels` page, and then add an access token on the `Tokens` page. Add your API Key on the `Channels` page, and then add an access token on the `Tokens` page.
You can then use your access token to access One API. The usage is consistent with the [OpenAI API](https://platform.openai.com/docs/api-reference/introduction). You can then use your access token to access Fly API. The usage is consistent with the [OpenAI API](https://platform.openai.com/docs/api-reference/introduction).
In places where the OpenAI API is used, remember to set the API Base to your One API deployment address, for example: `https://openai.justsong.cn`. The API Key should be the token generated in One API. In places where the OpenAI API is used, remember to set the API Base to your Fly API deployment address, for example: `https://openai.justsong.cn`. The API Key should be the token generated in Fly API.
Note that the specific API Base format depends on the client you are using. Note that the specific API Base format depends on the client you are using.
```mermaid ```mermaid
graph LR graph LR
A(User) A(User)
A --->|Request| B(One API) A --->|Request| B(Fly API)
B -->|Relay Request| C(OpenAI) B -->|Relay Request| C(OpenAI)
B -->|Relay Request| D(Azure) B -->|Relay Request| D(Azure)
B -->|Relay Request| E(Other downstream channels) B -->|Relay Request| E(Other downstream channels)
@ -267,7 +267,7 @@ If the channel ID is not provided, load balancing will be used to distribute the
![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png) ![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png)
## FAQ ## FAQ
1. What is quota? How is it calculated? Does One API have quota calculation issues? 1. What is quota? How is it calculated? Does Fly API have quota calculation issues?
+ Quota = Group multiplier * Model multiplier * (number of prompt tokens + number of completion tokens * completion multiplier) + Quota = Group multiplier * Model multiplier * (number of prompt tokens + number of completion tokens * completion multiplier)
+ The completion multiplier is fixed at 1.33 for GPT3.5 and 2 for GPT4, consistent with the official definition. + The completion multiplier is fixed at 1.33 for GPT3.5 and 2 for GPT4, consistent with the official definition.
+ If it is not a stream mode, the official API will return the total number of tokens consumed. However, please note that the consumption multipliers for prompts and completions are different. + If it is not a stream mode, the official API will return the total number of tokens consumed. However, please note that the consumption multipliers for prompts and completions are different.

View File

@ -3,12 +3,12 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/songquanpeng/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a> <a href="https://github.com/loks666/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a>
</p> </p>
<div align="center"> <div align="center">
# One API # Fly API
_✨ 標準的な OpenAI API フォーマットを通じてすべての LLM にアクセスでき、導入と利用が容易です ✨_ _✨ 標準的な OpenAI API フォーマットを通じてすべての LLM にアクセスでき、導入と利用が容易です ✨_
@ -18,13 +18,13 @@ _✨ 標準的な OpenAI API フォーマットを通じてすべての LLM に
<a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE"> <a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE">
<img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license"> <img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://hub.docker.com/repository/docker/justsong/one-api"> <a href="https://hub.docker.com/repository/docker/justsong/one-api">
<img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull"> <img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api"> <a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
@ -37,7 +37,7 @@ _✨ 標準的な OpenAI API フォーマットを通じてすべての LLM に
· ·
<a href="#usage">使用方法</a> <a href="#usage">使用方法</a>
· ·
<a href="https://github.com/songquanpeng/one-api/issues">フィードバック</a> <a href="https://github.com/loks666/one-api/issues">フィードバック</a>
· ·
<a href="#screenshots">スクリーンショット</a> <a href="#screenshots">スクリーンショット</a>
· ·
@ -130,9 +130,9 @@ sudo service nginx restart
初期アカウントのユーザー名は `root` で、パスワードは `123456` です。 初期アカウントのユーザー名は `root` で、パスワードは `123456` です。
### マニュアルデプロイ ### マニュアルデプロイ
1. [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) から実行ファイルをダウンロードする、もしくはソースからコンパイルする: 1. [GitHub Releases](https://github.com/loks666/one-api/releases/latest) から実行ファイルをダウンロードする、もしくはソースからコンパイルする:
```shell ```shell
git clone https://github.com/songquanpeng/one-api.git git clone https://github.com/loks666/one-api.git
# フロントエンドのビルド # フロントエンドのビルド
cd one-api/web cd one-api/web
@ -165,9 +165,9 @@ sudo service nginx restart
Please refer to the [environment variables](#environment-variables) section for details on using environment variables. Please refer to the [environment variables](#environment-variables) section for details on using environment variables.
### コントロールパネル(例: Baotaへの展開 ### コントロールパネル(例: Baotaへの展開
詳しい手順は [#175](https://github.com/songquanpeng/one-api/issues/175) を参照してください。 詳しい手順は [#175](https://github.com/loks666/one-api/issues/175) を参照してください。
配置後に空白のページが表示される場合は、[#97](https://github.com/songquanpeng/one-api/issues/97) を参照してください。 配置後に空白のページが表示される場合は、[#97](https://github.com/loks666/one-api/issues/97) を参照してください。
### サードパーティプラットフォームへのデプロイ ### サードパーティプラットフォームへのデプロイ
<details> <details>
@ -200,7 +200,7 @@ Please refer to the [environment variables](#environment-variables) section for
6. 自動デプロイが開始されますが、一旦キャンセルしてください。Variable タブで `PORT``3000` を追加し、`SQL_DSN` に `<username>:<password>@tcp(<addr>:<port>)/one-api` を追加します。変更を保存する。SQL_DSN` が設定されていないと、データが永続化されず、再デプロイ後にデータが失われるので注意すること。 6. 自動デプロイが開始されますが、一旦キャンセルしてください。Variable タブで `PORT``3000` を追加し、`SQL_DSN` に `<username>:<password>@tcp(<addr>:<port>)/one-api` を追加します。変更を保存する。SQL_DSN` が設定されていないと、データが永続化されず、再デプロイ後にデータが失われるので注意すること。
7. 再デプロイを選択します。 7. 再デプロイを選択します。
8. Domains タブで、"my-one-api" のような適切なドメイン名の接頭辞を選択する。最終的なドメイン名は "my-one-api.zeabur.app" となります。独自のドメイン名を CNAME することもできます。 8. Domains タブで、"my-one-api" のような適切なドメイン名の接頭辞を選択する。最終的なドメイン名は "my-one-api.zeabur.app" となります。独自のドメイン名を CNAME することもできます。
9. デプロイが完了するのを待ち、生成されたドメイン名をクリックして One API にアクセスします。 9. デプロイが完了するのを待ち、生成されたドメイン名をクリックして Fly API にアクセスします。
</div> </div>
</details> </details>
@ -215,16 +215,16 @@ Please refer to the [environment variables](#environment-variables) section for
## 使用方法 ## 使用方法
`Channels` ページで API Key を追加し、`Tokens` ページでアクセストークンを追加する。 `Channels` ページで API Key を追加し、`Tokens` ページでアクセストークンを追加する。
アクセストークンを使って One API にアクセスすることができる。使い方は [OpenAI API](https://platform.openai.com/docs/api-reference/introduction) と同じです。 アクセストークンを使って Fly API にアクセスすることができる。使い方は [OpenAI API](https://platform.openai.com/docs/api-reference/introduction) と同じです。
OpenAI API が使用されている場所では、API Base に One API のデプロイアドレスを設定することを忘れないでください(例: `https://openai.justsong.cn`。API Key は One API で生成されたトークンでなければなりません。 OpenAI API が使用されている場所では、API Base に Fly API のデプロイアドレスを設定することを忘れないでください(例: `https://openai.justsong.cn`。API Key は Fly API で生成されたトークンでなければなりません。
具体的な API Base のフォーマットは、使用しているクライアントに依存することに注意してください。 具体的な API Base のフォーマットは、使用しているクライアントに依存することに注意してください。
```mermaid ```mermaid
graph LR graph LR
A(ユーザ) A(ユーザ)
A --->|リクエスト| B(One API) A --->|リクエスト| B(Fly API)
B -->|中継リクエスト| C(OpenAI) B -->|中継リクエスト| C(OpenAI)
B -->|中継リクエスト| D(Azure) B -->|中継リクエスト| D(Azure)
B -->|中継リクエスト| E(その他のダウンストリームチャンネル) B -->|中継リクエスト| E(その他のダウンストリームチャンネル)
@ -268,7 +268,7 @@ graph LR
![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png) ![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png)
## FAQ ## FAQ
1. ノルマとは何か?どのように計算されますか?One API にはノルマ計算の問題はありますか? 1. ノルマとは何か?どのように計算されますか?Fly API にはノルマ計算の問題はありますか?
+ ノルマ = グループ倍率 * モデル倍率 * (プロンプトトークンの数 + 完了トークンの数 * 完了倍率) + ノルマ = グループ倍率 * モデル倍率 * (プロンプトトークンの数 + 完了トークンの数 * 完了倍率)
+ 完了倍率は、公式の定義と一致するように、GPT3.5 では 1.33、GPT4 では 2 に固定されています。 + 完了倍率は、公式の定義と一致するように、GPT3.5 では 1.33、GPT4 では 2 に固定されています。
+ ストリームモードでない場合、公式 API は消費したトークンの総数を返す。ただし、プロンプトとコンプリートの消費倍率は異なるので注意してください。 + ストリームモードでない場合、公式 API は消費したトークンの総数を返す。ただし、プロンプトとコンプリートの消費倍率は異なるので注意してください。

View File

@ -4,12 +4,12 @@
<p align="center"> <p align="center">
<a href="https://github.com/songquanpeng/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a> <a href="https://github.com/loks666/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a>
</p> </p>
<div align="center"> <div align="center">
# One API # Fly API
_✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 ✨_ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 ✨_
@ -19,13 +19,13 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
<a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE"> <a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE">
<img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license"> <img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://hub.docker.com/repository/docker/justsong/one-api"> <a href="https://hub.docker.com/repository/docker/justsong/one-api">
<img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull"> <img src="https://img.shields.io/docker/pulls/justsong/one-api?color=brightgreen" alt="docker pull">
</a> </a>
<a href="https://github.com/songquanpeng/one-api/releases/latest"> <a href="https://github.com/loks666/one-api/releases/latest">
<img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release"> <img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release">
</a> </a>
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api"> <a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
@ -34,19 +34,19 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/songquanpeng/one-api#部署">部署教程</a> <a href="https://github.com/loks666/one-api#部署">部署教程</a>
· ·
<a href="https://github.com/songquanpeng/one-api#使用方法">使用方法</a> <a href="https://github.com/loks666/one-api#使用方法">使用方法</a>
· ·
<a href="https://github.com/songquanpeng/one-api/issues">意见反馈</a> <a href="https://github.com/loks666/one-api/issues">意见反馈</a>
· ·
<a href="https://github.com/songquanpeng/one-api#截图展示">截图展示</a> <a href="https://github.com/loks666/one-api#截图展示">截图展示</a>
· ·
<a href="https://openai.justsong.cn/">在线演示</a> <a href="https://openai.justsong.cn/">在线演示</a>
· ·
<a href="https://github.com/songquanpeng/one-api#常见问题">常见问题</a> <a href="https://github.com/loks666/one-api#常见问题">常见问题</a>
· ·
<a href="https://github.com/songquanpeng/one-api#相关项目">相关项目</a> <a href="https://github.com/loks666/one-api#相关项目">相关项目</a>
· ·
<a href="https://iamazing.cn/page/reward">赞赏支持</a> <a href="https://iamazing.cn/page/reward">赞赏支持</a>
</p> </p>
@ -114,7 +114,7 @@ docker run --name one-api -d --restart always -p 3000:3000 -e SQL_DSN="root:1234
数据和日志将会保存在宿主机的 `/home/ubuntu/data/one-api` 目录,请确保该目录存在且具有写入权限,或者更改为合适的目录。 数据和日志将会保存在宿主机的 `/home/ubuntu/data/one-api` 目录,请确保该目录存在且具有写入权限,或者更改为合适的目录。
如果启动失败,请添加 `--privileged=true`,具体参考 https://github.com/songquanpeng/one-api/issues/482 。 如果启动失败,请添加 `--privileged=true`,具体参考 https://github.com/loks666/one-api/issues/482 。
如果上面的镜像无法拉取,可以尝试使用 GitHub 的 Docker 镜像,将上面的 `justsong/one-api` 替换为 `ghcr.io/songquanpeng/one-api` 即可。 如果上面的镜像无法拉取,可以尝试使用 GitHub 的 Docker 镜像,将上面的 `justsong/one-api` 替换为 `ghcr.io/songquanpeng/one-api` 即可。
@ -168,9 +168,9 @@ docker-compose ps
``` ```
### 手动部署 ### 手动部署
1. 从 [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) 下载可执行文件或者从源码编译: 1. 从 [GitHub Releases](https://github.com/loks666/one-api/releases/latest) 下载可执行文件或者从源码编译:
```shell ```shell
git clone https://github.com/songquanpeng/one-api.git git clone https://github.com/loks666/one-api.git
# 构建前端 # 构建前端
cd one-api/web cd one-api/web
@ -204,11 +204,11 @@ docker-compose ps
### 宝塔部署教程 ### 宝塔部署教程
详见 [#175](https://github.com/songquanpeng/one-api/issues/175)。 详见 [#175](https://github.com/loks666/one-api/issues/175)。
如果部署后访问出现空白页面,详见 [#97](https://github.com/songquanpeng/one-api/issues/97)。 如果部署后访问出现空白页面,详见 [#97](https://github.com/loks666/one-api/issues/97)。
### 部署第三方服务配合 One API 使用 ### 部署第三方服务配合 Fly API 使用
> 欢迎 PR 添加更多示例。 > 欢迎 PR 添加更多示例。
#### ChatGPT Next Web #### ChatGPT Next Web
@ -232,7 +232,7 @@ docker run --name chatgpt-web -d -p 3002:3002 -e OPENAI_API_BASE_URL=https://ope
#### QChatGPT - QQ机器人 #### QChatGPT - QQ机器人
项目主页https://github.com/RockChinQ/QChatGPT 项目主页https://github.com/RockChinQ/QChatGPT
根据文档完成部署后,在`config.py`设置配置项`openai_config`的`reverse_proxy`为 One API 后端地址,设置`api_key`为 One API 生成的key并在配置项`completion_api_params`的`model`参数设置为 One API 支持的模型名称。 根据文档完成部署后,在`config.py`设置配置项`openai_config`的`reverse_proxy`为 Fly API 后端地址,设置`api_key`为 Fly API 生成的key并在配置项`completion_api_params`的`model`参数设置为 Fly API 支持的模型名称。
可安装 [Switcher 插件](https://github.com/RockChinQ/Switcher)在运行时切换所使用的模型。 可安装 [Switcher 插件](https://github.com/RockChinQ/Switcher)在运行时切换所使用的模型。
@ -266,7 +266,7 @@ docker run --name chatgpt-web -d -p 3002:3002 -e OPENAI_API_BASE_URL=https://ope
6. Deploy 会自动开始,先取消。进入下方 Variable添加一个 `PORT`,值为 `3000`,再添加一个 `SQL_DSN`,值为 `<username>:<password>@tcp(<addr>:<port>)/one-api` ,然后保存。 注意如果不填写 `SQL_DSN`,数据将无法持久化,重新部署后数据会丢失。 6. Deploy 会自动开始,先取消。进入下方 Variable添加一个 `PORT`,值为 `3000`,再添加一个 `SQL_DSN`,值为 `<username>:<password>@tcp(<addr>:<port>)/one-api` ,然后保存。 注意如果不填写 `SQL_DSN`,数据将无法持久化,重新部署后数据会丢失。
7. 选择 Redeploy。 7. 选择 Redeploy。
8. 进入下方 Domains选择一个合适的域名前缀如 "my-one-api",最终域名为 "my-one-api.zeabur.app",也可以 CNAME 自己的域名。 8. 进入下方 Domains选择一个合适的域名前缀如 "my-one-api",最终域名为 "my-one-api.zeabur.app",也可以 CNAME 自己的域名。
9. 等待部署完成,点击生成的域名进入 One API。 9. 等待部署完成,点击生成的域名进入 Fly API。
</div> </div>
</details> </details>
@ -294,9 +294,9 @@ Render 可以直接部署 docker 镜像,不需要 fork 仓库https://dashbo
## 使用方法 ## 使用方法
在`渠道`页面中添加你的 API Key之后在`令牌`页面中新增访问令牌。 在`渠道`页面中添加你的 API Key之后在`令牌`页面中新增访问令牌。
之后就可以使用你的令牌访问 One API 了,使用方式与 [OpenAI API](https://platform.openai.com/docs/api-reference/introduction) 一致。 之后就可以使用你的令牌访问 Fly API 了,使用方式与 [OpenAI API](https://platform.openai.com/docs/api-reference/introduction) 一致。
你需要在各种用到 OpenAI API 的地方设置 API Base 为你的 One API 的部署地址,例如:`https://openai.justsong.cn`API Key 则为你在 One API 中生成的令牌。 你需要在各种用到 OpenAI API 的地方设置 API Base 为你的 Fly API 的部署地址,例如:`https://openai.justsong.cn`API Key 则为你在 Fly API 中生成的令牌。
注意,具体的 API Base 的格式取决于你所使用的客户端。 注意,具体的 API Base 的格式取决于你所使用的客户端。
@ -309,7 +309,7 @@ OPENAI_API_BASE="https://<HOST>:<PORT>/v1"
```mermaid ```mermaid
graph LR graph LR
A(用户) A(用户)
A --->|使用 One API 分发的 key 进行请求| B(One API) A --->|使用 Fly API 分发的 key 进行请求| B(Fly API)
B -->|中继请求| C(OpenAI) B -->|中继请求| C(OpenAI)
B -->|中继请求| D(Azure) B -->|中继请求| D(Azure)
B -->|中继请求| E(其他 OpenAI API 格式下游渠道) B -->|中继请求| E(其他 OpenAI API 格式下游渠道)
@ -385,11 +385,11 @@ https://openai.justsong.cn
![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png) ![token](https://user-images.githubusercontent.com/39998050/233837971-dab488b7-6d96-43af-b640-a168e8d1c9bf.png)
## 常见问题 ## 常见问题
1. 额度是什么?怎么计算的?One API 的额度计算有问题? 1. 额度是什么?怎么计算的?Fly API 的额度计算有问题?
+ 额度 = 分组倍率 * 模型倍率 * (提示 token 数 + 补全 token 数 * 补全倍率) + 额度 = 分组倍率 * 模型倍率 * (提示 token 数 + 补全 token 数 * 补全倍率)
+ 其中补全倍率对于 GPT3.5 固定为 1.33GPT4 为 2与官方保持一致。 + 其中补全倍率对于 GPT3.5 固定为 1.33GPT4 为 2与官方保持一致。
+ 如果是非流模式,官方接口会返回消耗的总 token但是你要注意提示和补全的消耗倍率不一样。 + 如果是非流模式,官方接口会返回消耗的总 token但是你要注意提示和补全的消耗倍率不一样。
+ 注意,One API 的默认倍率就是官方倍率,是已经调整过的。 + 注意,Fly API 的默认倍率就是官方倍率,是已经调整过的。
2. 账户额度足够为什么提示额度不足? 2. 账户额度足够为什么提示额度不足?
+ 请检查你的令牌额度是否足够,这个和账户额度是分开的。 + 请检查你的令牌额度是否足够,这个和账户额度是分开的。
+ 令牌额度仅供用户设置最大使用量,用户可自由设置。 + 令牌额度仅供用户设置最大使用量,用户可自由设置。

View File

@ -11,7 +11,7 @@ import (
var StartTime = time.Now().Unix() // unit: second var StartTime = time.Now().Unix() // unit: second
var Version = "v0.0.0" // this hard coding will be replaced automatically when building, no need to manually change var Version = "v0.0.0" // this hard coding will be replaced automatically when building, no need to manually change
var SystemName = "One API" var SystemName = "Fly API"
var ServerAddress = "http://localhost:3000" var ServerAddress = "http://localhost:3000"
var Footer = "" var Footer = ""
var Logo = "" var Logo = ""

View File

@ -16,9 +16,9 @@ var (
) )
func printHelp() { func printHelp() {
fmt.Println("One API " + Version + " - All in one API service for OpenAI API.") fmt.Println("Fly API " + Version + " - All in Fly API service for OpenAI API.")
fmt.Println("Copyright (C) 2023 JustSong. All rights reserved.") fmt.Println("Copyright (C) 2023 JustSong. All rights reserved.")
fmt.Println("GitHub: https://github.com/songquanpeng/one-api") fmt.Println("GitHub: https://github.com/loks666/one-api")
fmt.Println("Usage: one-api [--port <port>] [--log-dir <log directory>] [--version] [--help]") fmt.Println("Usage: one-api [--port <port>] [--log-dir <log directory>] [--version] [--help]")
} }

View File

@ -14,7 +14,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
// https://github.com/songquanpeng/one-api/issues/79 // https://github.com/loks666/one-api/issues/79
type OpenAISubscriptionResponse struct { type OpenAISubscriptionResponse struct {
Object string `json:"object"` Object string `json:"object"`

View File

@ -139,7 +139,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
task := strings.TrimPrefix(requestURL, "/v1/") task := strings.TrimPrefix(requestURL, "/v1/")
model_ := textRequest.Model model_ := textRequest.Model
model_ = strings.Replace(model_, ".", "", -1) model_ = strings.Replace(model_, ".", "", -1)
// https://github.com/songquanpeng/one-api/issues/67 // https://github.com/loks666/one-api/issues/67
model_ = strings.TrimSuffix(model_, "-0301") model_ = strings.TrimSuffix(model_, "-0301")
model_ = strings.TrimSuffix(model_, "-0314") model_ = strings.TrimSuffix(model_, "-0314")
model_ = strings.TrimSuffix(model_, "-0613") model_ = strings.TrimSuffix(model_, "-0613")
@ -368,8 +368,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
} else { } else {
req.Header.Set("Authorization", c.Request.Header.Get("Authorization")) req.Header.Set("Authorization", c.Request.Header.Get("Authorization"))
if channelType == common.ChannelTypeOpenRouter { if channelType == common.ChannelTypeOpenRouter {
req.Header.Set("HTTP-Referer", "https://github.com/songquanpeng/one-api") req.Header.Set("HTTP-Referer", "https://github.com/loks666/one-api")
req.Header.Set("X-Title", "One API") req.Header.Set("X-Title", "Fly API")
} }
} }
case APITypeClaude: case APITypeClaude:

View File

@ -244,7 +244,7 @@
"保存首页内容": "Save Home Page Content", "保存首页内容": "Save Home Page Content",
"在此输入新的关于内容,支持 Markdown & HTML 代码。如果输入的是一个链接,则会使用该链接作为 iframe 的 src 属性,这允许你设置任意网页作为关于页面": "Enter new about content here, supports Markdown & HTML code. If a link is entered, it will be used as the src attribute of the iframe, allowing you to set any webpage as the about page.", "在此输入新的关于内容,支持 Markdown & HTML 代码。如果输入的是一个链接,则会使用该链接作为 iframe 的 src 属性,这允许你设置任意网页作为关于页面": "Enter new about content here, supports Markdown & HTML code. If a link is entered, it will be used as the src attribute of the iframe, allowing you to set any webpage as the about page.",
"保存关于": "Save About", "保存关于": "Save About",
"移除 One API 的版权标识必须首先获得授权,项目维护需要花费大量精力,如果本项目对你有意义,请主动支持本项目": "Removal of One API copyright mark must first be authorized. Project maintenance requires a lot of effort. If this project is meaningful to you, please actively support it.", "移除 Fly API 的版权标识必须首先获得授权,项目维护需要花费大量精力,如果本项目对你有意义,请主动支持本项目": "Removal of Fly API copyright mark must first be authorized. Project maintenance requires a lot of effort. If this project is meaningful to you, please actively support it.",
"页脚": "Footer", "页脚": "Footer",
"在此输入新的页脚,留空则使用默认页脚,支持 HTML 代码": "Enter the new footer here, leave blank to use the default footer, supports HTML code.", "在此输入新的页脚,留空则使用默认页脚,支持 HTML 代码": "Enter the new footer here, leave blank to use the default footer, supports HTML code.",
"设置页脚": "Set Footer", "设置页脚": "Set Footer",
@ -507,7 +507,7 @@
"请输入显示名称": "Please enter display name", "请输入显示名称": "Please enter display name",
"请输入密码": "Please enter password", "请输入密码": "Please enter password",
"模型部署名称必须和模型名称保持一致": "The model deployment name must be consistent with the model name", "模型部署名称必须和模型名称保持一致": "The model deployment name must be consistent with the model name",
",因为 One API 会把请求体中的 model": ", because One API will take the model in the request body", ",因为 Fly API 会把请求体中的 model": ", because Fly API will take the model in the request body",
"请输入 AZURE_OPENAI_ENDPOINT": "Please enter AZURE_OPENAI_ENDPOINT", "请输入 AZURE_OPENAI_ENDPOINT": "Please enter AZURE_OPENAI_ENDPOINT",
"请输入自定义渠道的 Base URL": "Please enter the Base URL of the custom channel", "请输入自定义渠道的 Base URL": "Please enter the Base URL of the custom channel",
"Homepage URL 填": "Fill in the Homepage URL", "Homepage URL 填": "Fill in the Homepage URL",

View File

@ -14,7 +14,7 @@ func RelayPanicRecover() gin.HandlerFunc {
common.SysError(fmt.Sprintf("panic detected: %v", err)) common.SysError(fmt.Sprintf("panic detected: %v", err))
c.JSON(http.StatusInternalServerError, gin.H{ c.JSON(http.StatusInternalServerError, gin.H{
"error": gin.H{ "error": gin.H{
"message": fmt.Sprintf("Panic detected, error: %v. Please submit a issue here: https://github.com/songquanpeng/one-api", err), "message": fmt.Sprintf("Panic detected, error: %v. Please submit a issue here: https://github.com/loks666/one-api", err),
"type": "one_api_panic", "type": "one_api_panic",
}, },
}) })

View File

@ -4,7 +4,7 @@
# sudo systemctl enable one-api # sudo systemctl enable one-api
# sudo systemctl status one-api # sudo systemctl status one-api
[Unit] [Unit]
Description=One API Service Description=Fly API Service
After=network.target After=network.target
[Service] [Service]

View File

@ -9,7 +9,7 @@
name="description" name="description"
content="OpenAI 接口聚合管理,支持多种渠道包括 Azure可用于二次分发管理 key仅单可执行文件已打包好 Docker 镜像,一键部署,开箱即用" content="OpenAI 接口聚合管理,支持多种渠道包括 Azure可用于二次分发管理 key仅单可执行文件已打包好 Docker 镜像,一键部署,开箱即用"
/> />
<title>One API</title> <title>Fly API</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

View File

@ -37,20 +37,6 @@ const Footer = () => {
></div> ></div>
) : ( ) : (
<div className='custom-footer'> <div className='custom-footer'>
<a
href='https://github.com/songquanpeng/one-api'
target='_blank'
>
{systemName} {process.env.REACT_APP_VERSION}{' '}
</a>
{' '}
<a href='https://github.com/songquanpeng' target='_blank'>
JustSong
</a>{' '}
构建源代码遵循{' '}
<a href='https://opensource.org/licenses/mit-license.php'>
MIT 协议
</a>
</div> </div>
)} )}
</Container> </Container>

View File

@ -84,7 +84,7 @@ const OtherSetting = () => {
const openGitHubRelease = () => { const openGitHubRelease = () => {
window.location = window.location =
'https://github.com/songquanpeng/one-api/releases/latest'; 'https://github.com/loks666/one-api/releases/latest';
}; };
const checkUpdate = async () => { const checkUpdate = async () => {
@ -165,7 +165,7 @@ const OtherSetting = () => {
/> />
</Form.Group> </Form.Group>
<Form.Button onClick={submitAbout}>保存关于</Form.Button> <Form.Button onClick={submitAbout}>保存关于</Form.Button>
<Message>移除 One API 的版权标识必须首先获得授权项目维护需要花费大量精力如果本项目对你有意义请主动支持本项目</Message> <Message>移除 Fly API 的版权标识必须首先获得授权项目维护需要花费大量精力如果本项目对你有意义请主动支持本项目</Message>
<Form.Group widths='equal'> <Form.Group widths='equal'>
<Form.Input <Form.Input
label='页脚' label='页脚'

View File

@ -22,7 +22,7 @@ export function isRoot() {
export function getSystemName() { export function getSystemName() {
let system_name = localStorage.getItem('system_name'); let system_name = localStorage.getItem('system_name');
if (!system_name) return 'One API'; if (!system_name) return 'Fly API';
return system_name; return system_name;
} }

View File

@ -37,8 +37,8 @@ const About = () => {
<Header as='h3'>关于</Header> <Header as='h3'>关于</Header>
<p>可在设置页面设置关于内容支持 HTML & Markdown</p> <p>可在设置页面设置关于内容支持 HTML & Markdown</p>
项目仓库地址 项目仓库地址
<a href='https://github.com/songquanpeng/one-api'> <a href='https://github.com/loks666/one-api'>
https://github.com/songquanpeng/one-api https://github.com/loks666/one-api
</a> </a>
</Segment> </Segment>
</> : <> </> : <>

View File

@ -249,9 +249,9 @@ const EditChannel = () => {
inputs.type === 3 && ( inputs.type === 3 && (
<> <>
<Message> <Message>
注意<strong>模型部署名称必须和模型名称保持一致</strong> One API model 注意<strong>模型部署名称必须和模型名称保持一致</strong> Fly API model
参数替换为你的部署名称模型名称中的点会被剔除<a target='_blank' 参数替换为你的部署名称模型名称中的点会被剔除<a target='_blank'
href='https://github.com/songquanpeng/one-api/issues/133?notification_referrer_id=NT_kwDOAmJSYrM2NjIwMzI3NDgyOjM5OTk4MDUw#issuecomment-1571602271'>图片演示</a> href='https://github.com/loks666/one-api/issues/133?notification_referrer_id=NT_kwDOAmJSYrM2NjIwMzI3NDgyOjM5OTk4MDUw#issuecomment-1571602271'>图片演示</a>
</Message> </Message>
<Form.Field> <Form.Field>
<Form.Input <Form.Input

View File

@ -65,16 +65,8 @@ const Home = () => {
<Card.Meta>系统信息总览</Card.Meta> <Card.Meta>系统信息总览</Card.Meta>
<Card.Description> <Card.Description>
<p>名称{statusState?.status?.system_name}</p> <p>名称{statusState?.status?.system_name}</p>
<p>版本{statusState?.status?.version ? statusState?.status?.version : "unknown"}</p> <p>版本{statusState?.status?.version ? statusState?.status?.version : 'unknown'}</p>
<p> <p>作者loks666 from songquanpeng</p>
源码
<a
href='https://github.com/songquanpeng/one-api'
target='_blank'
>
https://github.com/songquanpeng/one-api
</a>
</p>
<p>启动时间{getStartTimeString()}</p> <p>启动时间{getStartTimeString()}</p>
</Card.Description> </Card.Description>
</Card.Content> </Card.Content>