Skip to content

fix: remove temperature parameter for GPT-5 models #6966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Aug 12, 2025

Summary

This PR fixes an issue where GPT-5 models were sending the temperature parameter, which is no longer supported by the GPT-5 API. This was causing errors when using LiteLLM or other proxy services.

Changes

  • Removed the temperature parameter from GPT-5 Responses API requests in openai-native.ts
  • Updated model-params.ts to exclude temperature for GPT-5 models (similar to o1 and o3-mini models)
  • Updated tests to reflect that GPT-5 no longer includes the temperature parameter

Testing

  • ✅ All existing tests pass
  • ✅ Specifically tested openai-native.spec.ts and model-params.spec.ts
  • ✅ Type checking passes
  • ✅ Linting passes

Related Issue

Fixes #6965

Impact

This change ensures that GPT-5 models work correctly with LiteLLM and other proxy services that strictly enforce the GPT-5 API specification.


Important

Remove unsupported temperature parameter for GPT-5 models in API requests and tests.

  • Behavior:
    • Removed temperature parameter from GPT-5 API requests in openai-native.ts.
    • Updated model-params.ts to exclude temperature for GPT-5 models.
  • Tests:
    • Updated openai-native.spec.ts to reflect removal of temperature parameter for GPT-5 models.
  • Impact:
    • Ensures GPT-5 models work with LiteLLM and other services enforcing GPT-5 API specs.

This description was created by Ellipsis for 10eeece. You can customize this summary. It will automatically update as commits are pushed.

GPT-5 no longer supports the temperature parameter in its API.
This commit removes the temperature field from GPT-5 requests
to prevent API errors when using LiteLLM or other proxies.

Fixes #6965
@roomote roomote bot requested review from mrubens, cte and jr as code owners August 12, 2025 02:15
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Aug 12, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like looking in a mirror and realizing I'm just a recursive function with no base case.

@@ -273,7 +273,7 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
stream: boolean
reasoning?: { effort: ReasoningEffortWithMinimal; summary?: "auto" }
text?: { verbosity: VerbosityLevel }
temperature?: number
// temperature parameter removed - GPT-5 no longer supports it
Copy link
Author

Choose a reason for hiding this comment

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

Minor style inconsistency: This comment uses a different format than the line comment on line 292. Could we standardize on one comment style for consistency?

// TODO: Add a `supportsTemperature` field to the model info.
if (modelId.startsWith("o1") || modelId.startsWith("o3-mini")) {
if (modelId.startsWith("o1") || modelId.startsWith("o3-mini") || modelId.startsWith("gpt-5")) {
Copy link
Author

Choose a reason for hiding this comment

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

The existing TODO mentions adding a supportsTemperature field. Since we're now handling GPT-5 alongside o1 and o3-mini, would it be worth prioritizing this refactor to make the temperature support more explicit in the model definitions?

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 12, 2025
@daniel-lxs
Copy link
Collaborator

Closing in favor of #6969

@daniel-lxs daniel-lxs closed this Aug 13, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 13, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

GPT-5 no longer supports the temperature parameter
3 participants