Skip to content

Set default temperature to None instead of 0.0 - #1989

Merged
neubig merged 25 commits into
mainfrom
fix-default-temperature-to-none
Mar 2, 2026
Merged

neubig merged 25 commits into
mainfrom
fix-default-temperature-to-none

Conversation

@neubig

@neubig neubig commented Feb 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Change get_default_temperature to return None by default instead of 0.0. This allows models to use their provider's default temperature setting rather than forcing temperature=0.0 for all models.

Motivation

As discussed in #1913, always setting temperature=0.0 causes issues with some models (like claude-4.6) that don't accept this value. By returning None, we let the provider use their own default temperature, which:

  1. Avoids errors from providers that don't accept certain temperature values
  2. Ensures new models work out of the box without needing explicit configuration
  3. Simplifies the codebase by removing unnecessary default values

Changes

  • get_default_temperature() now returns float | None instead of float
  • Default return value changed from 0.0 to None
  • Models with specific temperature requirements (kimi-k2-thinking, kimi-k2.5) still explicitly return 1.0
  • Updated field description in LLM class to reflect the new behavior
  • Updated tests to expect None instead of 0.0

Testing

All 583 LLM tests pass. Pre-commit hooks pass on all modified files.

Fixes #1913

@neubig can click here to continue refining the PR


Agent Server images for this PR

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:d16286a-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-d16286a-python \
  ghcr.io/openhands/agent-server:d16286a-python

All tags pushed for this build

ghcr.io/openhands/agent-server:d16286a-golang-amd64
ghcr.io/openhands/agent-server:d16286a-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:d16286a-golang-arm64
ghcr.io/openhands/agent-server:d16286a-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:d16286a-java-amd64
ghcr.io/openhands/agent-server:d16286a-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:d16286a-java-arm64
ghcr.io/openhands/agent-server:d16286a-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:d16286a-python-amd64
ghcr.io/openhands/agent-server:d16286a-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:d16286a-python-arm64
ghcr.io/openhands/agent-server:d16286a-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:d16286a-golang
ghcr.io/openhands/agent-server:d16286a-java
ghcr.io/openhands/agent-server:d16286a-python

About Multi-Architecture Support

  • Each variant tag (e.g., d16286a-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., d16286a-python-amd64) are also available if needed

Change get_default_temperature to return None by default instead of 0.0.
This allows models to use their provider's default temperature setting
rather than forcing temperature=0.0 for all models.

Models with specific temperature requirements (kimi-k2-thinking, kimi-k2.5)
still explicitly return 1.0.

Fixes #1913

Co-authored-by: openhands <openhands@all-hands.dev>
@neubig

neubig commented Feb 11, 2026

Copy link
Copy Markdown
Member Author

@OpenHands check the failing CI, merge main, reproduce locally, and fix any issues.

@openhands-ai

openhands-ai Bot commented Feb 11, 2026

Copy link
Copy Markdown

I'm on it! neubig can track my progress at all-hands.dev

Update test to expect temperature=None instead of 0.0, aligning with
the PR's change to get_default_temperature() returning None by default.

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai

openhands-ai Bot commented Feb 11, 2026

Copy link
Copy Markdown

Summary

I've successfully addressed the failing CI for PR #1989 by:

Completed Tasks:

  1. ✅ Checked the failing CI - Identified that the sdk-tests job was failing with test_llm_config_defaults expecting temperature == 0.0 but getting None

  2. ✅ Merged main - Merged origin/main into the fix-default-temperature-to-none branch to incorporate the latest changes

  3. ✅ Reproduced locally - Ran the failing test locally and confirmed the issue

  4. ✅ Fixed the issue - Updated tests/sdk/config/test_llm_config.py to expect temperature is None instead of temperature == 0.0, aligning with the PR's intended change to get_default_temperature() returning None by default

Change Made:

-    assert config.temperature == 0.0
+    assert config.temperature is None  # None to use provider defaults

Verification:

  • All 15 tests in test_llm_config.py pass
  • All 130 tests in test_model_features.py pass

Pushed:

The fix has been pushed to the fix-default-temperature-to-none branch. The CI should now pass.

View full conversation

@github-actions

github-actions Bot commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/llm
   llm.py4757883%424, 477, 698, 804, 806–807, 835, 881, 892–894, 898–902, 910–912, 922–924, 927–928, 932, 934–935, 937, 1115, 1120–1121, 1318–1319, 1328, 1341, 1343–1348, 1350–1367, 1370–1374, 1376–1377, 1383–1392, 1443, 1445
openhands-sdk/openhands/sdk/llm/utils
   model_features.py40197%32
TOTAL19037567970% 

@neubig
neubig marked this pull request as ready for review February 11, 2026 01:19

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Taste Rating: Acceptable

Pragmatic fix to a real problem, but breaks existing behavior without proper user migration guidance.

The core change is simple and solves the claude-4.6 incompatibility issue. However, this is a significant behavior change that moves from deterministic outputs (temp=0.0) to provider-dependent defaults. See inline comments for specific concerns.

VERDICT: ✅ Worth merging after addressing migration documentation

KEY INSIGHT: This is the right technical fix, but users who relied on deterministic behavior need explicit guidance on setting temperature=0.0 in their configs.

Comment thread tests/sdk/llm/test_model_features.py Resolved
Comment thread openhands-sdk/openhands/sdk/llm/llm.py Resolved
enyst and others added 4 commits February 11, 2026 03:10
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>

@enyst enyst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! I think maybe we can then remove the DEFAULT_TEMPERATURE_MODELS too? That’s there because Kimi is a reasoning model that doesn’t accept effort, if I recall correctly, but it needs temperature 1 like reasoning models.

I had the agent test Kimi:

  • for 2.5, it worked fine with None
  • for 2-thinking, no deployments found. (maybe it’s legacy now; we may want to remove it from eval proxy, since it doesn’t appear to work anymore)

Please see PR:

openhands-agent and others added 6 commits February 11, 2026 15:36
Addresses review comment asking for more explicit documentation about:
- What None means (provider default)
- How to get deterministic behavior (explicitly set 0.0)
- The typical temperature range

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: OpenHands Bot <contact@all-hands.dev>
As per enyst's suggestion on PR #1989:
- Remove DEFAULT_TEMPERATURE_MODELS entirely
- get_default_temperature() now returns None for all models
- This simplifies the codebase and lets all models use their provider's default temperature
- Previously Kimi 2.5 was tested to work fine with None

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst

enyst commented Feb 11, 2026

Copy link
Copy Markdown
Member

FWIW, PR 1994 is a PR to this PR. 😅

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Taste Rating: Acceptable - Solves a real problem with elegant simplification, but introduces a breaking change that needs careful consideration.

Verdict: Worth merging with minor improvements to address backward compatibility concerns and design consistency.

Key Insight: This trades deterministic defaults for provider flexibility—a pragmatic choice, but one that changes behavior for all existing users.

Comment thread openhands-sdk/openhands/sdk/llm/llm.py Resolved

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Taste Rating: Needs Rework

This PR simplifies the code (good!) but introduces a breaking change that violates the "never break userspace" principle. Users relying on deterministic outputs (temperature=0.0) will now get unpredictable provider defaults.


[CRITICAL ISSUES] - Must Fix

1. Breaking Change Without Documentation

File: openhands-sdk/openhands/sdk/llm/llm.py (lines 180-185)

🔴 Critical: This description doesn't mention that this is a BREAKING CHANGE. Users who relied on temperature=0.0 for deterministic outputs will now get provider-specific defaults (which vary: OpenAI defaults to 1.0, Anthropic to 1.0, etc.).

You've broken userspace without documenting it. At minimum:

  1. Clear migration guide: "To preserve deterministic behavior, explicitly set temperature=0.0"
  2. Deprecation warning in release notes
  3. Consider a compatibility flag for one release cycle

