AI x Blockchain

Ritual Infernet Node Guide: Decentralized AI Coprocessors for Web3

Master Ritual Infernet node deployment: run decentralized AI inference containers, connect smart contracts to off-chain ML models, and prove compute on-chain.

Cybernetic neural network brain integrated with cryptographic blockchain node hardware and Infernet coprocessor modules
Ritual Infernet bridges on-chain smart contracts with off-chain AI model inference containers.

Smart contract virtual machines (such as Ethereum’s EVM, Solana’s SVM, or Cosmos’s CosmWasm) are engineered with deterministic computational constraints. Every state transition must be validated identically across thousands of nodes worldwide. Consequently, running non-deterministic machine learning operations, deep neural network forward passes, or transformer language models directly inside on-chain smart contracts is computationally prohibitive and architecturally impossible.

Ritual bridges this fundamental chasm through Infernet, the foundational coprocessor layer for AI and cryptographic execution. Infernet allows smart contracts on any EVM or sovereign chain to request off-chain machine learning inference from decentralized node runners, receive authenticated model outputs, and execute state transitions verified through cryptographic proofs.

In this operator guide, we analyze the Infernet coprocessor architecture, explain containerized ML inference pipelines, and provide a full deployment walkthrough for launching an official Infernet compute node.

For complementary research into AI-crypto infrastructure, explore our guides on Bittensor TAO subnet node architecture and decentralized AI compute nodes.


Architecture: How Infernet Connects Blockchains to AI Models

Infernet operates as an asynchronous, event-driven coprocessor protocol:

+-------------------------------------------------------------------------+
|                  Ritual Infernet Asynchronous Workflow                  |
+-------------------------------------------------------------------------+
|                                                                         |
|  [ User Smart Contract ]                                                |
|       |                                                                 |
|       v  1. Emits Inference Request Event with Input Tensor Payload    |
|  [ Infernet Coordinator Contract (On-Chain) ]                           |
|       |                                                                 |
|       v  2. RPC Event Ingestion & Job Queueing                          |
|  [ Infernet Node Core (Go / Python Daemon) ]                            |
|       |                                                                 |
|       +-------------------+-------------------+                         |
|       v                   v                   v                         |
|  [ ML Container A ]  [ ML Container B ]  [ ZK Prover / TEE Container ]  |
|  (HuggingFace LLM)   (ResNet / PyTorch)  (Proof of Inference Generation)|
|       |                   |                   |                         |
|       +-------------------+-------------------+                         |
|       v  3. Evaluates Model Output & Assembles Cryptographic Response   |
|  [ Infernet Node Core ]                                                 |
|       |                                                                 |
|       v  4. Submits Callback Transaction with Attested Result           |
|  [ Destination Smart Contract Callback (On-Chain) ]                     |
+-------------------------------------------------------------------------+

Key Architectural Components

  1. Infernet Coordinator: Smart contracts deployed across Ethereum, Base, Arbitrum, or Monad that maintain operator registration, listen for client inference requests, and enforce validation rules.
  2. Infernet Node Core: An orchestration server that monitors target blockchain events, queues inference tasks, manages rate limiting, and forwards tensor inputs to local model containers.
  3. Inference Services (Containers): Isolated Docker microservices hosting specialized machine learning workloads (e.g., PyTorch, ONNX Runtime, HuggingFace transformers, or LLM serving engines) responding over local HTTP endpoints.

Hardware and System Requirements

Infernet node requirements depend heavily on the complexity of the AI models you serve:

Component Standard Node (Classical ML / Embeddings) High-Performance Node (LLMs / Diffusion)
CPU Architecture 8 Cores (x86_64, 3.0 GHz+) 16 Cores (AMD EPYC / Ryzen 9)
System Memory (RAM) 32 GB DDR4/DDR5 64 GB – 128 GB DDR5 ECC
GPU Acceleration Optional (CPU inference for light models) 1x NVIDIA RTX 4090 (24GB) or A5000/A6000
Disk Storage 250 GB NVMe SSD 1 TB NVMe SSD (To cache large model weights)
Internet Bandwidth 100 Mbps symmetric 500 Mbps – 1 Gbps low-latency link
Operating System Ubuntu 22.04 LTS x86_64 Ubuntu 22.04 / 24.04 LTS with NVIDIA Docker

