JellyNet: P2P LLM marketplace — agents pay per call, suppliers earn, memory lives on 0G, no servers.
JellyNet is a decentralized LLM API marketplace where AI agents pay per call and suppliers monetize idle API keys — no accounts, no lock-in. This demo shows the fully decentralized architecture: supplier nodes serve LLM inference over Gensyn AXL's P2P mesh (no central broker), inference is TEE-verified via 0G Compute (no one can read your prompt — not even JellyNet), and agent memory persists across full process restarts via 0G Storage KV. The agent survives a restart and recalls prior context loaded from onchain storage. In production, JellyNet's universal API key routes across 7 providers — 0G Compute is the verifiable, privacy-preserving option in that mix. Buyers bring one key, suppliers earn per call, agents pay via x402 micropayments on Solana. https://x.com/jellynet_
Built in TypeScript on Node 18. Three layers:
GENSYN AXL — P2P transport layer. Two AXL nodes (separate ed25519 keypairs, Yggdrasil mesh) replace JellyNet's centralized proxy. Supplier node polls /recv every 500ms. Buyer sends inference requests via POST /send with X-Destination-Peer-Id header and raw binary body. Critical fix discovered: AXL's DialPeerConnection assumes both nodes share the same tcp_port — mismatched ports cause silent 502s. Both nodes must use identical tcp_port values.
0G COMPUTE — TEE-verified inference via OpenAI-compatible API. Supplier calls 0G Compute broker, response includes TEE verification flag. KV write was originally blocking the reply path (~9s), causing buyer timeouts — fixed by firing kvWrite as a background promise and sending the AXL response immediately after inference completes.
0G STORAGE KV — Persistent agent memory. Buyer loads conversation history from KV on boot. Supplier logs every call to KV. Memory survives full process restart — the agent recalls prior context from onchain storage, not RAM.
AI tools used: Claude (Anthropic) as CTO-brain for architecture decisions, debugging the AXL tcp_port issue, and the KV blocking fix. Claude Code for all TypeScript implementation across axl/client.ts, supplier/node.ts, and buyer/agent.ts.

