Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
a1766e4a
Unverified
Commit
a1766e4a
authored
Feb 25, 2026
by
Neal Vaidya
Committed by
GitHub
Feb 26, 2026
Browse files
fix: use force_reasoning parser for nemotron_nano (#6288)
Signed-off-by:
Neal Vaidya
<
nealv@nvidia.com
>
parent
e1078789
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
docs/pages/agents/tool-calling.md
docs/pages/agents/tool-calling.md
+1
-0
lib/llm/src/preprocessor.rs
lib/llm/src/preprocessor.rs
+47
-0
lib/parsers/src/reasoning/mod.rs
lib/parsers/src/reasoning/mod.rs
+1
-1
No files found.
docs/pages/agents/tool-calling.md
View file @
a1766e4a
...
...
@@ -39,6 +39,7 @@ Parser to Model Mapping
| llama3_json | meta-llama/Llama-3.1-
*, meta-llama/Llama-3.2-*
|
| harmony | openai/gpt-oss-
*
|
| nemotron_deci | nvidia/nemotron-
*
|
| nemotron_nano | nvidia/NVIDIA-Nemotron-3-Nano-
*
|
| phi4 | Phi-4-
*
|
| deepseek_v3 | deepseek-ai/DeepSeek-V3, deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-R1-0528 |
| deepseek_v3_1 | deepseek-ai/DeepSeek-V3.1 |
...
...
lib/llm/src/preprocessor.rs
View file @
a1766e4a
...
...
@@ -949,6 +949,7 @@ impl OpenAIPreprocessor {
/// Check if reasoning parsing should be disabled based on per-request parameters.
/// For kimi_k25: disabled when chat_template_args contains "thinking": false.
/// For nemotron_nano: disabled when chat_template_args contains "enable_thinking": false.
fn
is_reasoning_disabled_by_request
(
reasoning_parser
:
Option
<&
str
>
,
chat_template_args
:
Option
<&
std
::
collections
::
HashMap
<
String
,
serde_json
::
Value
>>
,
...
...
@@ -962,6 +963,14 @@ impl OpenAIPreprocessor {
}
false
}
Some
(
"nemotron_nano"
)
=>
{
if
let
Some
(
args
)
=
chat_template_args
&&
let
Some
(
enable_thinking
)
=
args
.get
(
"enable_thinking"
)
{
return
enable_thinking
==
&
serde_json
::
Value
::
Bool
(
false
);
}
false
}
_
=>
false
,
}
}
...
...
@@ -1370,6 +1379,19 @@ mod tests {
m
.insert
(
"thinking"
.to_string
(),
serde_json
::
Value
::
Bool
(
false
));
m
};
let
enable_thinking_true
=
{
let
mut
m
=
std
::
collections
::
HashMap
::
new
();
m
.insert
(
"enable_thinking"
.to_string
(),
serde_json
::
Value
::
Bool
(
true
));
m
};
let
enable_thinking_false
=
{
let
mut
m
=
std
::
collections
::
HashMap
::
new
();
m
.insert
(
"enable_thinking"
.to_string
(),
serde_json
::
Value
::
Bool
(
false
),
);
m
};
let
empty_args
=
std
::
collections
::
HashMap
::
new
();
// (parser, args, expected_disabled, description)
...
...
@@ -1416,6 +1438,31 @@ mod tests {
false
,
"no parser → never disabled"
,
),
// nemotron_nano uses "enable_thinking" key
(
Some
(
"nemotron_nano"
),
Some
(
&
enable_thinking_false
),
true
,
"nemotron_nano + enable_thinking=false → disabled"
,
),
(
Some
(
"nemotron_nano"
),
Some
(
&
enable_thinking_true
),
false
,
"nemotron_nano + enable_thinking=true → enabled"
,
),
(
Some
(
"nemotron_nano"
),
None
,
false
,
"nemotron_nano + no args → enabled"
,
),
(
Some
(
"nemotron_nano"
),
Some
(
&
empty_args
),
false
,
"nemotron_nano + empty args → enabled"
,
),
];
for
(
parser
,
args
,
expected
,
desc
)
in
cases
{
...
...
lib/parsers/src/reasoning/mod.rs
View file @
a1766e4a
...
...
@@ -30,7 +30,7 @@ fn get_reasoning_parser_map() -> &'static HashMap<&'static str, ReasoningParserT
map
.insert
(
"step3"
,
ReasoningParserType
::
Step3
);
map
.insert
(
"mistral"
,
ReasoningParserType
::
Mistral
);
map
.insert
(
"granite"
,
ReasoningParserType
::
Granite
);
map
.insert
(
"nemotron_nano"
,
ReasoningParserType
::
NemotronDeci
);
// nemotron nano is
<think>
...</think>
map
.insert
(
"nemotron_nano"
,
ReasoningParserType
::
DeepseekR1
);
// nemotron nano is ...</think>
map
.insert
(
"glm45"
,
ReasoningParserType
::
NemotronDeci
);
// GLM-4.5/5 is <think>...</think>, no force_reasoning
map
.insert
(
"minimax_append_think"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment