Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

P2P AI Mass-Distillation System

This repository contains a reference cross-platform Node.js function app for a Decentralized BitTorrent-style AI Model Training System.

The goal of this system is to allow open-source AI models to train on rollouts shared with each other via peer-to-peer (P2P) inference calls without relying on a centralized coordinator or central data servers.

Contents

  • app/: A foundational TypeScript Node.js Command-Line Interface (CLI) that demonstrates the P2P swarm logic, data hashing (Rollout Torrents), and Sybil-resistant local validation logic.

Architecture Highlights

  • Zero Central Coordination: Relies on a DHT (Distributed Hash Table) for discovering peers, bypassing central trackers.
  • Rollout Torrents: Training data [prompt, response, reward] is securely hashed and addressed via SHA-256 chunks, ensuring data immutability.
  • Anti-Poisoning (Trust Ledger): Instead of a central authority verifying data, trainers locally evaluate a random sample of downloaded rollouts using "Loss Thresholding" to determine if data is toxic or valid.
  • Tit-for-Tat Incentive: Built-in bandwidth allocation mechanics prioritize nodes that share beneficial data.

Installation & Running the Function App

The application is built in Node.js + strict TypeScript, making it natively cross-platform across Windows, macOS, and Linux.

Prerequisites

Step 1: Clone the Repository

git clone https://github.com/YOUR_USERNAME/P2P-distillation.git
cd P2P-distillation/app

(Note: Change YOUR_USERNAME to your GitHub username or organization).

Step 2: Install Dependencies

Install the required packages (TypeScript, Commander, etc.):

npm install

Step 3: Run the Test Suite

Verify that the core anti-poisoning, DHT stub, and rollout generation logic works on your machine using the automated tests:

npm test

You should see output indicating that all P2P Network and Rollout Distribution tests have passed.

Step 4: Build the CLI

Compile the TypeScript code into a native executable format:

npm run build

Step 5: Start a Seeder Node

Run the application to spin up a mock Seeder node that produces rollouts and connects to the P2P network:

node dist/index.js start --role seeder --boostrap "node-alpha-1"

(Wait a few seconds to see the Seeder connect to peers and begin broadcasting mocked inference rollouts to the DHT).


Disclaimer: This code currently implements the localized stubs for DHT discovery, inference generation, and validation for demonstration/architectural purposes. Integration into major ML frameworks (e.g. PyTorch, Hugging Face) for full localized backpropagation is slated for subsequent phases.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages