-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Frontend] Add segments to OpenAI Requests #11713
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
e4077c5
to
537d5dd
Compare
Signed-off-by: Ruedi Steinmann <[email protected]>
537d5dd
to
cfd80ca
Compare
Hi @ruediste this interface is a new idea to me and I don't see it in the OpenAI API, is there another server or API that implements this? It would be helpful to have a full e2e example of how to use this feature to demonstrate its intended use. |
A full e2e test is somewhat difficult, as it would in my case include a VS Code extension. But I'm happy to give an example: Imaging a inline autocomplete extension. The user is editing some code:
You would get a prefix of
and the suffix
The normal completions request:
You get the intended (Qwen 2.5 Coder 0.5B) response: Now imagine the following code:
Request:
the response is With the new API:
The response is as expected: |
ping |
Any updates on this? |
I extended the format of the completions prompt:
This allows fine control over the generated tokens, protection against prompt injection, and low latency since all of this can be achieved with a single request.
Sample Usage using the javascript openai client: