Skip to content

corbinallison/paysafe-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaySafe-Node

Disclaimer: This is a work-in-progress. Use at your own risk

Rent out your GPU for lightweight AI inference. Companion project to PaySafe — payments flow over x402, and PaySafe screens counterparties.

Renter/Agent ──x402──▶ Relay (Render) ──WSS──▶ Host agent ──▶ local Ollama ──▶ GPU
                        │ registry · routing · ledger · canaries
                        └─ optional PaySafe reputation screening

Two pieces: relay/ (server, deploy next to PaySafe on Render) and agent/ (what friends install, Windows-first).

Mint an invite code per user:

curl -X POST https://<relay>/v1/invites -H "Authorization: Bearer $ADMIN_KEY"

Deploy

  1. Open PowerShell and run: irm https://raw.githubusercontent.com/corbinallison/paysafe-node/main/installer/install.ps1 | iex
  2. Paste the invite code I gave you and a wallet address (Coinbase Wallet is free).
  3. Run paysafe-node start. That's it — paysafe-node status shows your jobs.

Requirements: Windows 10/11, NVIDIA GPU (8GB+ VRAM comfortable for the default llama3.2:3b), ~5GB disk.

Using the network (renters / agents)

curl -X POST https://<relay>/v1/run -H 'content-type: application/json' -d '{
  "model": "llama3.2:3b",
  "messages": [{"role":"user","content":"Say hi in five words."}]
}'

In PAYMENT_MODE=dev (default) it's free. In PAYMENT_MODE=x402, the same request returns 402 Payment Required with an x402 accepts block; any x402 client (@x402/fetch, x402-requests) pays and retries automatically. Testnet first: Base Sepolia + the signup-free x402.org facilitator are the defaults; for mainnet + Bazaar indexing, front /v1/run with the official @x402/express middleware exactly as PaySafe's src/index.ts does.

Operating

  • The relay blueprint (relay/render.yaml) uses Render's starter plan with a 1GB persistent disk at /var/data (DATA_DIR). The disk keeps the ledger, node registrations, invites, and payment-replay guard across deploys/restarts; paid instances also don't sleep. Without it (free tier), every restart wipes state and disconnects all nodes — the relay logs a loud warning at boot if DATA_DIR is unset.
  • GET /v1/nodes (admin) — who's online, GPUs, reputation, quarantine state
  • GET /v1/ledger (admin) — USDC owed per host (80% share). Pay weekly on Base, then zero out.
  • Canary probes run automatically every ~10 min against idle nodes; 3 consecutive failures quarantine a node.
  • ALLOWED_MODELS env on the relay is the curated catalog. Adding a model = adding it there + hosts pulling it.

Repo layout

relay/     signaling & settlement server (Node 20, dep: ws)
agent/     host CLI (Node 20, dep: ws) — setup | start | status | logs
installer/ install.ps1 — winget installs Node+Ollama, verifies checksum, PATH shim
SECURITY.md  which security-plan measures are implemented vs deferred

Release process (for the installer's checksum pin)

cd agent && zip -r ../paysafe-node-agent-0.1.0.zip . -x node_modules/\*
shasum -a 256 ../paysafe-node-agent-0.1.0.zip
# paste the hash into installer/install.ps1 ($AgentSha256), tag the GitHub release, upload the zip

About

A service for agents to rent space on end user's GPU to spin up a smaller model for subtasks. Transactions are handled through x402 with the PaySafe security service.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors