Skip to content

[AsyncEngine Refactor 2/N] Remove deprecates from chat template#4252

Merged
lvhan028 merged 4 commits intoInternLM:mainfrom
lvhan028:refactor-chat-template
Jan 5, 2026
Merged

[AsyncEngine Refactor 2/N] Remove deprecates from chat template#4252
lvhan028 merged 4 commits intoInternLM:mainfrom
lvhan028:refactor-chat-template

Conversation

@lvhan028
Copy link
Copy Markdown
Collaborator

@lvhan028 lvhan028 commented Jan 4, 2026

Motivation

Removes deprecated chat templates as part of the AsyncEngine refactor series.

Modification

  • Replace best_match_model with get_chat_template cleaner chat template
  • Remove deprecated and obsolete chat template name constants
  • Remove the lmdeploy list CLI command for listing chat templates

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() with get_chat_template() for cleaner chat template resolution
  • Removed deprecated and obsolete chat template name constants
  • Removed the lmdeploy list CLI 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.

Copy link
Copy Markdown
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lvhan028 lvhan028 merged commit 0674241 into InternLM:main Jan 5, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants