Architecture

How QueraIS works

A coordinator (the gateway) matches your request to an open market of staked GPU nodes, streams the result back, samples it for honesty, and settles payment on-chain — 95% to the node, 5% to the protocol. Here’s the whole machine, and how the trusted parts get removed over time.

Developers & SDKsOpenAI-compatible requestsGatewaymatching · streaming · verification · settlementGPU nodesstake $QAIS · serve models · earn 95%Verification oraclere-runs ~5% · scores reputationArbitrum contractstoken · registry · escrow · disputes · treasury

The pieces

ComponentRole
Requester / developerSends OpenAI-style requests; pre-funds a credit account and signs one spending cap.
GatewayThe coordinator — auth, matching, streaming, verification, and batched settlement. Trusted today; bounded by signed prices.
GPU nodeStakes $QAIS, advertises models + price, runs inference, streams tokens, earns 95%.
Matching enginePicks the serving node per job by price, reputation, latency, and capability.
Verification oracleRe-runs ~5% of jobs on its own nodes and updates reputation; flags anomalies into disputes.
Smart contractsToken, node registry + stake, credit/escrow, dispute resolution, and treasury — on Arbitrum.

A job, end to end

  1. Request. A developer calls /v1/chat/completions (OpenAI-compatible). The gateway normalizes it to a job spec and checks the requester’s signed credit headroom.
  2. Match. The matching engine scores eligible nodes — price, reputation, latency, capability — and assigns the winner over a live WebSocket channel.
  3. Serve. The node runs the model and streams tokens back through the gateway to the caller in real time.
  4. Verify. Every job gets cheap format/length checks; ~5% are re-run on oracle nodes and compared by embedding similarity. The result updates the node’s reputation.
  5. Settle. Debits accrue off-chain and flush in a batched on-chain transaction — 95% to the node, 5% to the protocol — amortizing gas to a fraction of a cent per job.

Trust model — and why the worst case is bounded

Today a single gateway coordinates matching and settlement. That’s a real trust assumption, but a tightly fenced one:

Can’t steal deposits

Requester funds are locked in the credit contract; the gateway can only settle at the prices you already signed in each job spec.

Can’t exceed your cap

Your EIP-712 spending cap bounds the most it can ever spend. Revoke in one tx.

Can’t block refunds

Unclaimed deposits are withdrawable on-chain after a short notice window.

Can’t fake quality

Sampled re-runs and staking/slashing make dishonest serving a losing trade — see Security.

The path to decentralization

Each step removes a piece of trust from the gateway. Sequencing is directional, not dated.

StageStepWhat changes
TodayTrusted gateway + on-chain settlementOne gateway does matching and batched settlement; stake, reputation, and payment are already on-chain. Worst case is bounded — see the trust model above.
NextOn-chain auctionJob specs post on-chain; nodes submit sealed bids in a short window and a contract selects the winner — removing the gateway’s matching role.
ThenP2P mesh + decentralized oracleNodes discover each other over a libp2p DHT and gossip jobs; verification moves to a decentralized oracle instead of protocol-run infrastructure.
GoalDAO governanceArbitration and parameters move to on-chain governance; node participation is fully permissionless and the trusted gateway is gone.

Tech stack

LayerToday
BlockchainArbitrum Sepolia (EVM L2) — testnet today
ContractsSolidity 0.8 + OpenZeppelin, transparent proxy (5 core)
Gateway / APINode.js + Fastify (TypeScript), OpenAI-compatible REST
Node daemonTypeScript daemon wrapping llama.cpp / Ollama
Inferencellama.cpp · Ollama (vLLM optional)
SettlementEIP-712 signed sessions → batched on-chain (50–500 jobs/tx)
VerificationSampled re-runs + format checks; 5-dimension EMA reputation
Model integritySHA-256 digests (IPFS pinning on the roadmap)
FrontendReact dashboard (served by the gateway) + this Next.js site
P2P (roadmap)libp2p mesh for discovery + gossip