-
Notifications
You must be signed in to change notification settings - Fork 59
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
[Misc] Implement Singleton Design Pattern for EngineStat Scraper, RequestStat Monitor, and Router #131
[Misc] Implement Singleton Design Pattern for EngineStat Scraper, RequestStat Monitor, and Router #131
Conversation
@gaocegege please help me review this PR as mentioned in the Issue #86 |
Hi, thanks for the PR. I'm curious if we could utilize the FastAPI state.
I applied it in this pull request. By doing so, we can avoid complex singleton code and leverage FastAPI's built-in mechanism. |
hmmm that's true since given that our project is a dedicated FastAPI-based production stack. I will re-implement this with the FastAPI State method, but what do you think if you see any potential pitfalls or if you think there’s a scenario where the custom singleton might still offer benefits ? @gaocegege |
I think we can keep the singleton implementation and initialize it with state. In this, we can keep the flexibility to replace fastAPI in the future #26 (comment) |
Yep that's right, just look back at the roadmap same as you 😆 saw that we might have to do with Rust and Go as well. Then I think if we go with the current method, we do not need to look back and refactor the code again later. This should also give people when they used the framework flexibility to adapt customize change as well if need to @gaocegege |
let's go with the hybrid method, I will add on the fastapi state part in the PR as well |
73cd76e
to
81e33fd
Compare
hi @gaocegege , I updated the code again to include using FastAPI State and Custom Singleton code as we mentioned before, please help me review the code again. Cheers 😄 |
hi @gaocegege any update or comment for this PR ? 😄 |
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! It is super helpful to implement the batch API support. /cc @Shaoting-Feng PTAL
Please resolve the conflicts |
… and router scraper Signed-off-by: sitloboi2012 <[email protected]>
…ustom singleton Signed-off-by: sitloboi2012 <[email protected]>
81e33fd
to
7ce20db
Compare
@gaocegege hi i just updated and fixed conflict, please help me review again and merge, all test run good |
LGTM 👍 |
FILL IN THE PR DESCRIPTION HERE
Enhance Singleton Design Pattern for EngineStat Scraper, RequestStat Monitor, and Router as mentioned in #86
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
-s
when doinggit commit
[Bugfix]
,[Feat]
, and[CI]
.Detailed Checklist (Click to Expand)
Thank you for your contribution to production-stack! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Feat]
for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).[Router]
for changes to thevllm_router
(e.g., routing algorithm, router observability, etc.).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
pre-commit
to format your code. SeeREADME.md
for installation.DCO and Signed-off-by
When contributing changes to this project, you must agree to the DCO. Commits must include a
Signed-off-by:
header which certifies agreement with the terms of the DCO.Using
-s
withgit commit
will automatically add this header.What to Expect for the Reviews
We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of YuhanLiu11
, Shaoting-Feng or ApostaC.