aisdk / xiaomi
Official Xiaomi provider for the PHP AI SDK.
Fund package maintenance!
v0.8.1
2026-07-22 06:27 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.8.0
- aisdk/openai-compatible: ^0.8.0
Requires (Dev)
- laravel/pint: ^1.18
- nyholm/psr7: ^1.8
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
README
Official Xiaomi provider for the PHP AI SDK. Uses Xiaomi MiMo's OpenAI-compatible API.
Installation
composer require aisdk/xiaomi
Basic Usage
use AiSdk\Generate; use AiSdk\Xiaomi; Xiaomi::create(['apiKey' => $_ENV['XIAOMI_API_KEY']]); $result = Generate::text('Explain this code briefly.') ->model(Xiaomi::model('mimo-v2.5')) ->run();
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
XIAOMI_API_KEY |
API key for authentication | Required |
XIAOMI_BASE_URL |
Base URL for API requests | https://api.xiaomimimo.com/v1 |
Programmatic Configuration
Xiaomi::create([ 'apiKey' => $_ENV['XIAOMI_API_KEY'], 'baseUrl' => 'https://api.xiaomimimo.com/v1', ]);
Supported Capabilities
| Capability | Support |
|---|---|
| Text generation and streaming | Native OpenAI-compatible chat |
| Tool calling, structured output, reasoning | Passed through for supported models |
| Image input | Passed through for compatible vision models |
Provider Options
Use providerOptions('xiaomi', ['raw' => [...]]) for documented MiMo chat-completions fields outside the portable SDK surface. Model IDs are opaque strings and are validated by Xiaomi.