All Case Studies

01 / CASE STUDY · BITTENSOR SN51 · LIUM · x402 · BASE

GPU402

Decentralized GPUs for any TypeScript program, paid for by the request.

GPU402 product interface
~70TESTS ACROSS SDK, TOOLS & GATEWAY

Commands run over a real SSH connection, USDC payments carry real EIP-3009 signatures, and TAO payments are signed transactions mined on a local anvil node with Bittensor EVM’s chain id.

15 minPREPAID GPU BLOCKS

Block price is Lium’s hourly price × 0.25 × (1 + margin). A quote holds for five minutes, and paid time starts when the pod answers on SSH, not when the payment is signed.

4PACKAGES

The gpu402 SDK, the x402 gateway, @gpu402/tools for the Vercel AI SDK and LangChain.js, and the live dashboard.

LiveCI AGAINST THE LIUM API

Every push runs build, typecheck, the test suite (including read-only calls to Lium’s live market) and the dashboard build. No keys or funds needed.

ClientGPU402 (open source · MIT)
RuntimeLium · Bittensor Subnet 51
Releasev0.2.0 · Bittensor Builders House 2026
ScopeProtocol design, TypeScript SDK, x402 gateway, agent tools and dashboard engineering
02 / EXECUTIVE THESIS

Designing for the real constraint.

Every architectural decision begins by isolating the structural failure modes of existing solutions and engineering directly against them.

01 / THE PROBLEM

Vulnerability & Friction Surface

Lium, the GPU marketplace on Bittensor Subnet 51, gives TypeScript developers generated types but no client, so every integrator rewrites the same node picking, retries, boot polling, SSH and cleanup. AI agents have it worse: renting a GPU needs an account, an API key and a card, which an agent cannot get on its own. HTTP status 402 Payment Required has been reserved for this kind of machine-to-machine payment since 1997 and was never put to use.

02 / OUR APPROACH

Protocol & Product Strategy

We split the work into four packages. A typed SDK, generated from Lium’s own OpenAPI spec, handles renting for developers who hold a Lium key. A small x402 gateway holds one Lium account and sells GPU time in prepaid 15-minute blocks: an agent asks for a GPU, receives a 402 with an exact price in USDC on Base or TAO on Bittensor EVM, signs a payment from its own wallet and asks again. Agent tools wrap both paths for the Vercel AI SDK and LangChain.js, and a dashboard shows every rental from the live gateway, Lium and the Bittensor chain.

03 / DELIVERED

Shipped Production System

Four packages: gpu402, a TypeScript client for all 210 Lium API paths with cheapest-node renting, boot waiting, SSH exec and spend caps; the x402 gateway, a Docker-ready service that rents first and settles second; @gpu402/tools, with rentGpu, runOnGpu, stopGpu and listGpus for agents; and a Next.js dashboard with a playground that rents a GPU from your own browser wallet. About 70 tests cover the SDK, tools and gateway, and CI runs them against the live Lium API on every push.

SYSTEM ARCHITECTURE

An HTTP 402 in front of Lium’s GPU market.

Hover any node for technical detail
01Agent WalletUSDC or TAO
02GPU402 Gateway15-min Prepaid Blocks
03x402 FacilitatorVerify & Settle
04Lium (SN51)GPU Marketplace
05Miner’s GPUSSH-Ready Pod
VERIFICATION LOOP

Settlement returns a transaction hash to the agent; the gateway and Lium both remove the pod when paid time ends.

03 / THE DASHBOARD

Every number comes from the live gateway.

Screens from the GPU402 dashboard. Each panel reads from the running gateway, Lium’s market or the Bittensor chain, and the playground rents a real GPU from the visitor’s wallet.

TECHNICAL ARCHITECTURE & PROOF

Architecture & verification.

Explore the defense-in-depth matrix, formal cryptographic equations, end-to-end execution trace, and systems engineering trade-offs.

03 / FOUR PACKAGES

One SDK, one gateway, two ways to rent.

Developers with a Lium key use the SDK directly. Agents with only a wallet go through the gateway. The tools and dashboard sit on top of both.

LAYER 01

gpu402 SDK

packages/sdk · openapi-fetch · ssh2 · types generated from Lium’s OpenAPI spec
WHAT IT HANDLES

Picks the cheapest matching node, moves to the next one when a node is taken, waits for boot, runs commands over SSH with host-key pinning, and refuses any rent that would pass a budget cap.

WITHOUT IT

Every integrator rewrites node selection, retries, boot polling and cleanup by hand against 210 raw API paths.

LAYER 02

x402 Gateway

apps/gateway · Hono · @x402/hono · SQLite ledger · Docker
WHAT IT HANDLES

Sells GPU time in prepaid 15-minute blocks to any wallet. Verifies the payment, rents on Lium capped at the quoted price, then settles. Removes pods at paid expiry.

WITHOUT IT

An agent needs its own Lium account, API key and card before it can rent anything.

LAYER 03

@gpu402/tools

packages/tools · Vercel AI SDK · LangChain.js DynamicStructuredTool
WHAT IT HANDLES

Gives a model rentGpu, runOnGpu, stopGpu and listGpus. One flag switches between a Lium key and x402 wallet payments, with a per-payment USD cap.

WITHOUT IT

Each agent framework needs its own glue code for the 402 handshake, SSH keys and pod cleanup.

LAYER 04

Dashboard

apps/dashboard · Next.js 16 · three.js · live gateway event stream
WHAT IT HANDLES

Shows every rental, payment and pod from the live gateway, Lium and Bittensor Finney, with a playground that rents a GPU from the visitor’s own wallet.

WITHOUT IT

There is no way to see, outside a terminal, that a payment settled and a pod ran.

HAVE A RELATED CHALLENGE?

Let's make
it ship.

Whether you are architecting zero-knowledge circuits, formally verified DeFi primitives, or a 250-builder ecosystem hackathon, you work directly with our founders and senior engineers.