-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Document diverged OpenAI API #3147
Comments
Can you link to the lines where it is diverging? I know of one part of the diverging code as I had added that close to a year ago. However, I just want to be sure we are thinking about the same thing. |
I said "diverging" as that was what the original PR (#1536) that introduced this second protocol and API said. I've noticed these differences between the OpenAI client library and the two chat completion endpoints in FastChat's OpenAI server:
There are also two slight code differences, which appear to just be oversights when updating one endpoint:
I think documenting the API differences would be helpful, as it's not immediately clear without digging around the code and PR history exactly why these two chat completion endpoints exist, whether the diverged one can still be used with the OpenAI library, and how to actually use the additional parameters. Perhaps the |
Okay I gotcha. So the reasoning behind it is that OpenAI will only support things that, well, OpenAI supports. So being locked into their API is rough, we should maintain support but not require all our use cases to fit into it. There's tons of different types of models being released on the regular and we all use FastChat to interface with them, so the idea here is that we should have a derivative API perhaps that allows us to add nice "production-ready" features, e.g. token checking, and other things, to help make testing all the way through to deployment of apps with FastChat more amicable. As for documenting, I'll have to return to this and see what needs updating / adding and probably do it in another nice packaged PR. |
The existence of the diverged OpenAI API appears to be undocumented at the moment, but has some useful and requested features (e.g.
repetition_penalty
#1914).As far as I can tell, it appears these endpoints can be used with the OpenAI client, and additional parameters passed with the
extra_body
argument, e.g.:(this is also useful for
top_k
which is not a supported argument for the OpenAI client but is supported in both APIs in FastChat)It would be good to at least document that this API exists and confirm whether the divergences actually impact using the OpenAI client.
The text was updated successfully, but these errors were encountered: