-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
291 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Adapters | ||
|
||
Free One API currently supports multiple LLM reverse engineering libraries, each channel supports a corresponding adapter, the adapter is responsible for converting the client's request into a reverse engineering library request, and converting the reverse engineering library's response into the client's response. | ||
|
||
## acheong08/ChatGPT | ||
|
||
ChatGPT official website reverse engineering library | ||
|
||
### Configuration | ||
|
||
1. Select `acheong08/ChatGPT` as `Adapter` | ||
|
||
![select adapter](assets/select_adapter.png) | ||
|
||
2. Go to `chat.openai.com` and log in to your account | ||
|
||
3. Access `https://chat.openai.com/api/auth/session` directly in the browser, copy the `access_token` obtained | ||
|
||
![Alt text](assets/get_actoken.png) | ||
|
||
4. Enter in the `Config` column | ||
|
||
```json | ||
{ | ||
"access_token": "your access token" | ||
} | ||
``` | ||
|
||
5. Save to test | ||
|
||
### Reverse proxy | ||
|
||
ChatGPT needs to use a reverse proxy to bypass Cloudflare's restrictions. The Free One API project defaults to the proxy address provided by the developer `https://chatproxy.rockchin.top/api/`, but the pressure is very high. It is strongly recommended to build a reverse proxy by yourself. | ||
|
||
* Please configure according to this project document: <https://github.com/acheong08/ChatGPT-Proxy-V4> | ||
|
||
Edit `misc.chatgpt_api_base` to your reverse proxy address in `data/config.yaml`. | ||
You can also enter directly in the `Config` column when creating the `acheong08/ChatGPT` adapter | ||
|
||
```json | ||
{ | ||
"reverse_proxy": "your reverse proxy address" | ||
} | ||
``` | ||
|
||
If not set, the `misc.chatgpt_api_base` field in the configuration file will be used as the reverse proxy address. | ||
|
||
## KoushikNavuluri/Claude-API | ||
|
||
Anthropic Claude official website reverse engineering library | ||
|
||
### Configuration | ||
|
||
1. Select `KoushikNavuluri/Claude-API` as `Adapter` | ||
|
||
2. Log in to `claude.ai`, open `F12`, select the `Network` column, find any request, and copy the `Cookie` string in the request header | ||
|
||
![claude_get_cookie](assets/claude_cookie.png) | ||
|
||
3. Enter in the `Config` column | ||
|
||
```json | ||
{ | ||
"cookie": "your cookie" | ||
} | ||
``` | ||
|
||
## xtekky/gpt4free | ||
|
||
xtekky/gpt4free integrates multiple LLM reverse engineering libraries of multiple platforms | ||
|
||
### Configuration | ||
|
||
1. Select `xtekky/gpt4free` as `Adapter` | ||
|
||
2. No authentication required, just save | ||
|
||
## Soulter/hugging-chat-api | ||
|
||
huggingface.co/chat official website reverse engineering library | ||
|
||
### Configuration | ||
|
||
1. Register `HuggingFace` account | ||
|
||
2. Select `Soulter/hugging-chat-api` as `Adapter` | ||
|
||
3. Enter in the `Config` column | ||
|
||
```json | ||
{ | ||
"email": "HuggingFace Email", | ||
"passwd": "HuggingFace Password" | ||
} | ||
``` | ||
|
||
## xw5xr6/revTongYi | ||
|
||
Aliyun TongYi QianWen official website reverse engineering library | ||
|
||
### Configuration | ||
|
||
1. Select `xw5xr6/revTongYi` as `Adapter` | ||
|
||
2. Go to <https://qianwen.aliyun.com/> and log in to your account | ||
|
||
3. Refer to the configuration method of Claude above to obtain the `Cookie` string | ||
|
||
4. Enter in the `Config` column | ||
|
||
```json | ||
{ | ||
"cookie": "通义千问cookie" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Configurations | ||
|
||
Configuration file is saved at `data/config.yaml` | ||
|
||
```yaml | ||
database: | ||
# SQLite DB file path | ||
path: ./data/free_one_api.db | ||
type: sqlite | ||
logging: | ||
debug: false # Enable debug log | ||
misc: | ||
# Reverse proxy address for acheong08/ChatGPT adapter. | ||
# Default public reverse proxy may be unstable, it is recommended to build your own: | ||
# https://github.com/acheong08/ChatGPT-Proxy-V4 | ||
chatgpt_api_base: https://chatproxy.rockchin.top/api/ | ||
# Random advertisement, will be appended to the end of each response | ||
random_ad: | ||
# advertisement list | ||
ad_list: | ||
- ' (This response is sponsored by Free One API. Consider star the project on GitHub: | ||
https://github.com/RockChinQ/free-one-api )' | ||
# Enable random ad | ||
enabled: false | ||
# Random ad rate | ||
rate: 0.05 | ||
router: | ||
# Backend listen port | ||
port: 3000 | ||
# Admin page login password | ||
token: '12345678' | ||
watchdog: | ||
heartbeat: | ||
# Max fail times | ||
fail_limit: 3 | ||
# Heartbeat check interval (seconds) | ||
interval: 1800 | ||
# Single channel heartbeat check timeout (seconds) | ||
timeout: 300 | ||
web: | ||
# Frontend page path | ||
frontend_path: ./web/dist/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# Quick Test | ||
|
||
## Demo | ||
|
||
Allow to login and modify the channel/apikey settings.Reset every 30 minutes(xx:00/xx:30). | ||
|
||
Address: https://foa-demo.rockchin.top | ||
Password: 12345678 | ||
|
||
## Test channel | ||
|
||
Can only use the channel, can't login: | ||
|
||
api_base: https://foa.rockchin.top/v1 | ||
api_key: sk-foaDfZxzvfrwfqkBDJEMq7C0rdXkhOjXx4aM23pH42tv8SJ4 | ||
model: gpt-3.5-turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# Free One API Documentation | ||
|
||
WIP | ||
## Supported LLM libs | ||
|
||
|Adapter|Multi Round|Stream|Function Call|Status|Comment| | ||
|---|---|---|---|---|---| | ||
|[acheong08/ChatGPT](https://github.com/acheong08/ChatGPT)|✅|✅|❌|✅|ChatGPT Web Version| | ||
|[KoushikNavuluri/Claude-API](https://github.com/KoushikNavuluri/Claude-API)|✅|❌|❌|✅|Claude Web Version| | ||
|[dsdanielpark/Bard-API](https://github.com/dsdanielpark/Bard-API)|✅|❌|❌|✅|Google Bard Web Version| | ||
|[xtekky/gpt4free](https://github.com/xtekky/gpt4free)|✅|✅|❌|✅|gpt4free cracked multiple platforms| | ||
|[Soulter/hugging-chat-api](https://github.com/Soulter/hugging-chat-api)|✅|✅|❌|✅|hubbingface chat model| | ||
|[xw5xr6/revTongYi](https://github.com/xw5xr6/revTongYi)|✅|✅|❌|✅|Aliyun TongYi QianWen Web Version| | ||
|
||
## Supported API paths | ||
|
||
- `/v1/chat/completions` | ||
|
||
File a issue or pull request if you want to add more. | ||
|
||
## Performance | ||
|
||
Gantt chart of request time with 4 channel enabled and 16 threads in client side, querying question "write a quick sort in Java": | ||
(Channel labelled with `Channel ID <id> <request count>`, X axis is time in seconds) | ||
|
||
![Load Balance](assets/load_balance.png) |
Oops, something went wrong.