-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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 "/chat/completions" as alias for "/v1/chat/completions" #5722
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests. I would suggest to better introduce an --api-prefix
option which will allow to prefix all endpoints according to what expects the client. This fix does not address /v1/embeddings
.
@ngxson What is your point of view on the proposed approach ? |
Yeah maybe a good idea, but I'm not sure what are possible values for If we default |
Good point, what about @jorgealias what are the clients which expects For example, you can set @ggerganov What was the motivation to have different prefixes ? URI versionning is the common REST standard. |
Instead of Still, it's a future-proof thing that I'm not even sure if that's a good idea or not. Maybe we should wait until OAI release v2 API? |
The change is only providing a simple implementation for the comment at line 2683:
Attempting to answer the question Using More can be done, to remap/reuse existing handlers, and support multiple or different versions, if such a reuse is doable and necessary, for various clients. That could be also applicable for other handlers, like Changing the version usually implies more than just a simple reuse. It might not be safe to make future assumptions and come with options on how to handle such changes, for matching other APIs. Indeed, it is better to wait. Regarding this specific change, it might have been faster to provide a message showing this implementation or to ask why would that be necessary, but here we are. If there is no immediate need, please press the close button :) Why this? Just trying to help, starting somewhere. One way to say thank you for the great work and effort to build this project. |
thanks, @jorgealias : contributions are very welcomed. Maybe we can switch this one to draft at the moment the time to sort out a good approach to support versionning. Since you provided a scenario on the test framework, it would be nice if you could test missing features in the server. We are planning to refractor the code, and having good coverage will definitely help. Typically, everything around multimodal. |
It was a feature request in one of the discussions: #4160 (comment) |
@jorgealias You are right about the point of fixing So I think it's good to merge this one. @phymbert Sorry I misunderstood your initial question. In fact, the So that's why I mentioned that we should not be future-proof, because the For the same purpose, the other endpoints supported by OpenAI like For now, This PR seems OK for me to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks for the explanation.
I am pushing now, but @phymbert did ask
I am not sure what needs to be addressed but if it is about an extra Adding a helper function like:
will help eliminating the need for extra named lambdas If only one path for a POST, then use the standard:
For multiple paths for a POST with the same lambda, then use the new helper:
or
As in, only replacing:
And that should also work for |
Yup, good idea |
* Add "/chat/completions" as alias for "/v1/chat/completions" * merge to upstream master * minor : fix trailing whitespace --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* Add "/chat/completions" as alias for "/v1/chat/completions" * merge to upstream master * minor : fix trailing whitespace --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
From server : improvements and maintenance #4216
Regarding:
Reusing the same "completions" lambda for the mount point without "/v1" prefix.
Added a new "concurrent OAI completions requests no v1" testing step to validate it is working for the new mount point.
The change only moved the original lambda two indents left, to match other "auto" formatting. Changes are seen better when ignoring the white space differences: view ignoring ws
If other similar changes are necessary, for more mount points, then some work can be done to keep these changes more concise.