Train nanoGPT on Modal GPUs, paid with stablecoins via MPP. No API keys. No signup. Just HTTP 402.
mpp-nanogpt-modal is an early-stage Python project in the AI payments / x402 ecosystem. It currently has 14 GitHub stars and 3 forks.
One day, machines no longer needed human credit cards to rent compute. An agent could walk up to any GPU in the cloud, pay with a stablecoin, train a model, and walk away. No accounts. No API keys. No invoices. Just HTTP 402 and a receipt on-chain. This repo is one way that story begins. —March 2026
Train nanoGPT on a cloud GPU, paid with stablecoins via MPP. No API keys. No signup. Just HTTP 402.
# 1. Install Tempo CLI + wallet
curl -L https://tempo.xyz/install | bash
tempo add request
tempo wallet login
# 2. Train a GPT on Shakespeare, paid with stablecoins
python3 run.py
╔══════════════════════════════════════════════════╗
║ nanoGPT × MPP × Modal ║
║ Train GPT on Shakespeare, paid in stablecoins. ║
║ No API keys. No signup. Just HTTP 402. ║
╚══════════════════════════════════════════════════╝
💰 Creating T4 sandbox — paying USDC via Tempo...
✓ Sandbox sb-i0wAVkwVmw1acszCAnUoh8 (15s)
Image: pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime
GPU: Tesla T4 (16GB)
🚀 Launching experiment...
git clone nanoGPT → prepare shakespeare → train 500 iters → sample
[ 12s] ---------------
[ 61s] ---------------
✓ Done in 97s
════════════════════════════════════════════════════
length of dataset in characters: 1,115,394
vocab size: 65
number of parameters: 0.80M
step 0: train loss 4.1920, val loss 4.1879
iter 50: loss 2.8890, time 10.79ms, mfu 1.55%
step 100: train loss 2.5571, val loss 2.5548
step 200: train loss 2.4717, val loss 2.4678
step 300: train loss 2.4222, val loss 2.4234
step 400: train loss 2.3789, val loss 2.4059
step 500: train loss 2.3615, val loss 2.3745
Generated Shakespeare:
CANIIO:
Ror wcowind to layer thadise myobe t eranthand my dalatangs
ar hapar us he he. F dilasoate Iwice my.
DELOY:
Gorou wat thertof isth ble mil ndill, ath iree senghin lat
Herid ov the and th theanoureransesel lind te l.
════════════════════════════════════════════════════
╔══════════════════════════════════════════════════╗
║ GPU compute paid via Machine Payments Protocol ║
║ No API keys. No signup. https://mpp.dev ║
╚══════════════════════════════════════════════════╝
97 seconds. Loss 4.19 → 2.37. Babbling Shakespeare from a 0.8M parameter GPT, trained on a cloud T4 GPU paid with USDC stablecoins.
run.py calls tempo request to create a Modal GPU sandbox — the HTTP 402 payment flow is handled automatically by the Tempo CLIThe pre-built Docker image (pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime) comes with torch + numpy + requests. Only git and tiktoken need installing at runtime (~10s).
run.py Modal (via MPP)
│ │
├── POST /sandbox/create ────────────►│
│◄── 402 Payment Required ───────────┤
│ │
├── [pay USDC on Tempo] ────────────►│
│◄── 200 {sandbox_id} ──────────────┤
│ │
├── POST /sandbox/exec ──────────────►│ git clone, prepare, train, sample
│ (background + poll) │ (~75s on T4)
│◄── {stdout, val_loss} ────────────┤
│ │
├── POST /sandbox/terminate ─────────►│
└── done. └──
MIT
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
Self-healing infrastructure for AI agent payments. 90.3% auto-recovery.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
Daydreams is a set of tools for building agents for commerce
Live data for AI agents — search, research, markets, crypto, X/Twitter. Pay-per-call via x402 micropayments.