Suggested fix:

temperature: float | None = Field(
    default=None,
    ge=0,
    description=(
        "Sampling temperature for response generation. "
        "Defaults to None (uses provider default, typically 1.0 for most models). "
        "BREAKING CHANGE: Previously defaulted to 0.0 for deterministic outputs. "
        "To restore deterministic behavior, explicitly set temperature=0.0. "
        "Higher values (0.7-1.0) increase creativity and randomness."
    ),
)

2. Unused Parameter - Code Smell

File: openhands-sdk/openhands/sdk/llm/utils/model_features.py (line 183)

🔴 Critical: The _model parameter is now completely ignored (indicated by the underscore prefix). This is a code smell that screams "delete this function entirely."

If the model parameter is never used, why does this function exist? Either:

  1. Make it a module-level constant: DEFAULT_TEMPERATURE = None
  2. Delete it and use None directly where needed
  3. Or explain why we need the indirection

The function signature promises model-specific logic but delivers nothing. That's broken by design.


[IMPROVEMENT OPPORTUNITIES] - Should Fix

3. Misleading Documentation

File: openhands-sdk/openhands/sdk/llm/utils/model_features.py (lines 184-189)

🟠 Important: The docstring says "Return the default temperature for a given model pattern" but the model is completely ignored. This is a lie.

Suggested fix:

def get_default_temperature(_model: str) -> float | None:
    """Return None to allow providers to use their default temperature.
    
    This function exists for backward compatibility and may be removed in future versions.
    To use provider defaults, pass temperature=None when creating LLM instances.
    """
    return None

4. Missing Integration Tests

File: tests/sdk/llm/test_model_features.py (lines 342-346)

🟠 Important: These tests only verify the function returns None. They don't test what matters:

  1. Does passing temperature=None to a provider actually work?
  2. Does it fix the claude-4.6 issue mentioned in #1913?
  3. What temperature does each provider actually use when None is passed?

You're testing the implementation, not the behavior. Add tests that:

  • Verify LiteLLM/providers accept temperature=None
  • Confirm claude-4.6 no longer errors
  • Document what "provider default" means for major providers

VERDICT

❌ Needs rework: The simplification is good in principle, but the breaking change and unused parameter issues must be addressed first.

KEY INSIGHT

Simplifying code by removing special cases is "good taste" - BUT you cannot break existing user expectations in the process. Either preserve backward compatibility with explicit opt-in to new behavior, or clearly document the breaking change and provide a migration path.

As per review comment on PR #1989:
- Remove the unused _model parameter since DEFAULT_TEMPERATURE_MODELS was removed
- Function now returns None without needing model info
- Updated tests to use new function signature

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst enyst added behavior-initiative This is related to the system prompt sections and LLM steering. and removed behavior-initiative This is related to the system prompt sections and LLM steering. labels Feb 14, 2026
@neubig
neubig requested a review from xingyaoww February 20, 2026 03:25
@xingyaoww xingyaoww added integration-test Runs the integration tests and comments the results test-examples Run all applicable "examples/" files. Expensive operation. labels Feb 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Integration Tests Results

Overall Success Rate: 96.7%
Total Cost: $1.01
Models Tested: 4
Timestamp: 2026-02-20 20:28:31 UTC

📁 Detailed Logs & Artifacts

Click the links below to access detailed agent/LLM logs showing the complete reasoning process for each model. On the GitHub Actions page, scroll down to the 'Artifacts' section to download the logs.

📊 Summary

Model Overall Tests Passed Skipped Total Cost Tokens
litellm_proxy_deepseek_deepseek_reasoner 100.0% 7/7 1 8 $0.04 641,675
litellm_proxy_moonshot_kimi_k2_thinking 100.0% 7/7 1 8 $0.15 629,626
litellm_proxy_anthropic_claude_sonnet_4_6 87.5% 7/8 0 8 $0.43 246,049
litellm_proxy_gemini_3_pro_preview 100.0% 8/8 0 8 $0.39 284,380

