xiaohongshu
xiaohongshu
templar-miner-claude-skill
This skill should be used when setting up, optimizing, or managing Templar AI miners on Bittensor Subnet 3 (netuid 3). Use it for tasks involving miner configuration, performance optimization, troubleshooting gradient scoring issues, managing Bittensor wallets with btcli, monitoring miner metrics...
Full skill instructions
Set up, optimize, and manage Templar AI miners to achieve top performance in the Templar decentralized training network (Bittensor Subnet 3, netuid 3). This skill provides expert guidance on miner operations, from initial wallet setup through advanced optimization strategies.
Initial Setup Workflow:
Create Bittensor Wallet (see references/bittensor_btcli.md for complete commands):
btcli wallet new-coldkey --wallet.name default --n-words 12
btcli wallet new-hotkey --wallet.name default --wallet.hotkey miner --n-words 12
Register to Templar Subnet:
btcli subnet register --wallet.name default --wallet.hotkey miner \
--netuid 3 --subtensor.network finney
Configure Environment (use scripts/setup_miner_env.sh):
./scripts/setup_miner_env.sh
# Then edit .env file with credentials
Verify Setup (use scripts/check_miner_health.py):
python scripts/check_miner_health.py
Install Templar:
git clone https://github.com/one-covenant/templar
cd templar
pip install -e .
Launch Miner:
python neurons/miner.py \
--wallet.name default \
--wallet.hotkey miner \
--netuid 3 \
--subtensor.network finney \
--device cuda
Hardware Requirements:
Note: Smaller configurations (4x H100, etc.) are unlikely to be competitive for rewards. For GPU rentals, see the GPU Rental via Basilica section below.
GPU Rental via Basilica:
For those without access to 8x H200 GPUs, rent them through Basilica's decentralized compute marketplace. The basilica-cli-helper Claude skill (https://github.com/synapz-org/basilica-cli-claude-skill) integrates seamlessly with this Templar skill.
Quick Basilica Workflow:
Check Available GPUs:
basilica ls
basilica price --gpu h200 # Check H200 pricing
Rent GPUs:
basilica up h200 --gpu-count 8
Check Active Rentals:
basilica ps # Note the rental UID
Setup Miner on Rental:
# Copy setup script to rental
basilica cp scripts/setup_miner_env.sh [rental-id]:/root/
# Execute setup on rental
basilica exec --target [rental-id] "bash /root/setup_miner_env.sh"
# Copy environment file after editing
basilica cp .env [rental-id]:/root/templar/
# Install Templar
basilica exec --target [rental-id] "git clone https://github.com/one-covenant/templar && cd templar && pip install -e ."
Launch Miner on Rental:
basilica exec --target [rental-id] "cd /root/templar && python neurons/miner.py --wallet.name default --wallet.hotkey miner --netuid 3 --device cuda"
Monitor and Manage:
# Copy logs back
basilica cp [rental-id]:/root/templar/logs/ ./local-logs/
# Terminate when done
basilica down [rental-id]
Cost Optimization Tips:
basilica pricebasilica ps to track runtime and costsIntegration Note: When using both skills together, Claude can automatically coordinate between Templar mining operations and Basilica GPU rentals. Simply ask: "Help me set up a Templar miner on rented Basilica GPUs."
Memory Optimization Tactics:
Parameter Offloading (neurons/miner.py:493-496):
Error Feedback Management:
Mixed Precision:
"mixed_precision_param": "bfloat16"Gradient Quality Optimization:
Error Feedback Momentum (Critical for 64x compression):
momentum_decay (default: 0.95)Compression Hyperparameters:
{
"topk_compression": 64, // Top 64 coefficients
"target_chunk": 64, // DCT chunk size
"momentum_decay": 0.95 // Momentum factor
}
Data Assignment Synchronization:
Communication Optimization:
Peer Selection Strategy:
{
"gather_peer_count": 20, // Peers to gather from
"gather_share": 0.75, // 75% success target
"gather_top_ratio": 2.0 // Bias toward high-stake peers
}
Async Transfers:
Key Metrics to Track:
WandB Dashboard (https://wandb.ai/tplr/templar):
miner/window_entry_loss: Loss at window startminer/tokens_per_sec: Training throughputminer/gather_success_rate: % of peers respondedminer/gpu_memory_allocated: VRAM usageminer/global_grad_norm: Gradient magnitudeGrafana Dashboard (https://grafana.tplr.ai):
Critical Alert Thresholds:
For complete details, see references/incentive_mechanism.md.
Core Scoring Formula:
s_i = L_before - L_after
Where validators:
Moving Average:
s̄_i = α * s_i + (1 - α) * s̄_i (α = 0.05)
Penalties:
Target Metrics for Top Miners:
Issue: Missing Gradients
Symptoms:
Solutions:
aws s3 ls s3://$R2_GRADIENTS_BUCKET_NAME \
--endpoint-url https://$R2_GRADIENTS_ACCOUNT_ID.r2.cloudflarestorage.com
Issue: Low Gather Success Rate
Symptoms:
Solutions:
Issue: Negative Gradient Scores
Symptoms:
Solutions:
Issue: Desynchronization (Low Sync Score)
Symptoms:
Solutions:
Issue: OOM (Out of Memory) Errors
Symptoms:
Solutions:
Issue: Slow Training (Missing Windows)
Symptoms:
Solutions:
Strategy 1: Maximize Uptime
Strategy 2: Optimize Gradient Quality
Strategy 3: Maximize Peer Connectivity
Strategy 4: Stay Synchronized
Strategy 5: Continuous Monitoring
Strategy 6: Network Participation
Strategy 7: Hardware Investment
Learning Rate Optimization:
{
"adamw": {
"learning_rate": 1.17e-4, // Default starting point
"warmup_steps": 1500, // Gradual ramp-up
"scheduler": {
"t_max": 140000, // Cosine annealing period
"eta_min_factor": 0.1 // Min LR = 10% of max
}
}
}
Momentum Decay Tuning:
Compression Ratio Tuning:
check_miner_health.py: Comprehensive health check for miner setup
setup_miner_env.sh: Generate template .env file with all required variables
templar_architecture.md: Complete codebase structure and file locations
incentive_mechanism.md: Detailed scoring and reward system
bittensor_btcli.md: Complete btcli command reference
When helping users with Templar mining:
When referencing Templar code, use the pattern file_path:line_number:
neurons/miner.py:354-942src/tplr/neurons.py:47-222src/tplr/compress.py:51-142neurons/validator.py:1644-1940src/tplr/neurons.py:152neurons/miner.py:705-726See references/templar_architecture.md for complete file structure and line references.
The goal is to help users become top-performing miners in the Templar network through systematic setup, optimization, monitoring, and iterative improvement.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience