Files

1 line
2.6 KiB
JSON

{"repo": "agustif/pi-mimo-provider", "files": {"README.md": {"3cd614b47793c50de3c33f9128feb166a746acb9": {"t": 1785846873.6424737, "n": 2364, "h": "60f7cdd04216ddb9", "c": "# pi-mimo-provider\n\nXiaomi MiMo LLM provider for the [pi](https://github.com/badlogic/pi-mono) coding agent.\n\nRegisters MiMo models (V2-Flash, V2-Pro, V2-Omni, 7B-RL) using the OpenAI-compatible chat completions API at `https://api.xiaomimimo.com/v1`.\n\n## Models\n\n| Model | Context | Reasoning | Images | Cost (in/out per 1M tok) |\n|-------|---------|-----------|--------|--------------------------|\n| MiMo-V2-Flash | 256k | ✅ | ❌ | $0.10 / $0.30 |\n| MiMo-V2-Pro | 1M | ✅ | ❌ | $1.00 / $3.00 |\n| MiMo-V2-Omni | 1M | ✅ | ✅ | TBD |\n| MiMo-7B-RL | 32k | ✅ | ❌ | Free |\n\n## Setup\n\n### 1. Install\n\n```bash\nbun add pi-mimo-provider\n```\n\n### 2. Set your API key\n\n```bash\nexport XIAOMI_MIMO_API_KEY=\"your-api-key-here\"\n```\n\n### 3. Use as pi extension\n\nAdd to `~/.pi/agent/settings.json`:\n\n```json\n{\n \"packages\": [\"pi-mimo-provider/extension\"]\n}\n```\n\nOr via CLI flag:\n\n```bash\npi --extension pi-mimo-provider/extension\n```\n\n### 4. Or use programmatically\n\n```ts\nimport { createMiMoProvider } from \"pi-mimo-provider\";\n\n// Register with pi\npi.registerProvider(\"xiaomi-mimo\", createMiMoProvider());\n\n// Or with custom options\npi.registerProvider(\"xiaomi-mimo\", createMiMoProvider({\n apiKey: \"sk-...\",\n baseUrl: \"https://custom.endpoint.com/v1\",\n headers: { \"X-Region\": \"cn\" },\n}));\n```\n\n## API\n\n### `createMiMoProvider(options?)`\n\nCreates a `ProviderConfig` for registration with pi.\n\n**Options:**\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | `${XIAOMI_MIMO_API_KEY}` | API key (supports pi env var syntax) |\n| `baseUrl` | `string` | `https://api.xiaomimimo.com/v1` | API base URL |\n| `headers` | `Record<string, string>` | — | Custom HTTP headers |\n\n### Exports\n\n```ts\n// Model configs\nexport const MIMO_V2_FLASH: MiMoModelConfig;\nexport const MIMO_V2_PRO: MiMoModelConfig;\nexport const MIMO_V2_OMNI: MiMoModelConfig;\nexport const MIMO_7B_RL: MiMoModelConfig;\nexport const MIMO_MODELS: MiMoModelConfig[];\n\n// Constants\nexport const MIMO_BASE_URL: string;\nexport const MIMO_API_KEY_ENV: string;\n\n// Factory\nexport function createMiMoProvider(options?: MiMoProviderOptions): ProviderConfig;\n```\n\n## Development\n\n```bash\nbun install # Install deps\nbun run typecheck # Type check\nbun run test # Run tests\nbun run build # Build dist/\nbun run check # All of the above\n```\n\n## License\n\nMIT\n"}}}}