-
Notifications
You must be signed in to change notification settings - Fork 44
refactor: Make base client concrete and usable #246
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
base: main
Are you sure you want to change the base?
refactor: Make base client concrete and usable #246
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LukeAVanDrie The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @LukeAVanDrie! |
I am looking into making some perf improvements in the client code. As I haven't contributed to this project yet, I wanted to start with a smaller change to familiarize myself with the PR and CI/CD processes. If it's intended that openAIModelServerClient is a class that must be subclassed, I'll drop this change, but I would suggest renaming the class itself to indicate it is intended as a base class only. |
56714ad
to
052d06c
Compare
The openAIModelServerClient could not be instantiated directly as it declared no supported APIs. While this may have been intended to enforce it as a base class, making it concrete provides more flexibility. This change allows the client to be used with any generic OpenAI-compatible endpoint. It also centralizes the API list so redundant overrides can be removed from the vLLM, TGI, and SGLang subclasses, improving maintainability.
052d06c
to
8bbbd52
Compare
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 sending this out! This can simplify things quite a bit.
Can you also include how you tested the change with an example config and a successful run - one for the new openai
type and another for vllm
?
|
||
def get_supported_apis(self) -> List[APIType]: | ||
return [] | ||
return [APIType.Completion, APIType.Chat] |
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.
Can you add a type openai
here? This could be the generic type that someone can run with if it is one of the model servers where we don't have specific metrics support?
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.
Please update the documentation as well along with the change.
The openAIModelServerClient could not be instantiated directly as it declared no supported APIs. While this may have been intended to enforce it as a base class, making it concrete provides more flexibility.
This change allows the client to be used with any generic OpenAI-compatible endpoint. It also centralizes the API list so redundant overrides can be removed from the vLLM, TGI, and SGLang subclasses, improving maintainability.