Launcher for running the pi coding agent (@earendil-works/pi-coding-agent)
on the AntSeed network inside Termux on Android.
It installs everything you need, starts the AntSeed buyer proxy on
http://localhost:8377, loads the pi-antseed
extension, and drops you into pi with every discovered AntSeed route available
in the model selector.
install.sh— one-shot installer for all dependencies (Termux packages, npm CLIs, the launcher, the pi extension).antseed-pi— launcher on your$PATH: starts the buyer proxy if it isn't running, waits for it to answer, then execspi. Also manages the proxy (status/stop/logs/peers) and ships a free-route model picker (pick/models) that bypasses pi's own (slow, sometimes freezing) selector.antseed-pi-routes— the dependency-free Node helper the picker uses; also usable standalone for scripts (--tsv,--json,--all,--refresh).
- Termux installed from F-Droid or the GitHub releases page. Do not use the Play Store build — it's outdated and unmaintained.
- Android 7+ recommended; a few hundred MB of free storage.
- An AntSeed identity: a secp256k1 private key in hex (
ANTSEED_IDENTITY_HEX). - USDC on Base to pay providers — deposit after install
(
antseed buyer depositorantseed payments).
pkg update -y && pkg install -y git
git clone https://github.com/CommunityPokeOrg/antseed-pi-termux
cd antseed-pi-termux
./install.shOne-shot alternative (installs the launcher without cloning):
curl -fsSL https://raw.githubusercontent.com/CommunityPokeOrg/antseed-pi-termux/main/install.sh | bashThe installer:
- probes a small set of official Termux mirrors and points
aptat the fastest one, pinning it viaTERMUX_PKG_NO_MIRROR_SELECTsopkg's own mirror rotation doesn't override it (keeps the default if probing fails — no prompts, safe undercurl | bash) pkg/apt-get installsnodejs,git,jq,curl,coreutils,procpsplus the native-build toolchain (python,build-essential,openssl-static) —better-sqlite3andnode-datachannelship no Android prebuilds and compile from sourcenpm install -g --ignore-scripts @antseed/cli @earendil-works/pi-coding-agent, then replays the native builds npm's lifecycle scripts can't do under Node >= 26 (node-datachannel is built directly withcmake-js)- installs
bin/antseed-piandbin/antseed-pi-routesto$PREFIX/bin - creates
~/.antseed-pi/envfor your identity - runs
pi install git:github.com/AntSeed/pi-antseedso the extension loads every time pi starts
Either edit ~/.antseed-pi/env:
ANTSEED_IDENTITY_HEX=<your-private-key-hex>or just run antseed-pi — it prompts for the key on first run and saves it
(mode 0600). You can also export ANTSEED_IDENTITY_HEX=... in your shell.
termux-wake-lock # recommended: stops Android killing the proxy
antseed-pi pickantseed-pi pick lists the free routes (zero-priced input/output on every
provider that can serve them — unknown or missing prices are never shown as
free), you pick a number, and it launches pi directly with
pi --model antseed/<service-id>@<peer>. This avoids pi's built-in model
selector entirely, which can hang or freeze on Termux when the network has
many routes.
1) minimax-m2.7 @ some-peer (bbbbbbbb) · rep 78 [openai-responses]
2) img-gen @ eeeeeeeeeeee [openai-completions]
Pick a route [1-2] (q to quit):
To see every route (paid and unknown-price too):
antseed-pi models # free routes only
antseed-pi models --all # all routes, with a price column
antseed-pi models --refresh # force a DHT re-scan firstOr skip the picker: antseed-pi launches pi as before and you can use the
in-app selector (Ctrl+L or /model) with ids of the form
antseed/<service-id>@<peer-prefix>[-<peer-name>][-rep<score>]
(e.g. antseed/minimax-m2.7@bbbbbbbbbbbb-rep5), or pass the id directly:
antseed-pi --model antseed/minimax-m2.7@bbbbbbbbbbbb-rep5Routes are discovered from /_antseed/peers and ordered by peer reputation.
To restrict what's offered, set e.g.
ANTSEED_MODELS="minimax-m2.7,arcee-trinity-thinking" before launching.
Anything you pass to antseed-pi that isn't a subcommand is forwarded to pi
(antseed-pi --help, antseed-pi -p "hello", ...). Use antseed-pi -- <args>
to force passthrough — and inside pick, anything after -- is forwarded too
(antseed-pi pick -- -p "hello").
| Command | What it does |
|---|---|
antseed-pi / antseed-pi start |
start proxy if needed + launch pi |
antseed-pi pick |
pick a free route from a numbered menu, launch pi with --model |
antseed-pi models [--all] |
list routes as pi registers them (default: free only) |
antseed-pi status |
proxy / identity / CLI status |
antseed-pi stop |
stop the managed buyer proxy |
antseed-pi logs [N] |
tail the proxy log (~/.antseed-pi/buyer.log) |
antseed-pi peers |
pretty-print /_antseed/peers |
antseed network browse --services # who's on the network + pricing
antseed buyer status # connection + deposit state
antseed buyer balance # USDC balance
antseed buyer deposit # funding address + QR
antseed payments # local funding portal on :3118antseed buyer start runs a buyer proxy on 127.0.0.1:8377 — it handles peer
discovery, routing, payment channels, and protocol adaptation. The pi-antseed
extension registers an antseed provider in pi, reads each peer's advertised
API protocol from /_antseed/peers, registers every service/peer pair as a pi
model, and sends x-antseed-pin-peer: <peer> on each request. You never need a
session-wide antseed buyer connection set pin.
antseed-pi-routes replicates that discovery (same /_antseed/peers data,
same service@peer12[-name][-repN] id format, same reputation precedence via
~/.antseed/buyer.state.json, same ANTSEED_MODELS allow-list) and resolves
each route's advertised price from providerPricing / unit-billing metadata.
A route counts as free only when every provider that can serve it prices
input, output, cached input, and per-image units at exactly $0; missing or
partial pricing is reported as unknown, never free.
bash tests/run.shOffline suite: boots a stub buyer proxy with fixture peers, verifies
free/paid/unknown classification, route id formatting (slug + rep suffix),
reputation precedence, the ANTSEED_MODELS allow-list, and an end-to-end
antseed-pi pick run against stub antseed/pi binaries.
| Env var | Default | Purpose |
|---|---|---|
ANTSEED_IDENTITY_HEX |
— (required) | secp256k1 buyer identity key |
ANTSEED_BASE_URL |
http://localhost:8377 |
buyer proxy URL |
ANTSEED_API_KEY |
unset | only if the proxy sits behind auth |
ANTSEED_MODELS |
all discovered | comma-separated route/service allow-list |
ANTSEED_PI_HOME |
~/.antseed-pi |
launcher state dir (env, pid, log) |
ANTSEED_PI_READY_TIMEOUT |
60 |
seconds to wait for the proxy |
- Android kills the proxy in the background → run
termux-wake-lock, and disable battery optimization for Termux in system settings. antseed-pidies with "antseed buyer start failed" →antseed-pi logsfor the proxy log; checkANTSEED_IDENTITY_HEXis set.- No
antseed/...models in pi → proxy isn't up or sees no peers:antseed-pi status,antseed network browse --services, then/reloadin pi. Connection state: idleinantseed buyer status→ the proxy isn't running; launch viaantseed-pior runantseed buyer startyourself.- Insufficient deposits →
antseed buyer balance; top up withantseed buyer deposit. - 5xx on a request → the pinned peer went offline; re-run
antseed-pi peers,/reload, pick another route. - npm install fails on old Android →
pkg upgrade nodejsor switch topkg install nodejs-lts.
- AntSeed — Using the API
- AntSeed/pi-antseed — the pi extension
- pi coding agent
MIT