Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

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

Closed
ghost wants to merge 1 commit into
mainfrom
fix/gpt5-temperature-parameter
Closed

fix: remove temperature parameter for GPT-5 models#6966
ghost wants to merge 1 commit into
mainfrom
fix/gpt5-temperature-parameter

Conversation

@ghost

@ghostghost commented Aug 12, 2025

Copy link
Copy Markdown

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
@ghost
ghost requested review from cte, jr and mrubens as code ownersAugust 12, 2025 02:15
@dosubotdosubotBot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Aug 12, 2025

@ghostghost left a comment

Copy link
Copy Markdown
Author

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.

reasoning?: { effort: ReasoningEffortWithMinimal; summary?: "auto" }
text?: { verbosity: VerbosityLevel }
temperature?: number
// temperature parameter removed - GPT-5 no longer supports it

Copy link
Copy Markdown
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?

// Special case for o1, o3-mini, and GPT-5 models, which don't support temperature.
// 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
Copy Markdown
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?

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

Copy link
Copy Markdown
Member

Closing in favor of #6969

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugSomething isn't workingIssue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.size:SThis PR changes 10-29 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

GPT-5 no longer supports the temperature parameter

3 participants

@daniel-lxs@hannesrudolph@roomote