Repository navigation
[Docs] Clarify OpenAI chat template defaults - #32172
JustinTong0323 merged 6 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Hi @wisclmy0611, could you please review this focused docs update for the merged |
|
Independent review found two overbroad claims in the first revision. Commit |
|
Final independent-review correction is in |
|
Updated the branch against latest main. The docs directory was renamed |
JustinTong0323
left a comment
There was a problem hiding this comment.
Verified both edits against current main:
- Consumer list is accurate: the defaults merge in
OpenAIServingChat._process_messages(serving_chat.py), which also covers Responses (serving_responses.pycalls_process_messages) and the Anthropic endpoint (delegates toopenai_serving_chat), and the merge happens beforeapply_chat_template, so chat tokenization sees them. Ollama (ollama/serving.py) and embeddings callapply_chat_templatedirectly and never touch the defaults — the exclusion note is correct. - Precedence claim matches the implementation: defaults are applied with
setdefault, so explicit per-requestchat_template_kwargswins. - The
reasoning_effortcaveat is real: serving_chat.py promotesreasoning_effortout of the kwargs onto the request field, so it indeed doesn't follow the ordinary-key precedence. - The Qwen3
enable_thinkingdefault and the "parser doesn't enable reasoning" note match the Qwen3 chat template and parser behavior.
Docs-only, LGTM from my read.
JustinTong0323
left a comment
There was a problem hiding this comment.
Docs-only, content verified against current main (see earlier review). LGTM.
Co-authored-by: Xinyuan Tong <[email protected]>
Motivation
PR #29579 added
--default-chat-template-kwargstoOpenAIServingChat-backed rendering paths, but the server-argument reference does not list it and the OpenAI chat-completions guide does not explain how its ordinary template keys interact with request values. The Qwen3 example also says that omittingenable_thinkingdisables reasoning, although omission follows the detected chat-template default and Qwen3 defaults to thinking enabled.Related to #5948.
Modifications
--default-chat-template-kwargsto the server-argument reference with its actualNonedefault and JSON type.enable_thinking:chat_template_kwargs;--default-chat-template-kwargs;reasoning_effortfollows a separate normalization path and should not be configured at both server and request layers.This remains a documentation-only change: 2 files, 32 insertions, and 5 deletions.
Accuracy Tests
N/A. No model output or runtime behavior changed.
Speed Tests and Profiling
N/A. Documentation-only change.
Validation
ServingChatTestCasetests covering ordinary default application, per-request override, server-provided effort, and Qwen3's default-true toggle: 4 passed.reasoning_effort=lowand server defaultreasoning_effort=high: observedrequest=low, rendered=high, confirming that effort does not follow ordinary-key precedence and motivating the explicit warning not to configure both layers.OpenAIServingResponsesinheritsOpenAIServingChatand calls_process_messages; Anthropic delegates to the same handler; chat tokenization constructsOpenAIServingChat; direct Ollama calls the tokenizer template directly.mint validate: build validation passed after every independent-review correction, including the final consumer list.pre-commit run --files docs_new/docs/advanced_features/server_arguments.mdx docs_new/docs/basic_usage/openai_api_completions.mdx: all applicable hooks passed.mint dev: visually verified the corrected server-argument row and reasoning section.mint broken-links: the repository-wide command reports 332 links across 86 files; this change adds no links.Independent review
A separate read-only reviewer checked all three contribution PRs against current source. It found three scope/correctness issues here, all corrected:
reasoning_effort;OpenAIServingChat-backed consumers.The final reference now lists the exact consumer groups and exclusions, while the how-to remains focused on its OpenAI Chat Completions example. Closing/reopening refreshed GitHub's stale PR head after each fork update; the current PR-visible head is
43a3467d6.Checklist
CI States
Latest PR Test (Base): ✅ Run #33919561361
Latest PR Test (Extra): ❌ Run #33919601458
Latest PR Test (AMD ROCm 7.2): ➖ No AMD PR run found for this commit.