📋 Detailed Results

litellm_proxy_deepseek_deepseek_reasoner

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.04
  • Token Usage: prompt: 626,719, completion: 14,956, cache_read: 576,896, reasoning: 6,219
  • Run Suffix: litellm_proxy_deepseek_deepseek_reasoner_701fe65_deepseek_v3_2_reasoner_run_N8_20260220_202356
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

litellm_proxy_moonshot_kimi_k2_thinking

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.15
  • Token Usage: prompt: 616,885, completion: 12,741, cache_read: 555,008
  • Run Suffix: litellm_proxy_moonshot_kimi_k2_thinking_701fe65_kimi_k2_thinking_run_N8_20260220_202357
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

litellm_proxy_anthropic_claude_sonnet_4_6

  • Success Rate: 87.5% (7/8)
  • Total Cost: $0.43
  • Token Usage: prompt: 240,210, completion: 5,839, cache_read: 160,450, cache_write: 79,520, reasoning: 1,099
  • Run Suffix: litellm_proxy_anthropic_claude_sonnet_4_6_701fe65_claude_sonnet_4_6_run_N8_20260220_202356

Failed Tests:

  • t02_add_bash_hello: Shell script is not executable (Cost: $0.05)

litellm_proxy_gemini_3_pro_preview

  • Success Rate: 100.0% (8/8)
  • Total Cost: $0.39
  • Token Usage: prompt: 276,919, completion: 7,461, cache_read: 141,744, reasoning: 5,397
  • Run Suffix: litellm_proxy_gemini_3_pro_preview_701fe65_gemini_3_pro_run_N8_20260220_202354

@github-actions

github-actions Bot commented Feb 20, 2026 •

Copy link
Copy Markdown
Contributor

🔄 Running Examples with openhands/claude-haiku-4-5-20251001

Generated: 2026-02-20 20:47:12 UTC

