-
Notifications
You must be signed in to change notification settings - Fork 50
[AQUA] Add API endpoints to manage chat templates via model custom metadata #1213
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?
Conversation
- Added post endpoint for Model Tokenizer - Updated chat template API endpoint in AquaModelChatTemplateHandler - Added test cases for AquaModelChatTemplateHandler
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.
LGTM!
@@ -381,7 +423,7 @@ def post(self, model_id: str, metadata_key: str): | |||
("model/?([^/]*)", AquaModelHandler), | |||
("model/?([^/]*)/license", AquaModelLicenseHandler), | |||
("model/?([^/]*)/readme", AquaModelReadmeHandler), | |||
("model/?([^/]*)/tokenizer", AquaModelTokenizerConfigHandler), | |||
("model/?([^/]*)/chat-template", AquaModelChatTemplateHandler), |
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.
On UI side we also will have this change?
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.
Yes, we will update the UI with the new endpoint.
Description
This PR introduces a new API handler, AquaModelChatTemplateHandler, replacing the previous AquaModelTokenizerConfigHandler functionality related to chat templates.
Changes
Retrieves the chat template from a model’s custom metadata instead of the Hugging Face tokenizer configuration.
Endpoint:
GET /aqua/model/<model-ocid>/chat-template
Allows adding or updating a custom chat template metadata artifact for a given model.
Endpoint:
POST /aqua/model/<model-ocid>/chat-template
Payload:
{ "chat_template": "<chat_template_string>" }
Unit Tests