remove name
This commit is contained in:
parent
c7a8aa5965
commit
0f4cb2d0bd
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -2,7 +2,7 @@ blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 项目群聊
|
||||
url: https://openai.justsong.cn/
|
||||
about: QQ 群:828520184,自动审核,备注 One API
|
||||
about: QQ 群:828520184,自动审核,备注 Fly API
|
||||
- name: 赞赏支持
|
||||
url: https://iamazing.cn/page/reward
|
||||
about: 请作者喝杯咖啡,以激励作者持续开发
|
||||
|
28
README.en.md
28
README.en.md
@ -3,12 +3,12 @@
|
||||
</p>
|
||||
|
||||
<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>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# One API
|
||||
# Fly API
|
||||
|
||||
_✨ 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">
|
||||
<img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license">
|
||||
</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">
|
||||
</a>
|
||||
<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">
|
||||
</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">
|
||||
</a>
|
||||
<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="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>
|
||||
·
|
||||
@ -129,9 +129,9 @@ sudo service nginx restart
|
||||
The initial account username is `root` and password is `123456`.
|
||||
|
||||
### 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
|
||||
git clone https://github.com/songquanpeng/one-api.git
|
||||
git clone https://github.com/loks666/one-api.git
|
||||
|
||||
# Build the frontend
|
||||
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.
|
||||
|
||||
### 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
|
||||
<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.
|
||||
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.
|
||||
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>
|
||||
</details>
|
||||
@ -214,16 +214,16 @@ After the system starts, log in as the `root` user to further configure the syst
|
||||
## Usage
|
||||
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.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A(User)
|
||||
A --->|Request| B(One API)
|
||||
A --->|Request| B(Fly API)
|
||||
B -->|Relay Request| C(OpenAI)
|
||||
B -->|Relay Request| D(Azure)
|
||||
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
|
||||

|
||||
|
||||
## 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)
|
||||
+ 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.
|
||||
|
28
README.ja.md
28
README.ja.md
@ -3,12 +3,12 @@
|
||||
</p>
|
||||
|
||||
<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>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# One API
|
||||
# Fly API
|
||||
|
||||
_✨ 標準的な OpenAI API フォーマットを通じてすべての LLM にアクセスでき、導入と利用が容易です ✨_
|
||||
|
||||
@ -18,13 +18,13 @@ _✨ 標準的な OpenAI API フォーマットを通じてすべての LLM に
|
||||
<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">
|
||||
</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">
|
||||
</a>
|
||||
<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">
|
||||
</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">
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
|
||||
@ -37,7 +37,7 @@ _✨ 標準的な OpenAI API フォーマットを通じてすべての LLM に
|
||||
·
|
||||
<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>
|
||||
·
|
||||
@ -130,9 +130,9 @@ sudo service nginx restart
|
||||
初期アカウントのユーザー名は `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
|
||||
git clone https://github.com/songquanpeng/one-api.git
|
||||
git clone https://github.com/loks666/one-api.git
|
||||
|
||||
# フロントエンドのビルド
|
||||
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.
|
||||
|
||||
### コントロールパネル(例: 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>
|
||||
@ -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` が設定されていないと、データが永続化されず、再デプロイ後にデータが失われるので注意すること。
|
||||
7. 再デプロイを選択します。
|
||||
8. Domains タブで、"my-one-api" のような適切なドメイン名の接頭辞を選択する。最終的なドメイン名は "my-one-api.zeabur.app" となります。独自のドメイン名を CNAME することもできます。
|
||||
9. デプロイが完了するのを待ち、生成されたドメイン名をクリックして One API にアクセスします。
|
||||
9. デプロイが完了するのを待ち、生成されたドメイン名をクリックして Fly API にアクセスします。
|
||||
|
||||
</div>
|
||||
</details>
|
||||
@ -215,16 +215,16 @@ Please refer to the [environment variables](#environment-variables) section for
|
||||
## 使用方法
|
||||
`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 のフォーマットは、使用しているクライアントに依存することに注意してください。
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A(ユーザ)
|
||||
A --->|リクエスト| B(One API)
|
||||
A --->|リクエスト| B(Fly API)
|
||||
B -->|中継リクエスト| C(OpenAI)
|
||||
B -->|中継リクエスト| D(Azure)
|
||||
B -->|中継リクエスト| E(その他のダウンストリームチャンネル)
|
||||
@ -268,7 +268,7 @@ graph LR
|
||||

|
||||
|
||||
## FAQ
|
||||
1. ノルマとは何か?どのように計算されますか?One API にはノルマ計算の問題はありますか?
|
||||
1. ノルマとは何か?どのように計算されますか?Fly API にはノルマ計算の問題はありますか?
|
||||
+ ノルマ = グループ倍率 * モデル倍率 * (プロンプトトークンの数 + 完了トークンの数 * 完了倍率)
|
||||
+ 完了倍率は、公式の定義と一致するように、GPT3.5 では 1.33、GPT4 では 2 に固定されています。
|
||||
+ ストリームモードでない場合、公式 API は消費したトークンの総数を返す。ただし、プロンプトとコンプリートの消費倍率は異なるので注意してください。
|
||||
|
46
README.md
46
README.md
@ -4,12 +4,12 @@
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# One API
|
||||
# Fly API
|
||||
|
||||
_✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 ✨_
|
||||
|
||||
@ -19,13 +19,13 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
|
||||
<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">
|
||||
</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">
|
||||
</a>
|
||||
<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">
|
||||
</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">
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
|
||||
@ -34,19 +34,19 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
|
||||
</p>
|
||||
|
||||
<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://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>
|
||||
</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` 目录,请确保该目录存在且具有写入权限,或者更改为合适的目录。
|
||||
|
||||
如果启动失败,请添加 `--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` 即可。
|
||||
|
||||
@ -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
|
||||
git clone https://github.com/songquanpeng/one-api.git
|
||||
git clone https://github.com/loks666/one-api.git
|
||||
|
||||
# 构建前端
|
||||
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 添加更多示例。
|
||||
|
||||
#### 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机器人
|
||||
项目主页: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)在运行时切换所使用的模型。
|
||||
|
||||
@ -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`,数据将无法持久化,重新部署后数据会丢失。
|
||||
7. 选择 Redeploy。
|
||||
8. 进入下方 Domains,选择一个合适的域名前缀,如 "my-one-api",最终域名为 "my-one-api.zeabur.app",也可以 CNAME 自己的域名。
|
||||
9. 等待部署完成,点击生成的域名进入 One API。
|
||||
9. 等待部署完成,点击生成的域名进入 Fly API。
|
||||
|
||||
</div>
|
||||
</details>
|
||||
@ -294,9 +294,9 @@ Render 可以直接部署 docker 镜像,不需要 fork 仓库:https://dashbo
|
||||
## 使用方法
|
||||
在`渠道`页面中添加你的 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 的格式取决于你所使用的客户端。
|
||||
|
||||
@ -309,7 +309,7 @@ OPENAI_API_BASE="https://<HOST>:<PORT>/v1"
|
||||
```mermaid
|
||||
graph LR
|
||||
A(用户)
|
||||
A --->|使用 One API 分发的 key 进行请求| B(One API)
|
||||
A --->|使用 Fly API 分发的 key 进行请求| B(Fly API)
|
||||
B -->|中继请求| C(OpenAI)
|
||||
B -->|中继请求| D(Azure)
|
||||
B -->|中继请求| E(其他 OpenAI API 格式下游渠道)
|
||||
@ -385,11 +385,11 @@ https://openai.justsong.cn
|
||||