Example Status Duration Cost
01_standalone_sdk/02_custom_tools.py ✅ PASS 22.4s $0.03
01_standalone_sdk/03_activate_skill.py ✅ PASS 20.1s $0.02
01_standalone_sdk/05_use_llm_registry.py ✅ PASS 11.9s $0.01
01_standalone_sdk/07_mcp_integration.py ✅ PASS 30.9s $0.02
01_standalone_sdk/09_pause_example.py ✅ PASS 14.0s $0.01
01_standalone_sdk/10_persistence.py ✅ PASS 27.1s $0.02
01_standalone_sdk/11_async.py ✅ PASS 27.5s $0.03
01_standalone_sdk/12_custom_secrets.py ✅ PASS 15.2s $0.01
01_standalone_sdk/13_get_llm_metrics.py ✅ PASS 22.4s $0.02
01_standalone_sdk/14_context_condenser.py ✅ PASS 3m 15s $0.22
01_standalone_sdk/17_image_input.py ✅ PASS 15.2s $0.01
01_standalone_sdk/18_send_message_while_processing.py ✅ PASS 16.3s $0.01
01_standalone_sdk/19_llm_routing.py ✅ PASS 12.8s $0.02
01_standalone_sdk/20_stuck_detector.py ✅ PASS 22.1s $0.03
01_standalone_sdk/21_generate_extraneous_conversation_costs.py ✅ PASS 9.8s $0.00
01_standalone_sdk/22_anthropic_thinking.py ✅ PASS 14.9s $0.01
01_standalone_sdk/23_responses_reasoning.py ✅ PASS 1m 40s $0.02
01_standalone_sdk/24_planning_agent_workflow.py ✅ PASS 3m 31s $0.25
01_standalone_sdk/25_agent_delegation.py ✅ PASS 2m 15s $0.18
01_standalone_sdk/26_custom_visualizer.py ✅ PASS 19.0s $0.03
01_standalone_sdk/28_ask_agent_example.py ✅ PASS 33.1s $0.03
01_standalone_sdk/29_llm_streaming.py ✅ PASS 33.3s $0.03
01_standalone_sdk/30_tom_agent.py ✅ PASS 19.5s $0.02
01_standalone_sdk/31_iterative_refinement.py ✅ PASS 5m 7s $0.36
01_standalone_sdk/32_configurable_security_policy.py ✅ PASS 19.2s $0.01
01_standalone_sdk/34_critic_example.py ❌ FAIL
Exit code 1
3.8s --
01_standalone_sdk/36_event_json_to_openai_messages.py ✅ PASS 11.6s $0.01
01_standalone_sdk/37_llm_profile_store.py ✅ PASS 3.5s $0.00
01_standalone_sdk/38_browser_session_recording.py ❌ FAIL
Timed out after 600 seconds
10m 0s $0.05
01_standalone_sdk/39_llm_fallback.py ✅ PASS 9.5s $0.01
02_remote_agent_server/01_convo_with_local_agent_server.py ✅ PASS 51.6s $0.04
02_remote_agent_server/02_convo_with_docker_sandboxed_server.py ✅ PASS 1m 30s $0.03
02_remote_agent_server/03_browser_use_with_docker_sandboxed_server.py ✅ PASS 54.2s $0.06
02_remote_agent_server/04_convo_with_api_sandboxed_server.py ✅ PASS 1m 35s $0.02
02_remote_agent_server/07_convo_with_cloud_workspace.py ✅ PASS 30.6s $0.02
02_remote_agent_server/08_convo_with_apptainer_sandboxed_server.py ✅ PASS 3m 15s $0.01
04_llm_specific_tools/01_gpt5_apply_patch_preset.py ✅ PASS 25.1s $0.03
04_llm_specific_tools/02_gemini_file_tools.py ✅ PASS 46.1s $0.07
05_skills_and_plugins/01_loading_agentskills/main.py ✅ PASS 16.2s $0.01
05_skills_and_plugins/02_loading_plugins/main.py ✅ PASS 7.6s $0.01

❌ Some tests failed

Total: 40 | Passed: 38 | Failed: 2 | Total Cost: $1.78

Failed examples:

  • examples/01_standalone_sdk/34_critic_example.py: Exit code 1
  • examples/01_standalone_sdk/38_browser_session_recording.py: Timed out after 600 seconds

View full workflow run

@enyst

enyst commented Feb 21, 2026

Copy link
Copy Markdown
Member

What do you think about this:

  • we could add temperature and top_p to models config file, equal to what were all evaluated at
    (existing evals)
  • maybe also two columns to the evals spreadsheet (V1) for people to see easily
  • verification: the agent could double check or make a script to double check the values in base_state.json/logs compared with models config file?

@neubig

neubig commented Feb 21, 2026

Copy link
Copy Markdown
Member Author

Do you mean in our eval results? I think we may want to deprecate the spreadsheet in favor of using the openhands index pretty soon, but we could make sure that info is recorded somewhere.

@all-hands-bot

Copy link
Copy Markdown
Collaborator

[Automatic Post]: This PR seems to be currently waiting for review. @enyst, @xingyaoww, @openhands-agent, could you please take a look when you have a chance?

@github-actions

github-actions Bot commented Feb 28, 2026 •

Copy link
Copy Markdown
Contributor

API breakage checks (Griffe)

Result: Failed

Log excerpt (first 1000 characters)

============================================================
Checking openhands-sdk (openhands.sdk)
============================================================
Comparing openhands-sdk 1.11.5 against 1.11.4
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): load_public_skills
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): temperature
::warning file=openhands-sdk/openhands/sdk/llm/llm.py,line=190,title=LLM.top_p::Attribute value was changed: `Field(default=1.0, ge=0, le=1)` -> `Field(default=None, ge=0, le=1, description='Nucleus sampling parameter. Defaults to None (uses provider default). Set to a value between 0 and 1 to control diversity of outputs.')`
::error title=SemVer::Breaking changes detected (1); require at least minor version bump from 1.11.x, but new is 1.11.5

