Skip to content

Conversation

@DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented May 7, 2025

Since multi-modal models must use Chat Completions API, for user convenience I have added automatic fallbacks for supported multi-modal models. These fallbacks are used when no default chat template is available and the user did not input one. They are located inside a new module vllm.transformers_utils.chat_templates.

cc @mgoin since you considered moving chat templates into the main vLLM library. I think without automatic chat template selection, this would cause some inconvenience to users since they have to specify a longer path to get to the chat template. We can consider moving more chat templates over to this new module once we can automatically fallback to them.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@github-actions
Copy link

github-actions bot commented May 7, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added documentation Improvements or additions to documentation frontend labels May 7, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Copy link
Member

@Isotr0py Isotr0py left a comment

Choose a reason for hiding this comment

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

LGTM!

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) May 7, 2025 16:34
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label May 7, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@vllm-bot vllm-bot merged commit 96722aa into vllm-project:main May 8, 2025
49 of 51 checks passed
@DarkLight1337 DarkLight1337 deleted the chat-template-fallback branch May 8, 2025 06:06
princepride pushed a commit to princepride/vllm that referenced this pull request May 10, 2025
…t#17805)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
…t#17805)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
chat_template: Optional[str],
tools: Optional[list[dict[str, Any]]],
*,
trust_remote_code: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

removing args may break dependent code e..g ray-project/ray#52975

trying to fix in #18098

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you open an issue to lm-eval to update their code? It looks like they already use version bounds so they just have to add another case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

mawong-amd pushed a commit to ROCm/vllm that referenced this pull request May 14, 2025
…t#17805)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
…t#17805)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Yuqi Zhang <yuqizhang@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants