[AsyncEngine Refactor 2/N] Remove deprecates from chat template#4252
Merged
lvhan028 merged 4 commits intoInternLM:mainfrom Jan 5, 2026
Merged
[AsyncEngine Refactor 2/N] Remove deprecates from chat template#4252lvhan028 merged 4 commits intoInternLM:mainfrom
lvhan028 merged 4 commits intoInternLM:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes deprecated chat template functionality as part of the AsyncEngine refactor series. The main changes consolidate chat template handling by replacing the best_match_model function with a new get_chat_template function and removing deprecated template names and the CLI list command.
- Replaced
best_match_model()withget_chat_template()for cleaner chat template resolution - Removed deprecated and obsolete chat template name constants
- Removed the
lmdeploy listCLI command for listing chat templates
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lmdeploy/model.py | Removed deprecated chat template name constants and replaced best_match_model() with get_chat_template() function that provides a cleaner API for template resolution |
| lmdeploy/serve/async_engine.py | Updated to use get_chat_template() and simplified parameter type hints for backend config methods |
| lmdeploy/cli/cli.py | Removed the list subcommand and its parser that was used to display supported chat template names |
| tests/test_lmdeploy/test_model.py | Removed tests for deprecated best_match_model() function and simplified remaining tests to directly use template names |
| tests/test_lmdeploy/test_vl/test_hf_chat_template.py | Simplified to directly use 'hf' chat template instead of calling best_match_model() |
| tests/test_lmdeploy/test_vl/test_nonhf_chat_template.py | Simplified to directly use 'hf' chat template instead of calling best_match_model() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RunningLeon
reviewed
Jan 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Removes deprecated chat templates as part of the AsyncEngine refactor series.
Modification
best_match_modelwithget_chat_templatecleaner chat template