fix: drop chat_template_kwargs for Mistral 3.2 compatibility - #335
Conversation
Mistral-Small-3.2-24B-Instruct-2506-FP8 ships native tokenizer files (tekken.json / params.json), causing vLLM to load mistral_common which rejects any chat_template field — including chat_template_kwargs in the request body. Remove the extra_body payload from the pipeline, base loader, and benchmark scripts so requests no longer trigger the ValueError.
📝 WalkthroughWalkthroughAcross four files in benchmarks and component modules, conditional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
benchmarks/prompt_eval/eval_temporal_filter_generation.py (1)
232-234: Duplicate of the change ineval_query_decomposition.py.Same note: prefer deletion or an explicit config flag over a long-lived commented block. Since the helper is now trivial, the
base_urlparameter is also unused — consider inlining{"max_completion_tokens": 512}at call sites or dropping the parameter.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@benchmarks/prompt_eval/eval_temporal_filter_generation.py` around lines 232 - 234, Remove the long-lived commented block and the now-unused base_url parameter from the helper in benchmarks/prompt_eval/eval_temporal_filter_generation.py (the same change applied in eval_query_decomposition.py): delete the commented `if "openai.com" ...` lines, remove `base_url` from the helper signature, and either inline the existing `{"max_completion_tokens": 512}` at its call sites or add an explicit config flag if you need toggling; update all callers to stop passing base_url or to use the inlined default.openrag/components/indexer/loaders/base.py (1)
41-47: LGTM — minor: drop the commented line.The VLM captioning path doesn't benefit from thinking mode anyway, so removing
enable_thinking=Falseis safe for the Mistral case. Suggest deleting the commented entry (Line 45) rather than keeping dead code inmodel_settings.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@openrag/components/indexer/loaders/base.py` around lines 41 - 47, Remove the dead commented entry from the model_settings dict: delete the commented line "# "extra_body": {"chat_template_kwargs": {"enable_thinking": False}}," so model_settings only contains active keys ("temperature", "max_retries", "timeout") and then continue to update settings as before (refer to the model_settings variable and the subsequent settings.update(model_settings) call).benchmarks/prompt_eval/eval_query_decomposition.py (1)
203-205: Consider removing the dead commented block rather than leaving it in the source.Commented-out code tends to rot. If the intent is to re-enable
enable_thinking=Falsefor some future endpoint, gate it behind an env var (e.g.,DISABLE_THINKING=1) or model-config flag instead of preserving commented lines. Otherwise, delete them — git history is authoritative.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@benchmarks/prompt_eval/eval_query_decomposition.py` around lines 203 - 205, Remove the dead commented-out conditional that checks "openai.com" and sets kwargs["extra_body"] = {"chat_template_kwargs": {"enable_thinking": False}}; either delete those commented lines entirely from eval_query_decomposition.py, or if you actually need the behavior, implement it properly by reading an environment flag (e.g., DISABLE_THINKING) or a model-config flag and, before the existing return kwargs, set kwargs["extra_body"] = {"chat_template_kwargs": {"enable_thinking": False}} when the flag is present, using the existing base_url/kwargs variables (do not leave commented code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@benchmarks/prompt_eval/eval_query_decomposition.py`:
- Around line 203-205: Remove the dead commented-out conditional that checks
"openai.com" and sets kwargs["extra_body"] = {"chat_template_kwargs":
{"enable_thinking": False}}; either delete those commented lines entirely from
eval_query_decomposition.py, or if you actually need the behavior, implement it
properly by reading an environment flag (e.g., DISABLE_THINKING) or a
model-config flag and, before the existing return kwargs, set
kwargs["extra_body"] = {"chat_template_kwargs": {"enable_thinking": False}} when
the flag is present, using the existing base_url/kwargs variables (do not leave
commented code).
In `@benchmarks/prompt_eval/eval_temporal_filter_generation.py`:
- Around line 232-234: Remove the long-lived commented block and the now-unused
base_url parameter from the helper in
benchmarks/prompt_eval/eval_temporal_filter_generation.py (the same change
applied in eval_query_decomposition.py): delete the commented `if "openai.com"
...` lines, remove `base_url` from the helper signature, and either inline the
existing `{"max_completion_tokens": 512}` at its call sites or add an explicit
config flag if you need toggling; update all callers to stop passing base_url or
to use the inlined default.
In `@openrag/components/indexer/loaders/base.py`:
- Around line 41-47: Remove the dead commented entry from the model_settings
dict: delete the commented line "# "extra_body": {"chat_template_kwargs":
{"enable_thinking": False}}," so model_settings only contains active keys
("temperature", "max_retries", "timeout") and then continue to update settings
as before (refer to the model_settings variable and the subsequent
settings.update(model_settings) call).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6d8f0686-c76f-4755-9c4e-ded1df521aea
📒 Files selected for processing (4)
benchmarks/prompt_eval/eval_query_decomposition.pybenchmarks/prompt_eval/eval_temporal_filter_generation.pyopenrag/components/indexer/loaders/base.pyopenrag/components/pipeline.py
Summary
Mistral-Small-3.2-24B-Instruct-2506-FP8 ships native tokenizer files (
tekken.json/params.json), causing vLLM to loadmistral_commonwhich rejects anychat_templatefield — includingchat_template_kwargsin the request body (ValueError: chat_template is not supported for Mistral tokenizers).Remove
extra_body: {"chat_template_kwargs": {"enable_thinking": False}}from the pipeline, base loader, and benchmark scripts.Test plan
POST /v1/chat/completionsno longer raises theValueError