Architecture

Rakis uses a layered architecture to manage the highly parallel, compute-intensive tasks needed for decentralized inference. This design ensures that different components can operate independently without interference. The layers communicate through events and maintain their own internal queues to handle any impedance mismatches that occur.

Web Workers are heavily employed to offload computations from the main thread, thereby improving overall performance. However, certain critical components, such as those dependent on WebRTC, must remain in the main thread and cannot be moved into workers.

This layered architecture not only simplifies modifications and additions but also facilitates future refactoring, migration, and enhancement of various system components.

Layer Overview

  • Layer 1: P2P and Peering Handles peer-to-peer networking and peer discovery.

  • Layer 2: Inference Manages inference requests, workers, embeddings, and queue management.

  • Layer 3: Coordination Coordinates network events, commit-reveal processes, and quorum building.

  • Layer 4: Consensus Computes final consensus using embeddings and hashing, and propagates results.

  • Layer 5: Persistence Integrates with blockchains for data persistence and incentivization.

Last updated