This project enables a decentralized network for training GPT models via Bittensor. Miners submit model implementations, and validators evaluate them to determine network weights.
- Python 3.8+
- Docker + NVIDIA Container Toolkit (for GPU validation)
- Bittensor wallet (
btcli w new_coldkey,btcli w new_hotkey) - GitHub Personal Access Token (for validator)
- Clone this repository
git clone [REPO_URL] && cd [REPO_NAME]
pip install -r requirements.txtEdit config.py:
# For testnet
network = "test"
netuid = 100 # Subnet UID
wallet_name = "your_wallet"
wallet_hotkey = "your_hotkey"
weight_server_url = "http://your-server:8000"-
Implement Components in
miner_submission.py:- Custom
AttentionBlock GPTModelarchitecture- Training
Optimizer LossFunction
- Custom
-
Push to GitHub repository containing:
miner_submission.pyhotkey.json(contains your Bittensor hotkey SS58 address)
-
Submit to Chain:
python submit_to_chain.py \
--repo yourgithub/repo \
--wallet-name your_wallet \
--wallet-hotkey your_hotkey \
--network test for testnet finney for mainnet \
--subnet-uid 100 for testnet 49 for mainnet- Start Weight Server (separate terminal):
python weight_server.py- Run Validator:
export GITHUB_TOKEN=your_github_token
python main.py- Syncs with Bittensor chain every 10 minutes
- Pulls new submissions from GitHub
- Runs Docker containers to:
- Generate model fingerprints
- Check for code duplicates
- Evaluate training performance
- Scores models based on validation loss
- Updates network weights via weight server
- Validators send scores to
weight_server.py - Server verifies signatures and updates on-chain weights
- Container isolation with read-only filesystems
- Signature verification for weight updates
- Duplicate detection through code hashing
Check databases for validation results:
submissions.db- Current submissionsmodel_records.db- Historical validation data
- Docker Permissions: Ensure user in docker group
- GPU Access: Verify nvidia-docker installation
- Chain Sync: Check
btt_connector.pylogs for sync errors - Rate Limits: Validator automatically handles GitHub API limits