/chat/completions fails ("Chat template not loaded correctly") for VL-derived / omni text decoders — Python-Jinja path leaves template null; MINJA mode would fix it but is not in the 2026.2.x release
メンテナーはふだん 2 日以内に返信
@dkalinowski がすでに取り組んでいます。
2026年6月25日 から。
評価
この issue はまだ評価されていません。
説明
Summary
On a _python_on Windows build of OVMS, /v3/chat/completions fails for a text-decoder IR extracted from a tri-modal (text+image+audio+video) qwen3_5 model:
Mediapipe execution failed. MP status - INVALID_ARGUMENT: CalculatorGraph::Run() failed:
Calculator::Process() for node "LLMExecutor" failed:
Error: Chat template not loaded correctly, so it cannot be applied
/v3/completions (raw prompt) on the same served model works perfectly, so the model, tokenizer, and inference are fine — only the chat-template application path fails. The model is loaded as an LLM (continuous-batching) pipeline, which defaults to the Python-Jinja2 template processor.
Environment
- OVMS
2026.2.1(ovms_windows_2026.2.1_python_on), GenAI backend2026.2.1.0-3123. Also reproduced on2026.2.0. - Windows, Intel Arc GPU (
targetDevice: GPU). - Model: text decoder extracted from a
qwen3_5omni model, exported to INT4 OpenVINO IR viaoptimum-cli. Standard Qwen ChatML template;<|im_start|>/<|im_end|>present in vocab;bos=None, eos=<|im_end|>(identical to a working Qwen3-14B).
Reproduction
- Serve the omni-derived text-decoder IR as an LLM continuous-batching pipeline (default
graph.pbtxt). POST /v3/completionswith a raw ChatML prompt → works, correct output.POST /v3/chat/completionswithmessages→ fails with the error above.
Root cause (traced in source)
/chat uses the embedded Python Jinja2 processor, and the template object ends up null:
src/llm/py_jinja_template_processor.cpp(~L39-40):if (templateProcessor.chatTemplate == nullptr) { output = "Error: Chat template not loaded correctly, so it cannot be applied"; return false; }src/llm/servable_initializer.cpp→loadPyTemplateProcessor(~L147+): reads
tokenizer.get_original_chat_template()then compiles it in an
ImmutableSandboxedEnvironment. For this tokenizer the load/compile does not
produce a usable template, sochatTemplatestays null and/chatfails at apply time.
Importantly, GenAI's own Tokenizer.apply_chat_template() succeeds on the exact same tokenizer (verified standalone with openvino_genai 2026.2.1.0, which renders correct ChatML). So the failure is specific to OVMS's Python-Jinja serving path, not GenAI's template engine. Upgrading GenAI alone does not fix /chat.
The mechanism to fix it already exists in main — but not in the release
main has LLMCalculatorOptions.chat_template_mode (src/llm/llm_calculator.proto):
MINJA = 0— use GenAIapply_chat_template(the path that works here). "default for VLM pipelines."JINJA = 1— Python Jinja2. "default for LLM pipelines" — i.e. the failing path for this model.
There is even an in-code TODO(dkalinow) to make MINJA the default for VLM. Setting chat_template_mode: MINJA in the graph would route through the working engine — but the 2026.2.1 release binary rejects the field:
libprotobuf ERROR ... text_format.cc: Message type "mediapipe.LLMCalculatorOptions"
has no field named "chat_template_mode".
So the option is main-only and the graph fails to load when it's added on 2026.2.1.
Requests
- Release the
chat_template_modeoption in a2026.2.x/2026.3build so users can opt VL-derived/omni LLM pipelines intoMINJA. - (Robustness) In
loadChatTemplate/loadPyTemplateProcessor, when the Python-Jinja processor leaveschatTemplate == nullptr, auto-fall-back toMINJA(GenAI's engine) instead of failing/chatoutright — GenAI already handles these templates correctly. - Consider making
MINJAthe default (or auto-selected) for LLM pipelines whose tokenizer originates from a VL/omni model (aligns with the existing VLM TODO).
Current workaround
A thin reverse proxy that applies ChatML itself and forwards to /v3/completions restores /chat/completions fully (verified, correct outputs). Happy to share if useful.
- 主要言語
- C++
- スター
- 947
- フォーク
- 280
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 54
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openvinotoolkit/model_server のほかの issue
-
/v3/audio/speech ignores response_format and always returns 32-bit float WAV対応中かも @michalkulakowski が 18 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
openvinotoolkit/model_server#4613 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
openvinotoolkit/model_server#4609 · コメント 5 件 ·
メンテナーはふだん 2 日以内に返信
-
Idle unload never happens again if the client disconnects while a sleeping graph is waking up対応中かも @atobiszei が 22 日前に担当しました。 オープン
openvinotoolkit/model_server#4603 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
openvinotoolkit/model_server#4599 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
openvinotoolkit/model_server#4586 · コメント 7 件 ·
メンテナーはふだん 2 日以内に返信
openvinotoolkit/model_server の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement question
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DarkStarSystems/pcons#224 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
LizardByte/Sunshine#5953 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
CleverRaven/Cataclysm-DDA#89133 ·
メンテナーはふだん 1 日以内に返信