|
||||
|
||||
## 常见问题
|
||||
1. 额度是什么?怎么计算的?One API 的额度计算有问题?
|
||||
1. 额度是什么?怎么计算的?Fly API 的额度计算有问题?
|
||||
+ 额度 = 分组倍率 * 模型倍率 * (提示 token 数 + 补全 token 数 * 补全倍率)
|
||||
+ 其中补全倍率对于 GPT3.5 固定为 1.33,GPT4 为 2,与官方保持一致。
|
||||
+ 如果是非流模式,官方接口会返回消耗的总 token,但是你要注意提示和补全的消耗倍率不一样。
|
||||
+ 注意,One API 的默认倍率就是官方倍率,是已经调整过的。
|
||||
+ 注意,Fly API 的默认倍率就是官方倍率,是已经调整过的。
|
||||
2. 账户额度足够为什么提示额度不足?
|
||||
+ 请检查你的令牌额度是否足够,这个和账户额度是分开的。
|
||||
+ 令牌额度仅供用户设置最大使用量,用户可自由设置。
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
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 SystemName = "One API"
|
||||
var SystemName = "Fly API"
|
||||
var ServerAddress = "http://localhost:3000"
|
||||
var Footer = ""
|
||||
var Logo = ""
|
||||
|
@ -16,9 +16,9 @@ var (
|
||||
)
|
||||
|
||||
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("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]")
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// https://github.com/songquanpeng/one-api/issues/79
|
||||
// https://github.com/loks666/one-api/issues/79
|
||||
|
||||
type OpenAISubscriptionResponse struct {
|
||||
Object string `json:"object"`
|
||||
|
@ -139,7 +139,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
task := strings.TrimPrefix(requestURL, "/v1/")
|
||||
model_ := textRequest.Model
|
||||
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_, "-0314")
|
||||
model_ = strings.TrimSuffix(model_, "-0613")
|
||||
@ -368,8 +368,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
} else {
|
||||
req.Header.Set("Authorization", c.Request.Header.Get("Authorization"))
|
||||
if channelType == common.ChannelTypeOpenRouter {
|
||||
req.Header.Set("HTTP-Referer", "https://github.com/songquanpeng/one-api")
|
||||
req.Header.Set("X-Title", "One API")
|
||||
req.Header.Set("HTTP-Referer", "https://github.com/loks666/one-api")
|
||||
req.Header.Set("X-Title", "Fly API")
|
||||
}
|
||||
}
|
||||
case APITypeClaude:
|
||||
|
@ -244,7 +244,7 @@
|
||||
"保存首页内容": "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.",
|
||||
"保存关于": "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",
|
||||
"在此输入新的页脚,留空则使用默认页脚,支持 HTML 代码": "Enter the new footer here, leave blank to use the default footer, supports HTML code.",
|
||||
"设置页脚": "Set Footer",
|
||||
@ -507,7 +507,7 @@
|
||||
"请输入显示名称": "Please enter display name",
|
||||
"请输入密码": "Please enter password",
|
||||
"模型部署名称必须和模型名称保持一致": "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",
|
||||
"请输入自定义渠道的 Base URL": "Please enter the Base URL of the custom channel",
|
||||
"Homepage URL 填": "Fill in the Homepage URL",
|
||||
|
@ -14,7 +14,7 @@ func RelayPanicRecover() gin.HandlerFunc {
|
||||
common.SysError(fmt.Sprintf("panic detected: %v", err))
|
||||
c.JSON(http.StatusInternalServerError, 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",
|
||||
},
|
||||
})
|
||||
|
@ -4,7 +4,7 @@
|
||||
# sudo systemctl enable one-api
|
||||
# sudo systemctl status one-api
|
||||
[Unit]
|
||||
Description=One API Service
|
||||
Description=Fly API Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
|
@ -9,7 +9,7 @@
|
||||
name="description"
|
||||
content="OpenAI 接口聚合管理,支持多种渠道包括 Azure,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用"
|
||||
/>
|
||||
<title>One API</title>
|
||||
<title>Fly API</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
@ -37,20 +37,6 @@ const Footer = () => {
|
||||
></div>
|
||||
) : (
|
||||
<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>
|
||||
)}
|
||||
</Container>
|
||||
|
@ -84,7 +84,7 @@ const OtherSetting = () => {
|
||||
|
||||
const openGitHubRelease = () => {
|
||||
window.location =
|
||||
'https://github.com/songquanpeng/one-api/releases/latest';
|
||||
'https://github.com/loks666/one-api/releases/latest';
|
||||
};
|
||||
|
||||
const checkUpdate = async () => {
|
||||
@ -165,7 +165,7 @@ const OtherSetting = () => {
|
||||
/>
|
||||
</Form.Group>
|
||||
<Form.Button onClick={submitAbout}>保存关于</Form.Button>
|
||||
<Message>移除 One API 的版权标识必须首先获得授权,项目维护需要花费大量精力,如果本项目对你有意义,请主动支持本项目。</Message>
|
||||
<Message>移除 Fly API 的版权标识必须首先获得授权,项目维护需要花费大量精力,如果本项目对你有意义,请主动支持本项目。</Message>
|
||||
<Form.Group widths='equal'>
|
||||
<Form.Input
|
||||
label='页脚'
|
||||
|
@ -22,7 +22,7 @@ export function isRoot() {
|
||||
|
||||
export function getSystemName() {
|
||||
let system_name = localStorage.getItem('system_name');
|
||||
if (!system_name) return 'One API';
|
||||
if (!system_name) return 'Fly API';
|
||||
return system_name;
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ const About = () => {
|
||||
<Header as='h3'>关于</Header>
|
||||
<p>可在设置页面设置关于内容,支持 HTML & Markdown</p>
|
||||
项目仓库地址:
|
||||
<a href='https://github.com/songquanpeng/one-api'>
|
||||
https://github.com/songquanpeng/one-api
|
||||
<a href='https://github.com/loks666/one-api'>
|
||||
https://github.com/loks666/one-api
|
||||
</a>
|
||||
</Segment>
|
||||
</> : <>
|
||||
|
@ -249,9 +249,9 @@ const EditChannel = () => {
|
||||
inputs.type === 3 && (
|
||||
<>
|
||||
<Message>
|
||||
注意,<strong>模型部署名称必须和模型名称保持一致</strong>,因为 One API 会把请求体中的 model
|
||||
注意,<strong>模型部署名称必须和模型名称保持一致</strong>,因为 Fly API 会把请求体中的 model
|
||||
参数替换为你的部署名称(模型名称中的点会被剔除),<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>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
|
@ -65,16 +65,8 @@ const Home = () => {
|
||||
<Card.Meta>系统信息总览</Card.Meta>
|
||||
<Card.Description>
|
||||
<p>名称:{statusState?.status?.system_name}</p>
|
||||
<p>版本:{statusState?.status?.version ? statusState?.status?.version : "unknown"}</p>
|
||||
<p>
|
||||
源码:
|
||||
<a
|
||||
href='https://github.com/songquanpeng/one-api'
|
||||
target='_blank'
|
||||
>
|
||||
https://github.com/songquanpeng/one-api
|
||||
</a>
|
||||
</p>
|
||||
<p>版本:{statusState?.status?.version ? statusState?.status?.version : 'unknown'}</p>
|
||||
<p>作者:loks666 from songquanpeng</p>
|
||||
<p>启动时间:{getStartTimeString()}</p>
|
||||
</Card.Description>
|
||||
</Card.Content>
|
||||
|
Loading…
Reference in New Issue
Block a user