0

Xiaomi MiMo Provider

Xiaomi MiMo Provider explains the cloud layer of MTPX with practical guidance for building inspectable, tool-using agents.

Xi
Xiaomi MiMo Provider
Chapter 042ProvidersCloudIndex
01Orientation

Xiaomi MiMo Provider belongs to the providers track. The page breaks the idea into responsibilities, implementation rules, failure modes, and the signals you should expose in a product UI.

Use this when

Use this when you need to understand how xiaomi mimo provider affects a real MTPX agent before you wire it into an application.

  • What xiaomi mimo provider owns in the runtime.
  • How it connects to planning, tool execution, events, providers, or storage.
  • What to log, test, and expose to users when this layer is active.
  • Common mistakes that make agent systems hard to inspect.
02 / syntax starter
from mtp import Agent
from mtp.providers import Groq

agent = Agent.MTPAgent(
    provider=Groq(model="llama-3.3-70b-versatile"),
    tools=tools,
)
03 / manual

Read the system

The complete source manual—syntax, examples, linked references, edge cases, and implementation notes.

Documentation index ↗

Xiaomi MiMo provides an OpenAI-compatible API with built-in thinking/reasoning support. Features adaptive thinking mode management.

Install

bashpip install "mtpx[xiaomi]"

This installs the openai SDK:

bashpip install openai

API Key Setup

  1. Install dotenv support:
bash   pip install python-dotenv

Or with the MTP extra:

bash   pip install "mtpx[dotenv]"
  1. Create a .env file in your project root:
text   MIMO_API_KEY=your_key_here
  1. Load it in your code before creating the provider:
python   from mtp import Agent

   Agent.load_dotenv_if_available()  # reads .env file

Option 2: System environment variable

bash# Linux/macOS
export MIMO_API_KEY="..."

# Windows PowerShell
$env:MIMO_API_KEY="..."

Quick Start

pythonfrom mtp import Agent
from mtp.providers import Xiaomi

Agent.load_dotenv_if_available()  # loads MIMO_API_KEY from .env

provider = Xiaomi(model="mimo-v2.5-pro")
tools = Agent.ToolRegistry()
agent = Agent(provider=provider, tools=tools)

reply = agent.run_loop("What is 25 * 4 + 10?")
print(reply)

Parameters

ParameterTypeDefaultDescription
modelstr"mimo-v2.5-pro"MiMo model ID
api_keystr | NoneNoneAPI key (falls back to MIMO_API_KEY env var)
base_urlstr | NoneNoneAPI endpoint URL; falls back to MIMO_BASE_URL, then the Xiaomi Token Plan endpoint
temperaturefloat0.0Sampling temperature
tool_choicestr | dict"auto"Tool selection strategy
parallel_tool_callsboolTrueAllow parallel tool calls
thinking_modestr"adaptive"Thinking mode for planning: "adaptive", "enabled", "disabled"
final_thinking_modestr | None"enabled"Thinking mode for finalization: "adaptive", "enabled", "disabled", or None
timeout_secondsfloat60.0Request timeout passed to the OpenAI-compatible client
clientAny | NoneNonePre-configured openai.OpenAI client instance

Capabilities

CapabilityValue
Tool callingYes
Parallel tool callsYes (configurable)
Input modalitiestext, image, audio, file
StreamingYes (both stream_next_action and finalize_stream)
Usage metricsRich
Reasoning metadataYes
Native asyncNo (uses thread fallback)

Thinking Modes

Xiaomi MiMo has adaptive thinking that automatically manages when reasoning is active:

  • `"adaptive"` (default): Thinking is enabled for initial planning, disabled after tool rounds. Finalization uses final_thinking_mode.
  • `"enabled"`: Thinking is always on.
  • `"disabled"`: Thinking is always off.
python# Adaptive thinking (recommended)
provider = Xiaomi(
    model="mimo-v2.5-pro",
    thinking_mode="adaptive",
    final_thinking_mode="enabled",
)

# Always thinking
provider = Xiaomi(
    model="mimo-v2.5-pro",
    thinking_mode="enabled",
)

# No thinking
provider = Xiaomi(
    model="mimo-v2.5-pro",
    thinking_mode="disabled",
)

Streaming

Xiaomi supports both planning and finalization streaming with reasoning chunks:

pythonfor event in agent.run_loop_events(
    "Calculate 25 * 4",
    max_rounds=2,
    stream_final=True,
):
    if isinstance(event, dict):
        if event.get("type") == "reasoning_chunk":
            print("[thinking]", event["chunk"])
        elif event.get("type") == "text_chunk":
            print(event["chunk"], end="", flush=True)

Full Example

pythonfrom mtp import Agent
from mtp.providers import Xiaomi

Agent.load_dotenv_if_available()

provider = Xiaomi(
    model="mimo-v2.5-pro",
    temperature=0.0,
    thinking_mode="adaptive",
    final_thinking_mode="enabled",
)

tools = Agent.ToolRegistry()
agent = Agent(provider=provider, tools=tools, debug_mode=True)

reply = agent.run_loop(
    "Calculate (25 * 4) + 10",
    max_rounds=3,
)
print(reply)

Notes

  • Uses OpenAI-compatible API at https://token-plan-ams.xiaomimimo.com/v1.
  • Thinking/reasoning content is captured from reasoning_content field on response messages.
  • The adapter automatically disables thinking after tool rounds when in adaptive mode to save tokens.
  • Supports extra_body parameter for passing thinking configuration to the API.

Source

src/mtp/providers/xiaomi_provider.py

01

Read

Understand where Xiaomi MiMo Provider sits in the agent loop before adding abstractions.

02

Wire

Connect the smallest useful provider, registry, store, or event stream first.

03

Observe

Expose events, logs, results, and failure states while the runtime is still moving.

04

Harden

Add policy, tests, retries, and audit traces after the behavior is visible.

Next docQuickstart