0xalank/quai-intelligence

Decentralized, low cost, censorship-resistant AI inference that runs alongside Quai mining over a distributed network of commodity GPUs

Rust

0

148 commits

updated Jun 18, 2026

See the code

README

Quai Intelligence

Verified AI compute mesh powered by Quai. Mine QUAI when idle. Serve verified dense-model inference when scheduled.

License Platform

Overview

Quai Intelligence is a decentralized inference network optimized for dense-model serving. Workers mine QUAI by default, pause for paid inference work when scheduled, and prove correctness with Terkle-backed verification. Optional privacy modes keep the architecture usable for more sensitive workloads without making confidentiality claims the system cannot support on anonymous public GPUs.

Implementation Direction

Rust is the canonical backend direction for Quai Intelligence. New coordinator, miner, edge, P2P, verification, scheduling, and payment work belongs in the Rust workspace under rust/.

The older Go backend under cmd/, internal/, and pkg/ remains in the repository as a legacy/reference implementation until the Rust path proves parity for public-fast inference, miner registration, route issuance, verification, and local miner lifecycle. After the quarantine gate passes it is archived under archive/legacy-go/<commit>/. It should not receive new product features.

Python remains a narrow model-runtime adapter layer for SGLang, RWKV, vLLM, tokenizer support, and benchmarks. Routing, payment, session authorization, verification policy, and miner reputation belong in Rust.

See docs/RUST_CANONICAL_BACKEND.md for the migration policy and parity checklist.

Positioning

Quai Intelligence is:

  • a decentralized inference network
  • optimized for dense-model serving
  • equipped with optional privacy modes
  • backed by Terkle verification
  • designed so GPUs mine QUAI when idle and switch to inference work when scheduled

Quai Intelligence is not:

  • a general AI utility mesh
  • a storage or memory network
  • confidential compute on anonymous public GPUs
┌─────────────────────────────────────────────────────────────┐
│                    Quai Intelligence                        │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   Users                    Coordinator                      │
│   ─────                    ───────────                      │
│   Pay Qi for     ───────►  Routes requests   ───────►       │
│   inference                to GPU miners                    │
│                                                             │
│                            Miners                           │
│                            ──────                           │
│                            Run models, earn Qi              │
│                            Distributed globally             │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Features

  • Verified dense-model inference via Terkle-backed attestations, challenges, and semantic checks
  • Hybrid worker economics with default QUAI mining plus scheduled inference work
  • Sharded model serving for larger dense models across multiple miners
  • Optional privacy modes for edge-owned first/last layers
  • Desktop and browser UI for network visibility and miner control

Miner Ownership

quai-intelligence is the active home of the miner product.

  • rust/quai-miner/ is the canonical worker implementation target
  • rust/quai-coordinator/, rust/quai-p2p/, rust/quai-terkle/, and rust/quai-edge/ are the canonical backend crates for control plane, data plane, verification, and edge-private routing
  • internal/miner/ contains the legacy Go worker used as reference material during Rust parity work
  • kawpowminer/ is the vendored low-level mining runtime fork used by the worker
  • the canonical upstream for mining-runtime changes is the owned fork based on 0xalank/kawpowminer
  • separate prototype repos such as quai-miner-inference are not the ongoing implementation target

In practice this means:

  • memory management, pause/resume policy, and worker-facing performance improvements are planned and integrated from this repo
  • low-level CUDA / VRAM / miner-runtime changes land in the kawpowminer fork
  • high-level product work such as local mode, vllm, coordinator connectivity, API serving, route issuance, and verification orchestration is implemented in Rust
  • Go changes are limited to legacy fixes, parity reference tests, and migration support

Quick Start

Download

Or Build from Source

# Clone
git clone https://github.com/dominant-strategies/quai-intelligence
cd quai-intelligence

# Build canonical Rust backend
make build

# Build Rust release artifacts and desktop sidecars
make build-all

# Build desktop frontend
(cd app && npm ci && npm run build)

# Legacy Go reference build, if needed during migration
RUN_LEGACY_GO_TESTS=1 make build-go

Project Structure

quai-intelligence/
├── rust/                     # Canonical backend workspace
│   ├── quai-core/            # Shared types, config, model registry
│   ├── quai-proto/           # Rust protocol definitions
│   ├── quai-p2p/             # P2P tensor transport and compression
│   ├── quai-terkle/          # Terkle/KZG verification
│   ├── quai-coordinator/     # Canonical coordinator
│   ├── quai-miner/           # Canonical miner/worker
│   └── quai-edge/            # Trusted edge service
│
├── app/                      # Desktop application
│   ├── src/                  # React UI components
│   │   ├── components/
│   │   │   ├── Dashboard.tsx       # Main dashboard
│   │   │   ├── GlobeNetwork.tsx    # 3D world map
│   │   │   ├── GpuMonitor.tsx      # GPU performance charts
│   │   │   ├── MiningPanel.tsx     # Mining statistics
│   │   │   ├── ModelsPanel.tsx     # Model management
│   │   │   └── SettingsPanel.tsx   # Configuration
│   │   └── hooks/
│   ├── src-tauri/            # Tauri shell and sidecar management
│   │   ├── src/main.rs       # System integration
│   │   └── binaries/         # Bundled Rust sidecars for the current build target
│   └── package.json
│
├── cmd/                      # Legacy Go entrypoints
│   ├── coordinator/          # Network coordinator reference
│   └── miner/                # GPU miner reference
│
├── internal/                 # Legacy Go packages
│   ├── coordinator/          # Legacy routing/scheduling reference
│   ├── miner/                # Legacy worker/local-runtime reference
│   ├── p2p/                  # Legacy data-plane transport reference
│   └── sglang/               # Legacy sharded-runtime client reference
│
├── kawpowminer/              # Owned mining runtime fork vendored into this repo
│
├── docker/                   # Container configs
├── scripts/                  # Build & release scripts
├── Makefile                  # Build commands
└── go.mod

Architecture

Components

  1. Coordinator — Routes inference requests to available miners

    • Canonical implementation: rust/quai-coordinator/
    • Legacy reference: cmd/coordinator/ and internal/coordinator/
    • Load balancing across GPU tiers
    • Model-to-miner matching
    • Payment settlement
  2. Miner — Runs on GPU machines

    • Canonical implementation: rust/quai-miner/
    • Legacy reference: cmd/miner/ and internal/miner/
    • Launches and controls the vendored kawpowminer runtime
    • Downloads and serves AI models
    • Processes inference requests
    • Reports hashrate, memory, and availability
  3. Desktop App — User interface

    • GPU monitoring and charts
    • Model download manager
    • Wallet and earnings tracker
    • Global network visualization

Distributed Inference

Large models are split across multiple GPUs:

User Request
     │
     ▼
┌─────────────┐
│ Coordinator │
└─────────────┘
     │
     ├──────────────┬──────────────┐
     ▼              ▼              ▼
┌─────────┐   ┌─────────┐   ┌─────────┐
│ Miner A │──►│ Miner B │──►│ Miner C │
│ Layers  │   │ Layers  │   │ Layers  │
│  0-20   │   │  21-40  │   │  41-60  │
└─────────┘   └─────────┘   └─────────┘
                                 │
                                 ▼
                            Response

Configuration

The Rust miner reads runtime settings from CLI flags or environment variables:

QUAI_WALLET=0x...
QUAI_WALLET_PRIVATE_KEY=...
QUAI_COORDINATOR=coordinator.quai.network:9090
QUAI_MODEL=Qwen/Qwen2.5-7B-Instruct
QUAI_GPU_DEVICES=0

Mining Pools

The miner supports any Quai-compatible stratum pool. Default is StratumX.

StratumX Endpoints

RegionEndpoint
USstratum+tcp://mining-us.stratumx.org:3333
EUstratum+tcp://mining-eu.stratumx.org:3333
Singaporestratum+tcp://mining-sg.stratumx.org:3333
Hong Kongstratum+tcp://mining-hk.stratumx.org:3333
Indiastratum+tcp://mining-in.stratumx.org:3333
Icelandstratum+tcp://mining-is.stratumx.org:3333
Brazilstratum+tcp://mining-bz.stratumx.org:3333
Polandstratum+tcp://mining-po.stratumx.org:3333

Configure Pool

# Enable the Rust miner's local idle-mining sidecar.
# The pool URL is passed directly to kawpowminer as its -P value.
cd rust && cargo run -p quai-miner -- \
  --mode local \
  --model Qwen/Qwen2.5-7B-Instruct \
  --mine-when-idle \
  --kawpow-bin /path/to/kawpowminer \
  --mining-pool-url stratum+tcp://0xYourAddress.worker@mining-eu.stratumx.org:3333

# Or through environment variables
QUAI_MINE_WHEN_IDLE=true
QUAI_KAWPOW_BIN=/path/to/kawpowminer
QUAI_MINING_POOL_URL=stratum+tcp://0xYourAddress.worker@mining-us.stratumx.org:3333

API

The coordinator exposes an OpenAI-compatible API:

curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen2.5-7B-Instruct",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Supported Models

ModelSizeVRAM Required
Qwen 2.5 7B14 GB13 GB
Llama 3.3 70B126 GB126 GB (multi-GPU)
Mixtral 8x7B87 GB87 GB
DeepSeek V31.1 TBDistributed

Development

# Run coordinator locally
cd rust && cargo run -p quai-coordinator -- --http-addr 0.0.0.0:8080 --grpc-addr 0.0.0.0:9090

# Run miner (connects to coordinator)
cd rust && cargo run -p quai-miner -- \
  --mode coordinator \
  --coordinator localhost:9090 \
  --wallet 0xYourAddress \
  --wallet-private-key $QUAI_WALLET_PRIVATE_KEY \
  --model Qwen/Qwen2.5-7B-Instruct

# Run a standalone full-model local gateway
# Local transformer models use vLLM by default; RWKV/coordinator flows use SGLang.
cd rust && cargo run -p quai-miner -- \
  --mode local \
  --inference-backend auto \
  --model Qwen/Qwen2.5-7B-Instruct \
  --local-host 127.0.0.1 \
  --local-port 18080

# Run desktop app in dev mode
cd app && npm run dev

# Run with Tauri (native window)
cd app && npm run tauri dev

Building Releases

# Build all platforms
make release

# Outputs:
# - dist/quai-miner-x86_64-unknown-linux-gnu
# - dist/quai-coordinator-x86_64-unknown-linux-gnu
# - dist/Quai-Intelligence-0.1.0-x86_64.dmg      (macOS)
# - dist/Quai-Intelligence-0.1.0-x86_64.msi      (Windows)
# - dist/Quai-Intelligence-0.1.0-x86_64.AppImage (Linux)

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Submit a pull request

See CONTRIBUTING.md for guidelines.

License

MIT License — see LICENSE

Contributors

0xnovabyte

121 commits

0xalank

27 commits

0xalank/quai-intelligence

Decentralized, low cost, censorship-resistant AI inference that runs alongside Quai mining over a distributed network of commodity GPUs

Rust

0

148 commits

updated Jun 18, 2026

See the code

README

Quai Intelligence

Verified AI compute mesh powered by Quai. Mine QUAI when idle. Serve verified dense-model inference when scheduled.

License Platform

Overview

Quai Intelligence is a decentralized inference network optimized for dense-model serving. Workers mine QUAI by default, pause for paid inference work when scheduled, and prove correctness with Terkle-backed verification. Optional privacy modes keep the architecture usable for more sensitive workloads without making confidentiality claims the system cannot support on anonymous public GPUs.

Implementation Direction

Rust is the canonical backend direction for Quai Intelligence. New coordinator, miner, edge, P2P, verification, scheduling, and payment work belongs in the Rust workspace under rust/.

The older Go backend under cmd/, internal/, and pkg/ remains in the repository as a legacy/reference implementation until the Rust path proves parity for public-fast inference, miner registration, route issuance, verification, and local miner lifecycle. After the quarantine gate passes it is archived under archive/legacy-go/<commit>/. It should not receive new product features.

Python remains a narrow model-runtime adapter layer for SGLang, RWKV, vLLM, tokenizer support, and benchmarks. Routing, payment, session authorization, verification policy, and miner reputation belong in Rust.

See docs/RUST_CANONICAL_BACKEND.md for the migration policy and parity checklist.

Positioning

Quai Intelligence is:

  • a decentralized inference network
  • optimized for dense-model serving
  • equipped with optional privacy modes
  • backed by Terkle verification
  • designed so GPUs mine QUAI when idle and switch to inference work when scheduled

Quai Intelligence is not:

  • a general AI utility mesh
  • a storage or memory network
  • confidential compute on anonymous public GPUs
┌─────────────────────────────────────────────────────────────┐
│                    Quai Intelligence                        │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   Users                    Coordinator                      │
│   ─────                    ───────────                      │
│   Pay Qi for     ───────►  Routes requests   ───────►       │
│   inference                to GPU miners                    │
│                                                             │
│                            Miners                           │
│                            ──────                           │
│                            Run models, earn Qi              │
│                            Distributed globally             │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Features

  • Verified dense-model inference via Terkle-backed attestations, challenges, and semantic checks
  • Hybrid worker economics with default QUAI mining plus scheduled inference work
  • Sharded model serving for larger dense models across multiple miners
  • Optional privacy modes for edge-owned first/last layers
  • Desktop and browser UI for network visibility and miner control