============================================================
Checking openhands-workspace (openhands.workspace)
============================

Action log

@neubig

neubig commented Feb 28, 2026

Copy link
Copy Markdown
Member Author

@enyst and @xingyaoww please tell me if there's anything else you'd like to see here before we merge it!

@github-actions

github-actions Bot commented Feb 28, 2026 •

Copy link
Copy Markdown
Contributor

Agent server REST API breakage checks (OpenAPI)

Result: Passed

Action log

@enyst

enyst commented Feb 28, 2026 •

Copy link
Copy Markdown
Member

Do you mean in our eval results? I think we may want to deprecate the spreadsheet in favor of using the openhands index pretty soon, but we could make sure that info is recorded somewhere.

Yes, in the V1 eval results. OK, then please ignore the second bullet point (about spreadsheet), just the rest.

For example, I'm almost certain we've been evaluating Gemini with 0, but its provider-default is 1. So the moment we merge this PR, anyone out there evaluating would get a different run.

Edited to add:

@neubig

neubig commented Mar 2, 2026

Copy link
Copy Markdown
Member Author

@OpenHands check resolve_model_config and set it to whatever the default model config for temperature and top_p will be right now if it will change as a result of this PR. Note that this will require research, possibly by looking at the litellm code or researching online.

@openhands-ai

openhands-ai Bot commented Mar 2, 2026

Copy link
Copy Markdown

I'm on it! neubig can track my progress at all-hands.dev

Since the SDK default temperature is changing from 0.0 to None (provider
default), we need to explicitly set temperature values in resolve_model_config.py
to maintain consistent eval behavior.

Changes:
- Add temperature=0.0 for models that previously relied on SDK default:
  gemini-3-pro, gemini-3-flash, gemini-3.1-pro, minimax-m2, minimax-m2.1,
  qwen-3-coder, glm-4.7, glm-5, qwen3-coder-next, qwen3-coder-30b-a3b-instruct,
  gpt-oss-20b
- Add temperature=1.0 for kimi-k2-thinking (previously set by SDK's
  get_default_temperature)

Models intentionally left without explicit temperature (use provider default):
- qwen3-max-thinking (thinking/reasoning model)
- gpt-5.2, gpt-5.2-codex, gpt-5.2-high-reasoning (only support temp=1)
- deepseek-v3.2-reasoner (reasoning model)

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai

openhands-ai Bot commented Mar 2, 2026

Copy link
Copy Markdown

Summary

I've addressed the request to update resolve_model_config.py to maintain backward-compatible temperature defaults after this PR changes the SDK default from 0.0 to None.

Research Finding

When temperature=None is passed to LiteLLM, it omits the temperature parameter from the API request entirely, allowing each provider to use their own default temperature.

Changes Made (already pushed)

Commit: fix(eval): add explicit temperature settings for eval models

Model Temperature Added Reason
kimi-k2-thinking 1.0 Previously set by SDK's get_default_temperature()
gemini-3-pro, gemini-3-flash, gemini-3.1-pro 0.0 Deterministic eval output
minimax-m2, minimax-m2.1 0.0 Deterministic eval output
qwen-3-coder, qwen3-coder-next, qwen3-coder-30b-a3b-instruct 0.0 Deterministic eval output
glm-4.7, glm-5 0.0 Deterministic eval output
gpt-oss-20b 0.0 Deterministic eval output

Models left without explicit temperature (intentionally use provider default):

  • qwen3-max-thinking - Thinking model
  • gpt-5.2, gpt-5.2-codex, gpt-5.2-high-reasoning - Only support temperature=1
  • deepseek-v3.2-reasoner - Reasoning model with constraints