Step-by-Step Node Deployment

Deploying an Infernet node involves configuring Docker containers, provisioning an Ethereum wallet for callback transactions, and registering service endpoints.

Step 1: Install Docker and Docker Compose

Infernet nodes are packaged natively into Docker Compose stacks:

# Update repositories and install Docker Engine
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git jq build-essential ca-certificates

# Install Docker official repository
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Verify Docker permissions:

sudo usermod -aG docker $USER
newgrp docker
docker --version

Step 2: Clone the Infernet Node Repository

Clone the starter repository provided by Ritual Foundation:

cd $HOME
git clone https://github.com/ritual-net/infernet-deploy
cd infernet-deploy/deploy

Step 3: Configure the Operator Wallet and RPC

An Infernet node requires a dedicated EVM wallet funded with native gas tokens (e.g., ETH on Base or Arbitrum) to submit callback transactions back to the blockchain.

Edit config.json:

{
  "log": {
    "level": "info"
  },
  "server": {
    "port": 4000
  },
  "chain": {
    "enabled": true,
    "trail_head_blocks": 5,
    "rpc_url": "https://base-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY",
    "coordinator_address": "0x8D8714070B9959B7e142e032906148385633857e",
    "wallet": {
      "max_gas_limit": 5000000,
      "private_key": "YOUR_OPERATOR_WALLET_PRIVATE_KEY"
    }
  },
  "containers": [
    {
      "id": "onnx-inference-service",
      "image": "ritualnetwork/infernet-services-onnx:latest",
      "description": "General ONNX model inference container",
      "external": true,
      "port": 3000,
      "allowed_delegate_addresses": [],
      "allowed_addresses": []
    }
  ]
}

Step 4: Launch the Docker Services

Initiate the multi-container stack via Docker Compose:

docker compose up -d

Verify that both the infernet-node router, Redis job queue, Fluent Bit logger, and the onnx-inference-service container are actively running:

docker compose ps

Step 5: Test Model Inference via Local REST API

Before opening on-chain callbacks, query the local Infernet service endpoint to verify model inference pipeline integrity:

curl -X POST http://127.0.0.1:4000/api/jobs \
  -H "Content-Type: application/json" \
  -d '{
    "containers": ["onnx-inference-service"],
    "data": {
      "input": [1.0, 2.5, 3.8, -0.4]
    }
  }'

A successful response returns a job UUID containing the computed neural network output tensor and inference latency metadata.


On-Chain Registration with the Coordinator

Once your node passes local verification, register your operator address with the on-chain Coordinator contract via the Ritual CLI or Etherscan:

# Register operator with coordinator
cast send 0x8D8714070B9959B7e142e032906148385633857e \
  "registerNode(address)" \
  YOUR_OPERATOR_PUBLIC_ADDRESS \
  --rpc-url https://base-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY \
  --private-key YOUR_OPERATOR_WALLET_PRIVATE_KEY

Production Observability and Metrics

Monitor node health using Grafana and Prometheus by querying the node metrics port:

curl -s http://127.0.0.1:4000/metrics | grep infernet_jobs_processed_total

Key telemetry to supervise:

  • infernet_jobs_processed_total: Total on-chain and off-chain inference requests handled.
  • infernet_callback_tx_failures: Callback transactions reverted due to slippage or insufficient gas.
  • container_gpu_utilization: Ensure GPU memory isn’t leaking across repeated inference batches.

By operating a Ritual Infernet node, you enable smart contracts to harness AI models trustlessly, laying the compute foundation for autonomous on-chain agents, algorithmic DeFi, and AI-driven governance.

Advertisement
Advertisement
Advertisement
Advertisement
Advertisement