Skip to content

feat(llm_openai): make temperature configurable - #1709

Open
madhumitha-chandrasekaran-1 wants to merge 5 commits into
rocketride-org:developfrom
madhumitha-chandrasekaran-1:feat/llm-openai-configurable-temperature
Open

feat(llm_openai): make temperature configurable#1709
madhumitha-chandrasekaran-1 wants to merge 5 commits into
rocketride-org:developfrom
madhumitha-chandrasekaran-1:feat/llm-openai-configurable-temperature

Conversation

@madhumitha-chandrasekaran-1

@madhumitha-chandrasekaran-1 madhumitha-chandrasekaran-1 commented Jul 28, 2026

Copy link
Copy Markdown

Summary

llm_openai hardcoded temperature=0 when constructing ChatOpenAI for
non-reasoning models, with no way to configure it via the node's config. This
forced fully deterministic output regardless of use case — creative writing,
brainstorming, or varied-response pipelines had no way to increase temperature
without editing the node's source directly.

  • Read temperature via config.get('temperature', 0) and pass it through to
    ChatOpenAI(...) instead of the hardcoded 0, porting the pattern already
    working in llm_ollama.
  • Defaults to the current behavior when unset — fully backward-compatible.
  • Reasoning models are untouched (out of scope): they route through the
    Responses API and don't currently pass temperature at all; OpenAI's
    reasoning models reject arbitrary temperature values, so that path is left
    alone rather than risk breaking it.
  • Added a temperature field to services.json, exposed for every profile
    (not just custom), since the motivating use cases (gpt-4o, gpt-5.2, etc.)
    apply to named models as much as custom ones.
  • Updated README.md (prose + Fields table).

Scoped to llm_openai only, per the issue's own scope note — other providers
with the same hardcoding (llm_mistral, llm_bedrock, llm_baidu_qianfan,
llm_gmi_cloud, llm_perplexity, llm_ibm_watson) can follow in separate
PRs.

Closes #1660

Test plan

  • ./builder nodes:test --pytest-pattern="llm_openai" — 12 passed
  • ruff check / ruff format --check clean
  • Verified default behavior is unchanged when temperature is unset

Summary by CodeRabbit

  • New Features
    • Added configurable temperature for non-reasoning OpenAI models (default: 0, range 0–2).
    • Updated the OpenAI node configuration to expose temperature in the available settings.
    • Temperature is ignored for reasoning-capable models (reasoning behavior remains controlled separately).
  • Documentation
    • Updated the OpenAI LLM node README to explain temperature defaults, valid range, and how it applies by model profile type.

temperature was hardcoded to 0 when constructing ChatOpenAI for
non-reasoning models, with no way to override it via the node's config.
This forced fully deterministic output regardless of use case, with no
path for creative writing, brainstorming, or varied-response pipelines
short of editing the node's source directly.

Read temperature via config.get('temperature', 0) and pass it through
to ChatOpenAI(...) instead of the hardcoded 0, following the existing
pattern already working in llm_ollama. Defaults to the current
behavior when unset, so it's fully backward-compatible. Exposed for
every OpenAI profile (not just custom), since the motivating use cases
apply to named models like gpt-4o/gpt-5.2 as much as custom ones.

Closes rocketride-org#1660
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f57abc97-7892-4078-bc2d-f50c3d1f2470

📥 Commits

Reviewing files that changed from the base of the PR and between 53a3c3a and e8eabc2.

📒 Files selected for processing (2)
  • nodes/src/nodes/llm_openai/README.md
  • nodes/src/nodes/llm_openai/services.json

📝 Walkthrough

Walkthrough

The OpenAI node exposes configurable temperature, passes it to non-reasoning ChatOpenAI clients, preserves a default of 0, and documents that reasoning models ignore this setting.

Changes

OpenAI temperature configuration

Layer / File(s) Summary
Temperature configuration contract
nodes/src/nodes/llm_openai/services.json, nodes/src/nodes/llm_openai/README.md
The service schema and pipe shape expose temperature; documentation describes its default, profile availability, and behavior for reasoning models.
Runtime temperature propagation
nodes/src/nodes/llm_openai/openai_client.py
Non-reasoning ChatOpenAI clients read temperature from configuration, defaulting to 0.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: jmaionchi, stepmikhaylov, rod-christensen

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Clear and specific summary of the main change.
Linked Issues check ✅ Passed The changes configure temperature in llm_openai and leave reasoning-model behavior unchanged, matching issue #1660.
Out of Scope Changes check ✅ Passed All modified files are in llm_openai and align with the requested config, docs, and client update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.5)
nodes/src/nodes/llm_openai/services.json

File contains syntax errors that prevent linting: Line 2: Expected a property but instead found '//'.; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 16: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 22: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 28: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 34: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 40: End of file expected; Line 45: End of file expected; Li

... [truncated 12798 characters] ...