Miner Ownership

quai-intelligence is the active home of the miner product.

  • rust/quai-miner/ is the canonical worker implementation target
  • rust/quai-coordinator/, rust/quai-p2p/, rust/quai-terkle/, and rust/quai-edge/ are the canonical backend crates for control plane, data plane, verification, and edge-private routing
  • internal/miner/ contains the legacy Go worker used as reference material during Rust parity work
  • kawpowminer/ is the vendored low-level mining runtime fork used by the worker
  • the canonical upstream for mining-runtime changes is the owned fork based on 0xalank/kawpowminer
  • separate prototype repos such as quai-miner-inference are not the ongoing implementation target

In practice this means:

  • memory management, pause/resume policy, and worker-facing performance improvements are planned and integrated from this repo
  • low-level CUDA / VRAM / miner-runtime changes land in the kawpowminer fork
  • high-level product work such as local mode, vllm, coordinator connectivity, API serving, route issuance, and verification orchestration is implemented in Rust
  • Go changes are limited to legacy fixes, parity reference tests, and migration support

Quick Start

Download

Or Build from Source

# Clone
git clone https://github.com/dominant-strategies/quai-intelligence
cd quai-intelligence

# Build canonical Rust backend
make build

# Build Rust release artifacts and desktop sidecars
make build-all

# Build desktop frontend
(cd app && npm ci && npm run build)

# Legacy Go reference build, if needed during migration
RUN_LEGACY_GO_TESTS=1 make build-go

Project Structure

quai-intelligence/
├── rust/                     # Canonical backend workspace
│   ├── quai-core/            # Shared types, config, model registry
│   ├── quai-proto/           # Rust protocol definitions
│   ├── quai-p2p/             # P2P tensor transport and compression
│   ├── quai-terkle/          # Terkle/KZG verification
│   ├── quai-coordinator/     # Canonical coordinator
│   ├── quai-miner/           # Canonical miner/worker
│   └── quai-edge/            # Trusted edge service
│
├── app/                      # Desktop application
│   ├── src/                  # React UI components
│   │   ├── components/
│   │   │   ├── Dashboard.tsx       # Main dashboard
│   │   │   ├── GlobeNetwork.tsx    # 3D world map
│   │   │   ├── GpuMonitor.tsx      # GPU performance charts
│   │   │   ├── MiningPanel.tsx     # Mining statistics
│   │   │   ├── ModelsPanel.tsx     # Model management
│   │   │   └── SettingsPanel.tsx   # Configuration
│   │   └── hooks/
│   ├── src-tauri/            # Tauri shell and sidecar management
│   │   ├── src/main.rs       # System integration
│   │   └── binaries/         # Bundled Rust sidecars for the current build target
│   └── package.json
│
├── cmd/                      # Legacy Go entrypoints
│   ├── coordinator/          # Network coordinator reference
│   └── miner/                # GPU miner reference
│
├── internal/                 # Legacy Go packages
│   ├── coordinator/          # Legacy routing/scheduling reference
│   ├── miner/                # Legacy worker/local-runtime reference
│   ├── p2p/                  # Legacy data-plane transport reference
│   └── sglang/               # Legacy sharded-runtime client reference
│
├── kawpowminer/              # Owned mining runtime fork vendored into this repo
│
├── docker/                   # Container configs
├── scripts/                  # Build & release scripts
├── Makefile                  # Build commands
└── go.mod

Architecture

Components

  1. Coordinator — Routes inference requests to available miners

    • Canonical implementation: rust/quai-coordinator/
    • Legacy reference: cmd/coordinator/ and internal/coordinator/
    • Load balancing across GPU tiers
    • Model-to-miner matching
    • Payment settlement
  2. Miner — Runs on GPU machines

    • Canonical implementation: rust/quai-miner/
    • Legacy reference: cmd/miner/ and internal/miner/
    • Launches and controls the vendored kawpowminer runtime
    • Downloads and serves AI models
    • Processes inference requests
    • Reports hashrate, memory, and availability
  3. Desktop App — User interface

    • GPU monitoring and charts
    • Model download manager
    • Wallet and earnings tracker
    • Global network visualization

Distributed Inference

Large models are split across multiple GPUs:

User Request
     │
     ▼
┌─────────────┐
│ Coordinator │
└─────────────┘
     │
     ├──────────────┬──────────────┐
     ▼              ▼              ▼
┌─────────┐   ┌─────────┐   ┌─────────┐
│ Miner A │──►│ Miner B │──►│ Miner C │
│ Layers  │   │ Layers  │   │ Layers  │
│  0-20   │   │  21-40  │   │  41-60  │
└─────────┘   └─────────┘   └─────────┘
                                 │
                                 ▼
                            Response

Configuration

The Rust miner reads runtime settings from CLI flags or environment variables:

QUAI_WALLET=0x...
QUAI_WALLET_PRIVATE_KEY=...
QUAI_COORDINATOR=coordinator.quai.network:9090
QUAI_MODEL=Qwen/Qwen2.5-7B-Instruct
QUAI_GPU_DEVICES=0

Mining Pools

The miner supports any Quai-compatible stratum pool. Default is StratumX.

StratumX Endpoints

RegionEndpoint
USstratum+tcp://mining-us.stratumx.org:3333
EUstratum+tcp://mining-eu.stratumx.org:3333
Singaporestratum+tcp://mining-sg.stratumx.org:3333
Hong Kongstratum+tcp://mining-hk.stratumx.org:3333
Indiastratum+tcp://mining-in.stratumx.org:3333
Icelandstratum+tcp://mining-is.stratumx.org:3333
Brazilstratum+tcp://mining-bz.stratumx.org:3333
Polandstratum+tcp://mining-po.stratumx.org:3333

Configure Pool

# Enable the Rust miner's local idle-mining sidecar.
# The pool URL is passed directly to kawpowminer as its -P value.
cd rust && cargo run -p quai-miner -- \
  --mode local \
  --model Qwen/Qwen2.5-7B-Instruct \
  --mine-when-idle \
  --kawpow-bin /path/to/kawpowminer \
  --mining-pool-url stratum+tcp://0xYourAddress.worker@mining-eu.stratumx.org:3333

# Or through environment variables
QUAI_MINE_WHEN_IDLE=true
QUAI_KAWPOW_BIN=/path/to/kawpowminer
QUAI_MINING_POOL_URL=stratum+tcp://0xYourAddress.worker@mining-us.stratumx.org:3333

API

The coordinator exposes an OpenAI-compatible API:

curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen2.5-7B-Instruct",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Supported Models

ModelSizeVRAM Required
Qwen 2.5 7B14 GB13 GB
Llama 3.3 70B126 GB126 GB (multi-GPU)
Mixtral 8x7B87 GB87 GB
DeepSeek V31.1 TBDistributed

Development

# Run coordinator locally
cd rust && cargo run -p quai-coordinator -- --http-addr 0.0.0.0:8080 --grpc-addr 0.0.0.0:9090

# Run miner (connects to coordinator)
cd rust && cargo run -p quai-miner -- \
  --mode coordinator \
  --coordinator localhost:9090 \
  --wallet 0xYourAddress \
  --wallet-private-key $QUAI_WALLET_PRIVATE_KEY \
  --model Qwen/Qwen2.5-7B-Instruct

# Run a standalone full-model local gateway
# Local transformer models use vLLM by default; RWKV/coordinator flows use SGLang.
cd rust && cargo run -p quai-miner -- \
  --mode local \
  --inference-backend auto \
  --model Qwen/Qwen2.5-7B-Instruct \
  --local-host 127.0.0.1 \
  --local-port 18080

# Run desktop app in dev mode
cd app && npm run dev

# Run with Tauri (native window)
cd app && npm run tauri dev

Building Releases

# Build all platforms
make release

# Outputs:
# - dist/quai-miner-x86_64-unknown-linux-gnu
# - dist/quai-coordinator-x86_64-unknown-linux-gnu
# - dist/Quai-Intelligence-0.1.0-x86_64.dmg      (macOS)
# - dist/Quai-Intelligence-0.1.0-x86_64.msi      (Windows)
# - dist/Quai-Intelligence-0.1.0-x86_64.AppImage (Linux)

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Submit a pull request

See CONTRIBUTING.md for guidelines.

License

MIT License — see LICENSE

Contributors

0xnovabyte

121 commits

0xalank

27 commits

Languages

Rust

28.9%

Shell

20.9%

C++

19.1%

Go

18.5%

Python

6.1%

TypeScript

1.8%

C

1.6%

CMake

1.4%

Cuda

1.2%