We will be undergoing planned maintenance on Oct 7th 6:00AM UTC / Oct 7th 2:00AM ET

Inspiration

The inspiration for HiveMind came from the realization that while AI models are getting smaller and more efficient, the hardware required to run them remains centralized in massive data centers. We saw an opportunity to democratize AI compute by leveraging the "wasted" processing power of everyday laptops and devices. We wanted to create a system where the community could pool their resources to form a collective intelligence that is greater than the sum of its parts.

What it does

HiveMind is a decentralized, P2P AI orchestration platform. It allows a "Master" node to distribute complex natural language processing tasks across a mesh of "Worker" nodes. Using a custom MapReduce-inspired architecture, HiveMind can take a large prompt, split it into shards, dispatch those shards to different computers in the network, and reassemble the results into a coherent output. It effectively turns a room full of laptops into a distributed supercomputer for local AI inference.

How we built it

We built the core engine using Node.js. For the networking layer, we utilized Hyperswarm, a distributed networking stack that allows nodes to find and connect to each other without a central server using a DHT. The "brains" of the project are powered by Transformers.js, running the SmolLM2-135M-Instruct model via ONNX Runtime. We implemented a custom NDJSON-based protocol for reliable communication over TCP and used HMAC (Hash-based Message Authentication Code) to ensure the integrity and security of the tasks being distributed.

Challenges we ran into

One of the biggest hurdles was the "Unauthorized access" errors from Hugging Face when attempting to download models through a headless Node.js environment; we solved this by implementing a custom hub-fetching configuration. Networking was another challenge; navigating NAT traversal and firewalls (especially on Fedora/Linux) required us to deeply understand UDP hole punching. Finally, managing the asynchronous nature of P2P—where nodes can disconnect at any moment—required us to build a robust state-management system to ensure no task is ever lost in the "void."

Accomplishments that we're proud of

We are incredibly proud of achieving a functional MapReduce split on a local P2P network. Seeing a single prompt get physically chopped into pieces, sent to two different laptops, and then seeing the results arrive back and merge perfectly on the Master screen was a "eureka" moment. We also successfully implemented a resource-aware scheduler that identifies the hardware capabilities (VRAM/TFLOPS) of each node before assigning work.

What we learned

We gained deep insights into the Noise Protocol used for P2P encryption and the complexities of distributed systems. We learned that the bottleneck in decentralized AI isn't always raw compute—it’s often the latency of the network "handshake." We also learned how to optimize small language models (SLMs) to run efficiently on standard CPUs using WASM and ONNX, proving that you don't always need an $80,000 GPU to run smart local agents.

What's next for HiveMind

The next step for HiveMind is Model Sharding. Instead of every node running the same model, we want to split the actual layers of a massive model (like Llama-3 70B) across multiple peers, allowing them to run models that would be impossible to fit on a single consumer laptop. We also plan to integrate a Blockchain-based incentive layer so that contributors can be rewarded for the compute they provide to the HiveMind.

Built With

Share this project:

Updates

Submission history