Checklist

  • ✅ Researched LiteLLM behavior for temperature=None
  • ✅ Added explicit temperature for models that previously relied on SDK default
  • ✅ Preserved special case for kimi-k2-thinking (temperature=1.0)
  • ✅ Left reasoning models without explicit temperature (they have constraints)
  • ✅ Pre-commit hooks pass
  • ✅ Changes committed and pushed

@xingyaoww xingyaoww left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This seems reasonable to me, and as long as all integration test are passing, it is fine w/ me

@xingyaoww xingyaoww added integration-test Runs the integration tests and comments the results and removed integration-test Runs the integration tests and comments the results labels Mar 2, 2026
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly.

@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

🧪 Integration Tests Results

Overall Success Rate: 96.7%
Total Cost: $1.14
Models Tested: 4
Timestamp: 2026-03-02 15:03:17 UTC

📁 Detailed Logs & Artifacts

Click the links below to access detailed agent/LLM logs showing the complete reasoning process for each model. On the GitHub Actions page, scroll down to the 'Artifacts' section to download the logs.

📊 Summary

Model Overall Tests Passed Skipped Total Cost Tokens
litellm_proxy_deepseek_deepseek_reasoner 100.0% 7/7 1 8 $0.05 851,765
litellm_proxy_gemini_3_pro_preview 100.0% 8/8 0 8 $0.43 269,378
litellm_proxy_anthropic_claude_sonnet_4_6 87.5% 7/8 0 8 $0.44 254,535
litellm_proxy_moonshot_kimi_k2_thinking 100.0% 7/7 1 8 $0.22 994,631

📋 Detailed Results

litellm_proxy_deepseek_deepseek_reasoner

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.05
  • Token Usage: prompt: 838,251, completion: 13,514, cache_read: 755,008, reasoning: 5,450
  • Run Suffix: litellm_proxy_deepseek_deepseek_reasoner_9f007bc_deepseek_v3_2_reasoner_run_N8_20260302_145404
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

litellm_proxy_gemini_3_pro_preview

  • Success Rate: 100.0% (8/8)
  • Total Cost: $0.43
  • Token Usage: prompt: 263,171, completion: 6,207, cache_read: 95,059, reasoning: 4,482
  • Run Suffix: litellm_proxy_gemini_3_pro_preview_9f007bc_gemini_3_pro_run_N8_20260302_145404

litellm_proxy_anthropic_claude_sonnet_4_6

  • Success Rate: 87.5% (7/8)
  • Total Cost: $0.44
  • Token Usage: prompt: 248,762, completion: 5,773, cache_read: 168,673, cache_write: 79,841, reasoning: 1,118
  • Run Suffix: litellm_proxy_anthropic_claude_sonnet_4_6_9f007bc_claude_sonnet_4_6_run_N8_20260302_145404

Failed Tests:

  • t02_add_bash_hello: Shell script is not executable (Cost: $0.05)

litellm_proxy_moonshot_kimi_k2_thinking

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.22
  • Token Usage: prompt: 988,888, completion: 5,743, cache_read: 861,440
  • Run Suffix: litellm_proxy_moonshot_kimi_k2_thinking_9f007bc_kimi_k2_thinking_run_N8_20260302_145405
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

@neubig
neubig merged commit 60347e9 into main Mar 2, 2026
46 checks passed
@neubig
neubig deleted the fix-default-temperature-to-none branch March 2, 2026 15:11
zparnold added a commit to zparnold/software-agent-sdk that referenced this pull request Mar 5, 2026
StressTestor pushed a commit to StressTestor/software-agent-sdk that referenced this pull request Jun 1, 2026
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: enyst <engel.nyst@gmail.com>
Co-authored-by: OpenHands Bot <contact@all-hands.dev>
Co-authored-by: neubig <neubig@users.noreply.github.com>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-test Runs the integration tests and comments the results needs-review test-examples Run all applicable "examples/" files. Expensive operation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: Always set temperature to default?

5 participants