diff --git a/rust/src/chat/src/renderer/deepseek.rs b/rust/src/chat/src/renderer/deepseek.rs index 2683c37ec3..1edc671d65 100644 --- a/rust/src/chat/src/renderer/deepseek.rs +++ b/rust/src/chat/src/renderer/deepseek.rs @@ -289,8 +289,8 @@ pub(super) fn resolve_reasoning( DsDialect::V41 => { let budget = match effort { EffortValue::String(effort) => match effort.as_str() { - "low" => 25, - "high" => 50, + "low" => 50, + "high" => 75, "xhigh" => 75, "max" => 100, _ => return Err(invalid_v41_reasoning_effort()), diff --git a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_1.txt b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_1.txt index 0897086688..a41d88e924 100644 --- a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_1.txt +++ b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_1.txt @@ -1,4 +1,4 @@ -<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning) +<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning) You are a helpful assistant. diff --git a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_2.txt b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_2.txt index 4e93ce2cbb..fa481ca5cd 100644 --- a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_2.txt +++ b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_2.txt @@ -1,3 +1,3 @@ -<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning) +<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning) You are a helpful assistant.<|User|>Hello<|Assistant|>Hi there! How can I help you?<|end▁of▁sentence|><|User|>What is the capital of France?<|Assistant|>The user asks about the capital of France. It is Paris.The capital of France is Paris.<|end▁of▁sentence|> \ No newline at end of file diff --git a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_developer_tools.txt b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_developer_tools.txt index 99f4af0d0e..bd329b7928 100644 --- a/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_developer_tools.txt +++ b/rust/src/chat/src/renderer/deepseek_v41/fixtures/test_output_developer_tools.txt @@ -1,4 +1,4 @@ -<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning) +<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning) <|User|>question<|User|>policy diff --git a/rust/src/chat/src/renderer/deepseek_v41/tests.rs b/rust/src/chat/src/renderer/deepseek_v41/tests.rs index 62cf6d2024..3f9dc061a6 100644 --- a/rust/src/chat/src/renderer/deepseek_v41/tests.rs +++ b/rust/src/chat/src/renderer/deepseek_v41/tests.rs @@ -165,9 +165,9 @@ fn image_part(uuid: &str) -> ChatContentPart { #[test] fn maps_reasoning_effort_to_reference_numeric_budget() { for (effort, budget) in [ - (None, 50), - (Some(EffortValue::from("low")), 25), - (Some(EffortValue::from("high")), 50), + (None, 75), + (Some(EffortValue::from("low")), 50), + (Some(EffortValue::from("high")), 75), (Some(EffortValue::from("xhigh")), 75), (Some(EffortValue::from("max")), 100), (Some(EffortValue::Number(37.into())), 37), @@ -189,7 +189,7 @@ fn accepts_numeric_template_effort_with_top_level_precedence() { (json!(1), 1), (json!(42), 42), (json!(100), 100), - (json!("low"), 25), + (json!("low"), 50), ] { let mut request = request(); request.chat_options.template_kwargs.insert("reasoning_effort".into(), effort); @@ -286,11 +286,11 @@ fn system_after_dropped_developer_becomes_leading_system() { ], ..ChatRequest::for_test() }; - expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning)\n\nsys"] + expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning)\n\nsys"] .assert_eq(&render(&request)); request.messages.push(ChatMessage::user("question")); - expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning)\n\nsys<|User|>question<|Assistant|>"] + expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning)\n\nsys<|User|>question<|Assistant|>"] .assert_eq(&render(&request)); } @@ -322,7 +322,7 @@ fn last_user_turn_omits_generation_prompt_when_disabled() { let mut request = request(); request.chat_options.generation_prompt_mode = GenerationPromptMode::NoGenerationPrompt; - expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning)\n\n<|User|>question"] + expect!["<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning)\n\n<|User|>question"] .assert_eq(&render(&request)); } diff --git a/tests/tokenizers_/fixtures/deepseek_v41/test_output_1.txt b/tests/tokenizers_/fixtures/deepseek_v41/test_output_1.txt index 0897086688..a41d88e924 100644 --- a/tests/tokenizers_/fixtures/deepseek_v41/test_output_1.txt +++ b/tests/tokenizers_/fixtures/deepseek_v41/test_output_1.txt @@ -1,4 +1,4 @@ -<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning) +<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning) You are a helpful assistant. diff --git a/tests/tokenizers_/fixtures/deepseek_v41/test_output_2.txt b/tests/tokenizers_/fixtures/deepseek_v41/test_output_2.txt index 4e93ce2cbb..fa481ca5cd 100644 --- a/tests/tokenizers_/fixtures/deepseek_v41/test_output_2.txt +++ b/tests/tokenizers_/fixtures/deepseek_v41/test_output_2.txt @@ -1,3 +1,3 @@ -<|begin▁of▁sentence|><|System|>Reasoning Effort: 50 (range 1-100, the higher the value, the more thorough the reasoning) +<|begin▁of▁sentence|><|System|>Reasoning Effort: 75 (range 1-100, the higher the value, the more thorough the reasoning) You are a helpful assistant.<|User|>Hello<|Assistant|>Hi there! How can I help you?<|end▁of▁sentence|><|User|>What is the capital of France?<|Assistant|>The user asks about the capital of France. It is Paris.The capital of France is Paris.<|end▁of▁sentence|> \ No newline at end of file diff --git a/tests/tokenizers_/test_deepseek_v41.py b/tests/tokenizers_/test_deepseek_v41.py index 13c0375fbb..10c66f23b0 100644 --- a/tests/tokenizers_/test_deepseek_v41.py +++ b/tests/tokenizers_/test_deepseek_v41.py @@ -35,9 +35,9 @@ def test_reference_encoder_fixtures(case_id): @pytest.mark.parametrize( ("effort", "budget"), [ - (None, 50), - ("low", 25), - ("high", 50), + (None, 75), + ("low", 50), + ("high", 75), ("xhigh", 75), ("max", 100), (1, 1), @@ -138,7 +138,7 @@ def test_top_level_effort_overrides_template_effort(): chat_template_kwargs={"reasoning_effort": 100}, ) kwargs = request.build_chat_params(None, "auto").get_apply_chat_template_kwargs() - assert "Reasoning Effort: 25 " in render(request.messages, **kwargs) + assert "Reasoning Effort: 50 " in render(request.messages, **kwargs) def test_encode_uses_one_bos_and_forwards_truncation(): diff --git a/vllm/tokenizers/deepseek_v41_encoding.py b/vllm/tokenizers/deepseek_v41_encoding.py index 841de385cb..6851d42f91 100644 --- a/vllm/tokenizers/deepseek_v41_encoding.py +++ b/vllm/tokenizers/deepseek_v41_encoding.py @@ -181,8 +181,8 @@ REASONING_EFFORT_TEMPLATE = ( "(range 1-100, the higher the value, the more thorough the reasoning)\n\n" ) REASONING_EFFORT_MAPPINGS: Dict[str, int] = { - "low": 25, - "high": 50, + "low": 50, + "high": 75, "xhigh": 75, "max": 100, }