fix(xiaomi): pass thinking param to MiMo API#27363
Open
zccyman wants to merge 1 commit into
Open
Conversation
This comment was marked as spam.
This comment was marked as spam.
ca2d16a to
fe750d9
Compare
Contributor
|
Thanks for the focused Xiaomi provider fix. I verified the premise against current main: Problems
Suggested changes
Overall this looks highly salvageable: the fix is in the right provider-profile layer and matches the existing transport hook. This is an automated hermes-sweeper review. |
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.
Summary
Add a custom Xiaomi provider profile class that emits
extra_body.thinkingto control MiMo thinking mode. When the user configuresreasoning_effort: noneor otherwise disables reasoning, sendsthinking: {type: "disabled"}to prevent unnecessary token consumption.Closes #27325
Problem
Xiaomi MiMo provider used a bare
ProviderProfilewith no overrides — thethinkingparameter was never passed in API requests. MiMo defaults to thinking=enabled, consuming tokens on every request regardless of user config. Settings likereasoning_effort: nonehad no effect on the actual API call.Solution
Replace the bare
ProviderProfilewith aXiaomiProfilesubclass that overridesbuild_api_kwargs_extras, following the same pattern used byKimiProfile:reasoning_config.enabled is False→extra_body.thinking = {type: "disabled"}extra_body.thinking = {type: "enabled"}Only 1 file changed (+45/-2).
Files Changed
plugins/model-providers/xiaomi/__init__.pyXiaomiProfileclass withbuild_api_kwargs_extrasoverride forthinkingparamTest Results
Design Decisions
extra_body.thinkingapproach viaKimiProfile.build_api_kwargs_extras. Xiaomi uses the same OpenAI-compatible API format.