Lattica: A Decentralized Cross-NAT Communication Framework for Scalable AI Inference and Training
Ween Yang, Jason Liu, Suli Wang, Xinyuan Song, Lynn Ai, Eric Yang, Bill Shi
TL;DR
Lattica tackles the challenge of scaling AI workloads beyond centralized data centers by providing a decentralized cross-NAT communication substrate. It integrates multi-protocol NAT traversal, a CRDT-based decentralized data store, content-addressed storage with DHT-based CID discovery, and an RPC streaming layer to support sharded inference and distributed training. Key contributions include a Rust/libp2p-based architecture with Python SDK bindings, Bitswap-inspired data exchange, and practical evaluations showing direct connectivity in ~70% of NAT scenarios and robust RPC throughput across regional and intercontinental links (e.g., up to ~10k QPS for 128 B locally, ~1.2k QPS WAN, ~110 QPS intercontinental for 256 KB). The framework enables edge intelligence, collaborative reinforcement learning, and federated/volunteer computing by eliminating reliance on centralized intermediaries, paving the way for sovereign and scalable decentralized AI deployments.
Abstract
The rapid expansion of distributed Artificial Intelligence (AI) workloads beyond centralized data centers creates a demand for new communication substrates. These substrates must operate reliably in heterogeneous and permissionless environments, where Network Address Translators (NATs) and firewalls impose significant constraints. Existing solutions, however, are either designed for controlled data center deployments or implemented as monolithic systems that tightly couple machine learning logic with networking code. To address these limitations, we present Lattica, a decentralized cross-NAT communication framework designed to support distributed AI systems. Lattica integrates three core components. First, it employs a robust suite of NAT traversal mechanisms to establish a globally addressable peer-to-peer mesh. Second, it provides a decentralized data store based on Conflict-free Replicated Data Types (CRDTs), ensuring verifiable and eventually consistent state replication. Third, it incorporates a content discovery layer that leverages distributed hash tables (DHTs) together with an optimized RPC protocol for efficient model synchronization. By integrating these components, Lattica delivers a complete protocol stack for sovereign, resilient, and scalable AI systems that operate independently of centralized intermediaries. It is directly applicable to edge intelligence, collaborative reinforcement learning, and other large-scale distributed machine learning scenarios.
