pi-xiaomi-mimo-provider
v1.2.0
Published
Xiaomi Mimo provider extension for pi coding agent — registers mimo-v2-pro, mimo-v2-omni, and mimo-v2-tts models
Maintainers
Readme
pi-xiaomi-mimo-provider
Xiaomi Mimo provider extension for the pi coding agent. Registers Xiaomi Mimo models using the OpenAI-compatible API.
Models
| Model | Context (default) | Max Context | Max Output | Reasoning | Input | Input $/MTok | Output $/MTok | | --- | --- | --- | --- | --- | --- | --- | --- | | MiMo V2 Pro | 128K | 1M | 16K | ✅ | Text, Image | $1.00 | $3.00 | | MiMo V2 Omni | 128K | 1M | 16K | ✅ | Text, Image | $1.00 | $3.00 | | MiMo V2 TTS | 128K | 1M | 16K | ❌ | Text | Free | Free |
Installation
# From GitHub
pi install git:github.com/ulusoyomer/pi-xiaomi-mimo-provider
# From npm
pi install npm:pi-xiaomi-mimo-providerSetup
After installing, authenticate with your Xiaomi Mimo API key:
/login xiaomi-mimoGet your API key at: https://platform.xiaomimimo.com/#/console/plan-manage
Alternative: Environment Variable
You can also set your API key via environment variable:
export XIAOMI_MIMO_API_KEY="your-api-key-here"Or add it to ~/.pi/agent/models.json:
{
"providers": {
"xiaomi-mimo": {
"baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
"api": "openai-completions",
"apiKey": "YOUR_API_KEY",
"models": [
{ "id": "mimo-v2-pro" },
{ "id": "mimo-v2-omni" },
{ "id": "mimo-v2-tts" }
]
}
}
}Usage
Switch to a Xiaomi Mimo model:
/model mimo-v2-proAPI Endpoints
| Protocol | Base URL |
| --- | --- |
| OpenAI Compatible | https://token-plan-sgp.xiaomimimo.com/v1 |
| Anthropic Compatible | https://token-plan-sgp.xiaomimimo.com/anthropic |
This extension uses the OpenAI-compatible endpoint.
Context Window
The default context window is 128K (131072 tokens) to keep credit usage low. You can increase or change it at any time.
Runtime Command
Use /mimo-context to view or change the context window without restarting:
/mimo-context # Show current value
/mimo-context 256k # Set to 256K
/mimo-context 512k # Set to 512K
/mimo-context 1m # Set to 1M (maximum)
/mimo-context 131072 # Set with a plain numberEnvironment Variable
Set the context window at startup via environment variable:
export XIAOMI_MIMO_CONTEXT_WINDOW="256k"Supported formats: 64k, 128k, 256k, 512k, 1m, or a plain number (max 1048576).
Reasoning Control
Toggle reasoning on/off with pi's thinking commands:
/thinking off # Reasoning OFF
/thinking minimal # Minimal reasoning
/thinking low # Low reasoning
/thinking medium # Medium reasoning
/thinking high # Max reasoningApplies to mimo-v2-pro and mimo-v2-omni only. mimo-v2-tts does not support reasoning.
Notes
- The API returns
reasoning_contentin responses, which pi handles natively for reasoning models - Default context window is 128K tokens (131072) — configurable via
XIAOMI_MIMO_CONTEXT_WINDOWenv var or/mimo-contextcommand - Maximum supported context window is 1M tokens (1048576)
- Cost values based on official Xiaomi pricing: $1/$3 per MTok (up to 256K context), $2/$6 (256K-1M context)
- Cache write is currently free per Xiaomi's pricing page
License
MIT
