From aa0dc77ef53b365ddf54be51748c166895a0bcd9 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 27 Jun 2025 13:16:41 +0400 Subject: [PATCH] [Perf] Improved perf for resolve_chat_template_content_format (#20065) Signed-off-by: Ilya Lavrenov --- vllm/entrypoints/chat_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vllm/entrypoints/chat_utils.py b/vllm/entrypoints/chat_utils.py index 7951c49f5da05..35ee52ab4601d 100644 --- a/vllm/entrypoints/chat_utils.py +++ b/vllm/entrypoints/chat_utils.py @@ -293,6 +293,7 @@ def _try_extract_ast(chat_template: str) -> Optional[jinja2.nodes.Template]: return None +@lru_cache(maxsize=32) def _detect_content_format( chat_template: str, *,