NConnect
DocsMiniMax M3 + Pi Code

TUTORIAL

How to run MiniMax M3 with Pi Code

Run the Pi coding agent on MiniMax M3, a fast and low-cost reasoning model, served by Nebius Token Factory through NConnect with a temporary provider config.

MiniMax M3Pi Code 5 minUpdated

Pi is a minimal terminal coding agent. NConnect declares Nebius as a custom OpenAI-compatible provider for each launch, so no proxy is needed. MiniMax M3 is a fast, inexpensive mixture-of-experts reasoning model, a good fit for quick edits and scripted runs.

Prerequisites

Steps

  1. Install NConnect

    This installs the CLI and the npi alias, plus Bun if needed.

    curl -fsSL https://nconnect.sh/install.sh | bash
  2. Add your Nebius API key

    nconnect configure
  3. Install Pi Code

    Skip this if pi is already on your PATH. In an interactive terminal, NConnect also offers to run this for you the first time you launch Pi Code.

    npm install -g --ignore-scripts @earendil-works/pi-coding-agent
  4. Launch Pi Code on MiniMax M3

    nconnect --model MiniMaxAI/MiniMax-M3 pi

    For a one-shot answer, pass Pi's own print flag:

    nconnect --model MiniMaxAI/MiniMax-M3 pi --print "list the scripts in package.json"

What NConnect does on launch

  • Writes a models.json with a nebius provider into a temporary directory and deletes it when Pi exits.
  • Keeps your sessions in the usual ~/.pi/agent/sessions, so they stay resumable.
  • Launches Pi with --no-approve and without your extensions, skills, prompt templates or themes, so the run is predictable.
  • Lists every Nebius model, so you can switch inside Pi.

Track cost and add fallback

Pi Code is a spawned harness, so by default it calls Nebius directly and NConnect reports $0.00. Route it through the daemon to meter every turn and get automatic fallback if MiniMax M3 is busy:

NCONNECT_METER=1 nconnect --model MiniMaxAI/MiniMax-M3 pi

Then check spend with nconnect usage --last 7d. See Cost metering.

More tutorials