Skip to content

Commit

Permalink
Enablement of REST API Usage within Google Colab Free Tier (lm-sys#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggcr authored Jan 24, 2024
1 parent 3eea41e commit 7ef41f3
Show file tree
Hide file tree
Showing 3 changed files with 350 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export FASTCHAT_USE_MODELSCOPE=True
### OpenAI-Compatible RESTful APIs & SDK
FastChat provides OpenAI-compatible APIs for its supported models, so you can use FastChat as a local drop-in replacement for OpenAI APIs.
The FastChat server is compatible with both [openai-python](https://github.com/openai/openai-python) library and cURL commands.
The REST API is capable of being executed from Google Colab free tier, as demonstrated in the [FastChat_API_GoogleColab.ipynb](https://github.com/lm-sys/FastChat/blob/main/playground/FastChat_API_GoogleColab.ipynb) notebook, available in our repository.
See [docs/openai_api.md](docs/openai_api.md).

### Hugging Face Generation APIs
Expand Down
2 changes: 2 additions & 0 deletions docs/openai_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The following OpenAI APIs are supported:
- Completions. (Reference: https://platform.openai.com/docs/api-reference/completions)
- Embeddings. (Reference: https://platform.openai.com/docs/api-reference/embeddings)

The REST API can be seamlessly operated from Google Colab, as demonstrated in the [FastChat_API_GoogleColab.ipynb](https://github.com/lm-sys/FastChat/blob/main/playground/FastChat_API_GoogleColab.ipynb) notebook, available in our repository. This notebook provides a practical example of how to utilize the API effectively within the Google Colab environment.

## RESTful API Server
First, launch the controller

Expand Down
347 changes: 347 additions & 0 deletions playground/FastChat_API_GoogleColab.ipynb

Large diffs are not rendered by default.

0 comments on commit 7ef41f3

Please sign in to comment.