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.
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
- macOS or Linux.
- A Nebius Token Factory API key from tokenfactory.nebius.com.
Steps
Install NConnect
This installs the CLI and the
npialias, plus Bun if needed.curl -fsSL https://nconnect.sh/install.sh | bashAdd your Nebius API key
nconnect configureInstall Pi Code
Skip this if
piis 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-agentLaunch Pi Code on MiniMax M3
nconnect --model MiniMaxAI/MiniMax-M3 piFor 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.jsonwith anebiusprovider 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-approveand 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 piThen check spend with nconnect usage --last 7d. See Cost metering.