instead found '// openrouter'.; Line 545: expected , but instead found "capabilities"; Line 554: Expected a property but instead found '// openrouter'.; Line 555: expected , but instead found "modelOutputTokens"; Line 555: Expected a property but instead found '// openrouter'.; Line 556: expected , but instead found "capabilities"; Line 81: End of file expected; Line 562: End of file expected; Line 569: End of file expected; Line 569: End of file expected; Line 569: End of file expected; Line 1238: End of file expected; Line 1244: End of file expected; Line 1244: End of file expected; Line 1244: End of file expected; Line 1250: End of file expected; Line 1258: End of file expected; Line 1258: End of file expected; Line 1258: End of file expected; Line 1292: End of file expected


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nodes/src/nodes/llm_openai/services.json`:
- Around line 580-584: Revise the temperature documentation to avoid
guaranteeing deterministic output: in nodes/src/nodes/llm_openai/services.json
lines 580-584, change the description to state that 0 is generally more
deterministic; in nodes/src/nodes/llm_openai/README.md lines 13-16, replace the
claim that responses are deterministic with equivalent probabilistic wording.
Update documentation only; no code behavior changes are needed.
- Around line 580-584: The temperature field definition in services.json
currently accepts any number; update the temperature schema to enforce a minimum
of 0 and maximum of 2, so invalid values are rejected during configuration
validation before reaching ChatOpenAI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 485f8727-748f-454b-ad86-ffae21902028

📥 Commits

Reviewing files that changed from the base of the PR and between 1483794 and 647ad1b.

📒 Files selected for processing (3)
  • nodes/src/nodes/llm_openai/README.md
  • nodes/src/nodes/llm_openai/openai_client.py
  • nodes/src/nodes/llm_openai/services.json

Comment thread nodes/src/nodes/llm_openai/services.json
- Bound temperature to [0, 2] (OpenAI's accepted range) so out-of-range
  values fail config validation before reaching the client.
- Soften "deterministic" claims to reflect that temperature 0 does not
  guarantee identical OpenAI output for identical input.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
nodes/src/nodes/llm_openai/README.md (1)

53-53: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the supported temperature range.

services.json rejects values outside 02, but the hand-written README does not state that range. Add it to the field description so users know the accepted values before configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nodes/src/nodes/llm_openai/README.md` at line 53, Update the temperature
field description in the README to state that accepted values range from 0 to 2,
while preserving the existing default, profile availability, and reasoning-model
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Line 53: Update the temperature field description in the README to state that
accepted values range from 0 to 2, while preserving the existing default,
profile availability, and reasoning-model behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a2e78a2c-4a35-4ec2-a5df-683449b02b19

📥 Commits

Reviewing files that changed from the base of the PR and between 647ad1b and 2e59bf8.

📒 Files selected for processing (2)
  • nodes/src/nodes/llm_openai/README.md
  • nodes/src/nodes/llm_openai/services.json

services.json bounds temperature to [0, 2]; the README field table
didn't state that range.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
nodes/src/nodes/llm_openai/README.md (1)

53-57: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Regenerate the README schema section.

The new temperature field is documented here, but the generated schema block later in this README still omits it. Run nodes:docs-generate so the user-facing schema matches services.json; do not manually edit the generated block.

As per coding guidelines, content between ROCKETRIDE:GENERATED:PARAMS START and ROCKETRIDE:GENERATED:PARAMS END must be regenerated.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nodes/src/nodes/llm_openai/README.md` around lines 53 - 57, Regenerate the
README schema section using the nodes:docs-generate command so the generated
block between ROCKETRIDE:GENERATED:PARAMS START and ROCKETRIDE:GENERATED:PARAMS
END includes the temperature field from services.json; do not edit that
generated block manually.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Around line 53-57: Regenerate the README schema section using the
nodes:docs-generate command so the generated block between
ROCKETRIDE:GENERATED:PARAMS START and ROCKETRIDE:GENERATED:PARAMS END includes
the temperature field from services.json; do not edit that generated block
manually.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ae79e223-39fa-4423-a2d6-ffeee84f0d9b

📥 Commits

Reviewing files that changed from the base of the PR and between 2e59bf8 and f2118a8.

📒 Files selected for processing (1)
  • nodes/src/nodes/llm_openai/README.md

Run via nodes:docs-generate (with a temporary branch rename to satisfy
its release-track-branch gate, then reverted) rather than hand-editing
the generated block, per the repo's doc-generation convention.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nodes/src/nodes/llm_openai/README.md`:
- Line 138: The temperature field’s generated documentation omits its documented
default. Update the temperature definition in services.json to declare a default
value of 0, then rerun nodes:docs-generate so the README table is regenerated;
do not edit the generated README block directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 86c2ed0c-a07f-42b4-b85c-e65e8fe4f694

📥 Commits

Reviewing files that changed from the base of the PR and between f2118a8 and 53a3c3a.

📒 Files selected for processing (1)
  • nodes/src/nodes/llm_openai/README.md

Comment thread nodes/src/nodes/llm_openai/README.md Outdated
Add "default": 0 to services.json so the generated Schema table's
Default column isn't blank, and drop the now-redundant "Defaults to
0." prose from the description (the default field carries it).
Regenerated via nodes:docs-generate (temporary branch rename to
satisfy its release-track gate, reverted after), not hand-edited.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(llm_openai): make temperature configurable (currently hardcoded to 0)

2 participants