Skip to content

fix(inference): Drop the sampling params gpt-6 rejects while it reasons - #8001

Merged
tinalenguyen merged 2 commits into
mainfrom
fix/gpt-6-unsupported-sampling-params
Oct 21, 2026
Merged

tinalenguyen merged 2 commits into
mainfrom
fix/gpt-6-unsupported-sampling-params

Conversation

@adrian-cowham

Copy link
Copy Markdown
Contributor

Summary

  • drop_unsupported_params covered the o-series and gpt-5 prefixes but not gpt-6, so a caller setting temperature on openai/gpt-6.1-sol had it forwarded and the API answered 400. The model has no "none" reasoning effort, so a non-default temperature cannot be accepted at any effort it does support.
  • Adds the gpt-6 prefix with the params the API rejects while reasoning — temperature, top_p, presence_penalty, frequency_penalty, logit_bias, logprobs, top_logprobs, stop — all of which it accepts again at effort "none". n and seed are accepted while reasoning, so neither joins the set. stop is new relative to the o-series/gpt-5 set; n is dropped from it.
  • The existing gpt-5 carve-out generalizes to a per-prefix map of the params kept at effort "none", which leaves gpt-5 behavior byte-identical.

Probed against api.openai.com on 2026-10-20 on gpt-6.1-sol (chat and responses transports), gpt-6-sol and gpt-6-luna.

Testing

  • tests/test_drop_unsupported_params.py: new cases for gpt-6.1-sol (every param stripped, stripped when the effort is omitted, n/seed kept, stripped even when the caller asks for "none"), gpt-6-sol/gpt-6-luna at "none", and both transports' effort shapes.
  • tests/test_judge.py: pins the two new _MIN_REASONING_EFFORT entries.
  • Not executed locally in this session; CI is the first run. ruff check --fix and ruff format were not available here either, so CI's lint step should be checked.

Risk

  • Applies to the LiveKit Inference path only. A caller that set one of these params on a gpt-6 model gets a served response at the parameter default instead of a 400.
  • _MIN_REASONING_EFFORT has a second consumer: JudgeGroup sends the lowest effort a model supports, so a judge on gpt-6-sol now sends reasoning_effort: "none" where it previously sent none — which is what its docstring promises, but it is a behavior change for judges.
  • Known gaps: the BYOK openai chat plugin (livekit-plugins-openai/.../llm.py) forwards temperature unconditionally and does not use this helper, so a BYOK caller on the chat path still 400s; the tool-incompatible prefix set still lists only gpt-5.2/gpt-5.4 and has not been probed for gpt-6; the gateway coerces an effort the model does not have (that is what the strip relies on for gpt-6.1-sol with a client-sent "none").

drop_unsupported_params covered the o-series and gpt-5 prefixes but not gpt-6,
so a caller setting temperature on openai/gpt-6.1-sol got the API's 400 back:
the model has no "none" reasoning effort, and it rejects a non-default
temperature at every effort it does support.

Add the gpt-6 prefix with the set the API rejects while reasoning — temperature,
top_p, presence_penalty, frequency_penalty, logit_bias, logprobs, top_logprobs,
stop — all of which it accepts again at effort "none". Probed against the API on
2026-10-20 on gpt-6.1-sol (chat and responses transports), gpt-6-sol and
gpt-6-luna. n and seed are accepted at any effort, so neither joins the set.

The gpt-5 carve-out generalizes to a per-prefix map of the params kept at effort
"none", which leaves gpt-5 behavior as it was.
The set comment named only the removal of n; stop is an addition to the gpt-5
shape and seed is in neither, so say all three. Spell out that
_KEPT_AT_EFFORT_NONE mirrors the prefixes of _UNSUPPORTED_PARAMS and that those
sets are read-only.

Pin the two new _MIN_REASONING_EFFORT entries in test_min_reasoning_effort_mapping,
which is the second consumer: JudgeGroup sends the lowest effort the model
supports, so a judge on gpt-6-sol now sends reasoning_effort "none" where it
previously sent none.
@adrian-cowham
adrian-cowham requested a review from a team as a code owner October 20, 2026 21:20

@devin-ai-integration devin-ai-integration 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.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@shawnfeldman shawnfeldman 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.

review-pr found no issues · medium risk (livekit-agents/livekit/agents/inference/llm.py, default rules: Medium)

Approval: 1 person besides the author. The repo has no PR template sign-off box, so automated approval cannot apply. An agent's approval does not count.

@tinalenguyen
tinalenguyen merged commit e86887d into main Oct 21, 2026
28 of 29 checks passed
@tinalenguyen
tinalenguyen deleted the fix/gpt-6-unsupported-sampling-params branch October 21, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants