Merged
Conversation
knjiang
commented
Feb 5, 2026
| // Force translation if model needs any transforms (temperature stripping, max_tokens conversion, etc.) | ||
| let request_model = payload.get("model").and_then(Value::as_str).or(model); | ||
| request_model | ||
| .map(|m| !model_supports_max_tokens(m)) |
Contributor
Author
There was a problem hiding this comment.
basically we force translation in order for "capabilities" to apply
knjiang
commented
Feb 5, 2026
Comment on lines
235
to
-240
|
|
||
| // Pass temperature through for non-reasoning models | ||
| // Reasoning models (o1-*, o3-*, gpt-5-*) don't support temperature | ||
| if !is_reasoning_model(model) { | ||
| insert_opt_f64(&mut obj, "temperature", req.params.temperature); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
we already supported this for responses api - im using the same abstraction instead apply_model_transforms for both responses/chat completions since they use same model family
remh
requested changes
Feb 5, 2026
| ForceMaxCompletionTokens => { | ||
| // (Responses API) max_output_tokens is valid. | ||
| if obj.contains_key("max_output_tokens") { | ||
| return; |
Contributor
There was a problem hiding this comment.
shouldn't this be continue instead of return ?
Contributor
There was a problem hiding this comment.
Let's add some unit tests to the functions here
remh
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleted a bunch of dead code and added support for stripping temperature.