-
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
1 changed file
with
66 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,67 @@ | ||
# free-one-api | ||
Turn reverse engineering LLM lib to standard OpenAI GPT API. | ||
|
||
Turn reverse engineered LLM lib to standard OpenAI GPT API. | ||
By using free-one-api, you can easily convert reverse engineered LLM libs (e.g. [acheong08/ChatGPT](https://github.com/acheong08/ChatGPT) ) to standard OpenAI GPT API. | ||
So other application supports OpenAI GPT API can use reverse engineered LLM libs directly. | ||
|
||
## Features | ||
|
||
- Automatically load balance. | ||
- Web UI. | ||
- Stream mode supported. | ||
|
||
### Supported LLM libs | ||
|
||
- [acheong08/ChatGPT](https://github.com/acheong08/ChatGPT) | ||
|
||
## Setup | ||
|
||
### Docker (Recommended) | ||
|
||
```bash | ||
docker run -d -p 3000:3000 --name free-one-api rockchin/free-one-api -v ./data:/app/data | ||
``` | ||
|
||
then you can open the admin page at `http://localhost:3000/`. | ||
|
||
### Manual | ||
|
||
```bash | ||
git clone https://github.com/RockChinQ/free-one-api.git | ||
cd free-one-api | ||
|
||
cd web && npm install && npm run build && cd .. | ||
|
||
pip install -r requirements.txt | ||
python main.py | ||
``` | ||
|
||
then you can open the admin page at `http://localhost:3000/`. | ||
|
||
## Usage | ||
|
||
Create channel on the admin page, create a new key. | ||
Set the url (e.g. http://localhost:3000/v1 ) as OpenAI endpoint, and set the generated key as OpenAI api key. | ||
Then you can use the OpenAI API to access the reverse engineered LLM lib. | ||
|
||
```curl | ||
# curl example | ||
curl http://localhost:3000/v1/chat/completions \ | ||
-X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $OPENAI_API_KEY" \ | ||
-d '{ | ||
"model": "gpt-3.5-turbo", | ||
"messages": [ | ||
{ | ||
"role": "system", | ||
"content": "You are a helpful assistant." | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "Hello!" | ||
} | ||
], | ||
"stream": true | ||
}' | ||
``` |