feat(providers): declarative reasoning_effort_max for deep-reasoning providers - #49355
Closed
leriou wants to merge 1 commit into
Closed
feat(providers): declarative reasoning_effort_max for deep-reasoning providers#49355leriou wants to merge 1 commit into
leriou wants to merge 1 commit into
Conversation
…providers
Some providers (Z.AI/GLM-5.2, etc.) expose a deeper-than-default reasoning
tier via a single top-level reasoning_effort parameter (e.g. max).
Hermes' /reasoning xhigh command had no effect on these providers because
they don't override build_api_kwargs_extras and the base implementation
returned ({}, {}) unconditionally.
Add a declarative reasoning_effort_max field to ProviderProfile. When set,
the base build_api_kwargs_extras maps effort=xhigh to
reasoning_effort=<value> as a top-level kwarg — no subclass needed.
Providers that don't set the field are unaffected (still ({}, {})).
Contributor
|
Thanks for the declarative provider-profile proposal. This is now implemented on
The linked #51482 concerns a related Ollama Cloud reasoning-effort path; the direct Z.AI behavior requested here is already covered on main. |
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.
What
Some providers (Z.AI/GLM-5.2, etc.) expose a deeper-than-default reasoning tier via a single top-level
reasoning_effortparameter (e.g."max"). Hermes'/reasoning xhighcommand had no effect on these providers — they don't overridebuild_api_kwargs_extras, so the base method returned({}, {})unconditionally.How
Add a declarative
reasoning_effort_max: str | Nonefield toProviderProfile. When set, the basebuild_api_kwargs_extrasmaps effort=xhigh→reasoning_effort=<value>as a top-level kwarg. No subclass needed.Why not override
The existing pattern is Nous/OpenRouter/MiniMax each overriding
build_api_kwargs_extraswith full custom logic. But providers like Z.AI/GLM only need a single parameter — a full override for one line of actual logic is noise. The declarative field follows the same philosophy asdefault_aux_modelanddefault_max_tokens: simple things stay declarative.Impact
reasoning_effort_max→ zero change (still({}, {}))build_api_kwargs_extrasentirely → unaffected (their override wins)