DeepSeekR1Parser ignores a per-request enable_thinking=False, returning empty content
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.7k
- Forks
- 2.8k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 489
Description
System Info
- TensorRT-LLM: 1.3.0rc23 (built from
f20ea652); behaviour re-checked againstmain@fbda11f5 - GPU: NVIDIA GeForce RTX 5090 (sm_120), driver 595.71.05
- PyTorch 2.11.0+cu130, CUDA 13.0, Python 3.12.13
- Ubuntu 25.10, kernel 6.17.0-41-generic
- Backend: PyTorch; single GPU, no TP/PP
- Model where observed: Qwen3.6-35B-A3B-NVFP4 with FP8 KV cache (where model-specific)
Who can help?
No response
Reproduction
DeepSeekR1Parser is registered with reasoning_at_start=True for qwen3_5, minimax_m2 and
minimax_m2_append_think. When a request passes chat_template_kwargs: {"enable_thinking": false},
the rendered template injects no <think> and the model emits no </think>, so parse() partitions
on an absent tag and returns the whole reply as reasoning_content with an empty content.
A conventional OpenAI client reads message.content and therefore receives nothing for a request
that succeeded. Two clients on one server — one wanting thinking, one not — cannot share it.
Expected behavior
With enable_thinking=False, the reply is returned in message.content.
actual behavior
parse() partitions on an absent , so the whole reply lands in reasoning_content and content is empty. An OpenAI-style client reading message.content receives nothing.
additional notes
NemotronV3ReasoningParser (a DeepSeekR1Parser subclass) already implements the rule:
reasoning_at_start = chat_template_kwargs.get("enable_thinking", reasoning_at_start)
and test_nano_v3_reasoning_parser already covers {"enable_thinking": False}. The base class does
not, so the keys that register it directly do not benefit.
Apply the same rule in DeepSeekR1Parser.__init__, so every reasoning_at_start=True registration
honours a per-request enable_thinking=False. The value is already threaded into the constructor by
ReasoningParserFactory.create_reasoning_parser().
Per CONTRIBUTING.md we are raising this Issue Request before submitting the patch.
Questions for maintainers
- Would you prefer the rule hoisted to the base class (making the Nemotron subclass's assignment
redundant), or duplicated per subclass? - Should the existing
test_nano_v3_reasoning_parserparametrisation be extended to a base-class
registration such asqwen3_5?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DeepSeekR1Parser.init and ReasoningParserFactory.create_reasoning_parser(), then read the existing test_nano_v3_reasoning_parser coverage for enable_thinking=False. Confirm the base parser honors the per-request setting for a direct reasoning_at_start=True registration, and run the relevant reasoning-parser tests to verify that the response appears in content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100