spring-projects/spring-ai · warning

Thinking mode does not support the parameter(s). Please not

Error message

Thinking mode does not support the  parameter(s). Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect.

What it means

DeepSeek's thinking (reasoning) mode only supports a subset of chat completion parameters. When validateThinkingParameters (invoked from createRequest) detects that the request options set parameters unsupported in thinking mode (e.g. temperature, top_p, presence_penalty, frequency_penalty), it logs this warning. For backward compatibility the call still proceeds, but the offending parameters are silently ignored by the API.

Source

Thrown at models/spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek/DeepSeekChatModel.java:476

	private void validateThinkingParameters(DeepSeekChatOptions options) {
		if (logger.isWarnEnabled()) {
			ChatCompletionRequest.Thinking thinking = options.getThinking();
			if (thinking == null || ChatCompletionRequest.Thinking.Type.ENABLED == thinking.type()) {
				List<String> ignoredParameters = new ArrayList<>();
				if (options.getTemperature() != null) {
					ignoredParameters.add("temperature");
				}
				if (options.getTopP() != null) {
					ignoredParameters.add("top_p");
				}
				if (options.getPresencePenalty() != null) {
					ignoredParameters.add("presence_penalty");
				}
				if (options.getFrequencyPenalty() != null) {
					ignoredParameters.add("frequency_penalty");
				}
				if (!ignoredParameters.isEmpty()) {
					logger.warn("Thinking mode does not support the " + String.join(", ", ignoredParameters)
							+ " parameter(s). Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect.");
				}
			}
		}
	}

	private List<DeepSeekApi.FunctionTool> getFunctionTools(List<ToolDefinition> toolDefinitions) {
		return toolDefinitions.stream().map(toolDefinition -> {
			var function = new DeepSeekApi.FunctionTool.Function(toolDefinition.description(), toolDefinition.name(),
					toolDefinition.inputSchema());
			return new DeepSeekApi.FunctionTool(function);
		}).toList();
	}

	/**
	 * @since 2.0.0
	 */
	@Override

View on GitHub (pinned to 98a7beda4f)

Solutions

  1. Remove or null out temperature, top_p, presence_penalty, and frequency_penalty from the options used for thinking-mode requests.
  2. Build a separate DeepSeekChatOptions instance dedicated to thinking mode with only supported fields set.
  3. Ignore the warning if you intentionally share options, accepting that the parameters have no effect.

Example fix

// before
DeepSeekChatOptions options = DeepSeekChatOptions.builder()
    .temperature(0.7)
    .presencePenalty(0.5)
    .build();
// after
DeepSeekChatOptions options = DeepSeekChatOptions.builder()
    .build(); // sampling/penalty params unsupported in thinking mode
Defensive patterns

Strategy: validation

Validate before calling

if (options.getThinking() != null) {
    assert options.getTemperature() == null && options.getTopP() == null
        && options.getPresencePenalty() == null && options.getFrequencyPenalty() == null
        : "thinking mode ignores temperature/topP/penalties";
}

Prevention

When it happens

Trigger: Calling DeepSeekChatModel.call/stream (via createRequest) with DeepSeekChatOptions where thinking is enabled AND any of temperature, top_p, presence_penalty, or frequency_penalty is non-null.

Common situations: Reusing a shared ChatOptions bean with penalty/temperature settings across both normal and thinking-mode requests; migrating an existing app to DeepSeek reasoner without stripping sampling options; copying options from another model that requires temperature tuning.

Related errors


AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11). Data as JSON: /api/errors/6fb840caaf0f94e2. Report an issue: GitHub.