Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gradio chatbot for openai webserver #2307

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

arkohut
Copy link
Contributor

@arkohut arkohut commented Dec 30, 2023

Follow the example of https://github.com/vllm-project/vllm/blob/main/examples/gradio_webserver.py I create a gradio webserver for openai api server.

Right now I find that OpenAI-compatible api server has more features than the default webserver and is much more popular. This script will create a chatbot to test the web server.

Here is a command example:

$ python chat.py -m '01ai/Yi-34B-Chat-4bits' --stop-token-ids 7

Running on local URL:  http://127.0.0.1:8001
Running on public URL: https://747eb488ee1e9155e4.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)

Here is the screenshot:

截屏2023-12-30 18 00 16

@Tostino
Copy link
Contributor

Tostino commented Jan 3, 2024

I wanted to mention I've been using LibreChat for a little while now against my models hosted using vLLM OpenAI API. It's not as simple as a single file python app, but I found that it works really, really well as a ChatGPT replacement, which I can not say about things like Gradio interfaces.

Since other interfaces are finally becoming available that can integrate with the standard APIs provided, It may be smarter for the project to link to those compatible interfaces, with simple setup instructions. The more code you have in the repo that isn't the main purpose of the project, the harder it is to maintain high quality code and quickly deliver features.

@arkohut
Copy link
Contributor Author

arkohut commented Jan 4, 2024

The more code you have in the repo that isn't the main purpose of the project, the harder it is to maintain high quality code and quickly deliver features.

You are right. I will not use a single file like this in my daily work. I just found that a small test file for the openai api is really convenient in the same repository. And there is already one file https://github.com/vllm-project/vllm/blob/main/examples/gradio_webserver.py for the api testing.

So feel free to close this PR if you think it is not following the main purpose of the project. And I really understand the reason.

@FlorianJoncour
Copy link
Contributor

I personally agree with this PR, but why not in the examples directory or maybe create a endpoint or client directory as a mirror of entrypoint

Copy link
Collaborator

@zhuohan123 zhuohan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move it to examples/gradio_openai_chatbot_webserver.py?

@arkohut
Copy link
Contributor Author

arkohut commented Jan 5, 2024

Can you move it to examples/gradio_openai_chatbot_webserver.py?

It's done.

@arkohut
Copy link
Contributor Author

arkohut commented Jan 10, 2024

Do I need to do any other update? @zhuohan123

Copy link
Collaborator

@zhuohan123 zhuohan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your contribution!

@zhuohan123 zhuohan123 merged commit 9746058 into vllm-project:main Jan 12, 2024
2 checks passed
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Jan 18, 2024
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants