Skip to main content

Module distributed

Module distributed 

Source
Expand description

Distributed serving infrastructure for Pictor.

Provides a consistent hash ring for request routing across multiple inference nodes, a node registry with health tracking, and a multi-node coordinator that manages cluster topology.

§Architecture

 ┌────────────────────────────────────────────┐
 │  DistributedCoordinator                    │
 │  ┌──────────────────────────────────────┐  │
 │  │  NodeRegistry                        │  │
 │  │  ┌────────────────────────────────┐  │  │
 │  │  │  ConsistentHashRing            │  │  │
 │  │  │  [VNode, VNode, ..., VNode]    │  │  │
 │  │  └────────────────────────────────┘  │  │
 │  │  HashMap<node_id, NodeInfo>          │  │
 │  └──────────────────────────────────────┘  │
 └────────────────────────────────────────────┘

The hash ring uses FNV-1a (64-bit) with virtual nodes for even distribution. All state is in-memory — no actual TCP connections are made.

Structs§

ConsistentHashRing
Consistent hash ring with virtual nodes for even load distribution.
CoordinatorConfig
Configuration for a DistributedCoordinator instance.
DistributedCoordinator
In-memory multi-node coordinator.
NodeInfo
Runtime information about a single serving node.
NodeRegistry
Cluster membership store backed by a consistent hash ring.
VNode
A virtual node on the ring — maps a hash position to a backend node.

Functions§

fnv1a_hash
FNV-1a 64-bit hash — fast, good distribution, no external deps.