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.
zccyman
force-pushed
the
fix/mimo-thinking-param-27325
branch
from
May 18, 2026 00:36
ca2d16a to
fe750d9
Compare
Contributor
|
Thanks for the focused Xiaomi provider fix. The premise remains valid on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
teknium1
added a commit
that referenced
this pull request
Jun 15, 2026
Salvages the Xiaomi MiMo thinking/replay fixes from #27886/#25379/#26802/#27363 into one provider cluster, with MiMo reasoning replay enabled for native Xiaomi endpoints plus Nous/OpenRouter Xiaomi slugs. Co-authored-by: EloquentBrush0x <283442588+EloquentBrush0x@users.noreply.github.com> Co-authored-by: Peterson <pppan2003@gmail.com> Co-authored-by: Zhao Zhuoran <zhao.zr11@protonmail.com> Co-authored-by: zccyman <zccyman@users.noreply.github.com>
jh1nresh
pushed a commit
to jh1nresh/hermes-agent
that referenced
this pull request
Aug 26, 2026
Salvages the Xiaomi MiMo thinking/replay fixes from NousResearch#27886/NousResearch#25379/NousResearch#26802/NousResearch#27363 into one provider cluster, with MiMo reasoning replay enabled for native Xiaomi endpoints plus Nous/OpenRouter Xiaomi slugs. Co-authored-by: EloquentBrush0x <283442588+EloquentBrush0x@users.noreply.github.com> Co-authored-by: Peterson <pppan2003@gmail.com> Co-authored-by: Zhao Zhuoran <zhao.zr11@protonmail.com> Co-authored-by: zccyman <zccyman@users.noreply.github.com>
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.