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

feat: add support for OpenAI completion API #2604

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

Syst3m1cAn0maly
Copy link
Contributor

Add support for OpenAI completion API in order for tabby to be plugged to other OpenAI compatible backends (for example vLLM).

Tested with the vLLM backend, autocompletion is a lot faster and can support more concurrent requests than the llama.cpp backend.

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 60 lines in your changes missing coverage. Please review.

Project coverage is 58.24%. Comparing base (ef8542c) to head (17d7a04).
Report is 3 commits behind head on main.

Files Patch % Lines
crates/http-api-bindings/src/completion/openai.rs 0.00% 53 Missing ⚠️
crates/http-api-bindings/src/completion/mod.rs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2604      +/-   ##
==========================================
- Coverage   58.45%   58.24%   -0.22%     
==========================================
  Files         167      168       +1     
  Lines       15154    15214      +60     
==========================================
+ Hits         8858     8861       +3     
- Misses       6296     6353      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wsxiaoys
Copy link
Member

wsxiaoys commented Jul 9, 2024

Thank you for the pull request—I'm happy to merge it. The only concern is that since OpenAI has deprecated its completion API, referring to it as OpenAICompletion is a bit tricky because its definition is no longer present in any standard OpenAI client library. If there's no better alternative, perhaps consider renaming it to something like vllm/completion or VllmCompletion?

@wsxiaoys
Copy link
Member

wsxiaoys commented Jul 9, 2024

Besides - could you also add an example for newly added completion config in https://github.com/TabbyML/tabby/edit/main/website/docs/administration/model.md? thank you!

@Syst3m1cAn0maly
Copy link
Contributor Author

Thank you for the pull request—I'm happy to merge it. The only concern is that since OpenAI has deprecated its completion API, referring to it as OpenAICompletion is a bit tricky because its definition is no longer present in any standard OpenAI client library. If there's no better alternative, perhaps consider renaming it to something like vllm/completion or VllmCompletion?

I have mixed feelings about the OpenAI completion API as well as it is deprecated in their documentation...
However, it has become and still is a standard for many backends and is specifically mentioned as OpenAI completion API or OpenAI compatible API in their documentation and it is not limited to vLLM.
Some examples :

@wsxiaoys wsxiaoys merged commit 510a63c into TabbyML:main Jul 10, 2024
3 of 5 checks passed
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.

2 participants