-
Notifications
You must be signed in to change notification settings - Fork 811
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
Implement served_model_name to customize model id when use local mode… #749
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 contribution! I left a few comments.
python/sglang/srt/server_args.py
Outdated
if not self.served_model_name: | ||
self.served_model_name = self.model_path | ||
elif isinstance(self.served_model_name, list): | ||
self.served_model_name = self.served_model_name[0] |
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.
If served_model_name
is given in a wrong format (not a list), self.served_model_name
will be None
. This could trigger errors in other parts of the changes. Could you check?
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.
Sure, I'll check it.
python/sglang/srt/server_args.py
Outdated
@@ -18,6 +18,7 @@ class ServerArgs: | |||
context_length: Optional[int] = None | |||
quantization: Optional[str] = None | |||
chat_template: Optional[str] = None | |||
served_model_name: Optional[Union[str, List[str]]] = None |
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.
- Why do you allow it to be a list?
- Could you update it to the CLI args as well? https://github.com/sgl-project/sglang/blob/d360a4ea77f0af1f54e94575173f4fa964dc38fc/python/sglang/srt/server_args.py#L98
d360a4e
to
64f300c
Compare
Motivation
Like vllm, user can load local model with model's id same as huggingface like: mistralai/Mistral-Large-Instruct-2407
Modification
Add an optional arg: served_model_name, change API: /v1/models
Checklist
pre-commit run --all-files
or other linting tools are used to fix potential lint issues.