npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lesetong/pi-mimo

v1.4.3

Published

Pi extension for Xiaomi MiMo AI models with multi-region & auth.json support

Downloads

425

Readme

@lesetong/pi-mimo

Pi extension for Xiaomi MiMo AI models. Auto-discovers and registers all available models from the MiMo API.

Supports multiple regions (CN / SGP / AMS) and both OpenAI-compatible and Anthropic-compatible protocols.

Install

Via npm

pi install npm:@lesetong/pi-mimo

Via git (GitHub)

pi install git:github.com/leset0ng/pi-mimo

Setup

Option 1: Environment variables

export MIMO_API_KEY="tp-xxxxx"
# Optional: choose region and protocol
export MIMO_BASE_URL="https://token-plan-sgp.xiaomimimo.com/v1"
export MIMO_API="openai-completions"   # or "anthropic-messages"

Option 2: pi auth.json (recommended)

Store everything in ~/.pi/agent/auth.json — no env vars needed:

{
  "mimo": {
    "type": "api_key",
    "key": "tp-xxxxx",
    "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
    "api": "openai-completions"
  }
}

Or append with one command:

cat <<'EOF' >> ~/.pi/agent/auth.json
, "mimo": { "type": "api_key", "key": "tp-xxxxx", "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", "api": "openai-completions" }
EOF

Note: Make sure the resulting JSON is valid (no duplicate keys, proper commas).

Region & Protocol Matrix

| Region | OpenAI-compatible | Anthropic-compatible | |--------|-------------------|----------------------| | China (CN) | https://token-plan-cn.xiaomimimo.com/v1 | https://token-plan-cn.xiaomimimo.com/anthropic | | Singapore (SGP) | https://token-plan-sgp.xiaomimimo.com/v1 | https://token-plan-sgp.xiaomimimo.com/anthropic | | Europe (AMS) | https://token-plan-ams.xiaomimimo.com/v1 | https://token-plan-ams.xiaomimimo.com/anthropic |

Default: Singapore OpenAI-compatible (https://token-plan-sgp.xiaomimimo.com/v1).

Usage

Start pi normally — MiMo models appear under the mimo provider:

pi

Select a MiMo model with /model or use mimo/<model-id> directly.

Development

Test locally without publishing:

# With env variables
MIMO_API_KEY="tp-xxxxx" MIMO_BASE_URL="https://token-plan-cn.xiaomimimo.com/v1" pi -e ./extensions/index.ts

# With auth.json (ensure ~/.pi/agent/auth.json contains the mimo key)
pi -e ./extensions/index.ts

How it works

On startup, the extension:

  1. Reads config from MIMO_API_KEY / MIMO_BASE_URL / MIMO_API env vars, or ~/.pi/agent/auth.json
  2. Fetches models from <baseUrl>/models (falls back to OpenAI path for Anthropic endpoints)
  3. Enriches with platform metadata from https://platform.xiaomimimo.com/api/v1/models
  4. Filters out non-coding models (TTS, image-gen, embeddings, etc.)
  5. Registers them under the mimo provider

License

MIT