Compute Market

GPU/AI task market, Compute Relay, NAT Agent and production boundary
Writing date: 2026-05-05

Current implementation

Compute-market code lives in pkg/taskmarket, pkg/computenode, pkg/gpu, pkg/rpc/compute_rpc.go, pkg/computerelay, cmd/compute-client, cmd/compute-agent and cmd/compute-relay. It covers task publication, signed mutations, task listing, disputes, node registration, relay scheduling and outbound NAT GPU connectivity.

NAT GPU access model

Client / App
  -> HTTPS / OpenAI-style API
  -> ZORAI Compute Gateway / Relay
  -> outbound WebSocket
  -> Internal GPU Agent
  -> local Compute Node + sandbox/GPU

GPU providers do not need a public IP. They should not expose Docker API, SSH or Compute Node ports to the internet. compute-agent uses the provider key to connect outbound to compute-relay. The Relay maintains sessions, heartbeats, task push and result return.

RPC methods

New components

ComponentCodePurpose
Compute Clientcmd/compute-clientUser CLI: zorai-compute run/status/list/dispute. It creates Task objects, uploads or references artifacts, signs mutations and calls the Relay.
Compute Relaycmd/compute-relay, pkg/computerelayPublic WebSocket/HTTPS service for provider sessions, heartbeat, task routing and result return.
Compute Agentcmd/compute-agentRuns on an internal GPU host, connects outbound to Relay, calls local Compute Node and signs proof with the provider key.
Relay Endpointpkg/taskmarket.NodeEndpointSupports relay://<relay-id>/<session-id> with persisted relay metadata.

Current testnet deployment

ItemStatus
Client URLhttps://compute-relay.zorai.co
Provider WSSwss://compute-relay.zorai.co/v1/provider/connect; real provider pilots need sticky routing or a pinned backend.
Relay backendshz-1 and jp-2, each persisting TaskMarket state under /data/zorai/compute-relay/taskmarket.
Security checksPOST /v1/tasks without API key returns 401; malformed signed requests return 400; /v1/providers is currently empty until a real compute-agent connects.

Launch example

./compute-relay \
  --listen :8787 \
  --tls-listen :443 \
  --tls-cert /etc/ssl/zorai/compute-relay.crt \
  --tls-key /etc/ssl/zorai/compute-relay.key \
  --relay-id hz-1 \
  --public-url wss://compute-relay.zorai.co \
  --store /data/zorai/compute-relay/taskmarket \
  --api-key "$ZORAI_AI_API_KEY"

./compute-agent \
  --relay wss://compute-relay.zorai.co/v1/provider/connect \
  --relay-id hz-1 \
  --provider-key "$PROVIDER_PRIVATE_KEY" \
  --compute-url http://127.0.0.1:8645 \
  --gpu-name "NVIDIA A100" \
  --gpu-vram-mb 40960

User CLI example

go build -o build/zorai-compute ./cmd/compute-client

build/zorai-compute run \
  --relay https://compute-relay.zorai.co \
  --api-key "$ZORAI_AI_API_KEY" \
  --model ipfs://bafy...model \
  --input https://signed.example/input.json \
  --input-hash 0123...abcd \
  --gpu-type A100 \
  --min-vram 40960 \
  --budget 10000000000000000 \
  --poll

build/zorai-compute status 0xTaskID --relay https://compute-relay.zorai.co
build/zorai-compute list --relay https://compute-relay.zorai.co --requester 0xRequester
build/zorai-compute dispute 0xTaskID --relay https://compute-relay.zorai.co --reason "result hash mismatch" --evidence ipfs://bafy...evidence

Production boundary

The Relay does not store provider keys, execute tasks, custody funds or sign proofs. Real settlement must go through ZORAIComputeEscrow. The minimum code loop exists, but public GPU provider e2e, real escrow settlement transactions, reconnect reports and timeout-refund evidence are still required before claiming an SLA-backed production GPU network.