Skip to content

useviolet/violetaudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

707 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Violet Subnet - Audio Processing Network

Welcome to Violet, a cutting-edge Bittensor subnet dedicated to decentralized audio processing and AI-powered speech technologies. Our network leverages the power of distributed computing to provide high-quality transcription, text-to-speech synthesis, and audio analysis services.

🌟 Overview

Violet subnet enables a decentralized ecosystem where miners provide computational power for audio processing tasks while validators ensure quality and distribute rewards. The network integrates with a hosted proxy server for seamless task management and real-time processing.

πŸ—οΈ System Architecture

Key Components

  1. Miners (Computational Nodes)

    • Audio Processing: Transcription, TTS, and audio analysis
    • Task Execution: Processes assigned tasks with AI models
    • Response Submission: Sends results back to proxy server
    • Performance Monitoring: Tracks processing times and accuracy
  2. Validators (Quality Assurance)

    • Response Evaluation: Assesses miner response quality
    • Reward Distribution: Calculates and distributes TAO rewards
    • Network Health: Monitors miner performance and availability

πŸ” Security & Best Practices

  • Never commit .env files - They contain sensitive credentials
  • Use virtual environments - Isolate dependencies for each project
  • Keep API keys secure - Rotate keys if compromised
  • Monitor GPU usage - Ensure adequate cooling and power supply
  • Regular updates - Keep dependencies and codebase up to date

πŸ’» System Requirements

Operating System

  • Linux (Ubuntu 20.04+ recommended)
  • macOS (10.15+)

Hardware Requirements

For Miners

  • RAM: 12 GB minimum
  • Storage: 500 GB SSD
  • GPU: NVIDIA GPU with 12 GB VRAM minimum (recommended for TTS tasks)
  • Network: Stable internet connection (100+ Mbps)

For Validators

  • RAM: 12 GB minimum
  • Storage: 500 GB SSD
  • GPU: NVIDIA GPU with 12 GB VRAM minimum
  • Network: Stable internet connection (100+ Mbps)

Software Dependencies

  • Python 3.10 (Required - Coqui TTS does not support Python 3.12)
  • CUDA 11.8+ (for GPU acceleration)
  • Bittensor CLI (pip install bittensor-cli)

⚠️ Important: Coqui TTS (used for text-to-speech) requires Python 3.9-3.11. Python 3.12 is NOT supported. You MUST use Python 3.10 in a virtual environment.

πŸš€ Quick Start

Step 1: Clone the Repository

git clone https://github.com/hivetrainai/violet.git
cd violet

Step 2: Create Python 3.10 Virtual Environment

⚠️ CRITICAL: Coqui TTS requires Python 3.10. You MUST create a Python 3.10 virtual environment before installing dependencies.

# Check if Python 3.10 is available
python3.10 --version

# If Python 3.10 is not installed, install it first:
# On macOS (using Homebrew):
# brew install python@3.10
# On Ubuntu/Debian:
# sudo apt-get install python3.10 python3.10-venv

# Create Python 3.10 virtual environment
python3.10 -m venv venv_py310

# Activate virtual environment
# On Linux/macOS:
source venv_py310/bin/activate
# On Windows:
venv_py310\Scripts\activate

# Verify Python version (should show 3.10.x)
python --version

Step 3: Install Dependencies

⚠️ IMPORTANT: Ensure you are in the Python 3.10 virtual environment before installing:

# Verify you're in Python 3.10 virtual environment
python --version  # Should show Python 3.10.x

# Upgrade pip and setuptools
pip install --upgrade pip setuptools wheel

# IMPORTANT: Handle numpy/bittensor conflict
# bittensor==9.10.0 requires numpy>=2.0.1, but Coqui TTS requires numpy<1.25
# Install in this specific order to resolve the conflict:

# 1. Install numpy first (required for Coqui TTS/numba, despite coqui-tts declaring numpy>=1.26.0)
pip install "numpy>=1.24.0,<1.25.0"

# 2. Install bittensor without dependencies to avoid numpy conflict
pip install --no-deps bittensor==9.10.0

# 3. Install bittensor's dependencies (excluding numpy which is already installed)
pip install aiohttp async-substrate-interface asyncstdlib bittensor-drand bittensor-wallet colorama fastapi msgpack-numpy-opentensor munch nest_asyncio netaddr packaging pycryptodome pydantic python-statemachine pyyaml requests retry scalecodec setuptools uvicorn wheel

# 4. Install numba and llvmlite (required by coqui-tts, but install after numpy to avoid conflicts)
pip install "numba>=0.58.0" "llvmlite>=0.40.0"

# 5. Install coqui-tts without dependencies to avoid numpy/numba conflict
#    (coqui-tts declares numpy>=1.26.0 and numba>=0.58.0, but we use numpy 1.24.x)
pip install --no-deps coqui-tts>=0.27.0

# 6. Install coqui-tts dependencies manually
pip install coqui-tts-trainer>=0.3.0 coqpit-config>=0.2.0 einops>=0.6.0 encodec>=0.1.1 monotonic-alignment-search>=0.2.0 num2words>=0.5.14 pysbd>=0.3.4 inflect>=5.6.0 anyascii>=0.3.0 matplotlib>=3.8.4 "gruut[de,es,fr]>=2.4.0" ko-speech-tools>=0.1.0 torchcodec

# 7. Install remaining requirements (bittensor and coqui-tts are commented out in requirements.txt)
pip install -r requirements.txt

# Note: Skip "pip install -e ." to avoid additional conflicts with setup.py

Step 4: Install System Dependencies

Install FFmpeg and related libraries (required for audio/video processing):

# On Ubuntu/Debian:
sudo apt install -y ffmpeg libavutil-dev libavcodec-dev libavformat-dev libavdevice-dev

# On macOS (using Homebrew):
# brew install ffmpeg

Step 5: Set Up Environment Variables

Create a .env file in the project root directory with the following required variables:

# Required: Hugging Face Token for model downloads
HF_TOKEN=your_huggingface_token_here

# Required: API Key for miner (get from subnet admin)
MINER_API_KEY=your_miner_api_key_here

# Required: API Key for validator (get from subnet admin)
VALIDATOR_API_KEY=your_validator_api_key_here

# Optional: Proxy server URL (defaults to production)
PROXY_SERVER_URL=https://violet-proxy-bl4w.onrender.com

Getting Your Tokens and API Keys

  1. Hugging Face Token:

  2. Miner/Validator API Keys:

    • Contact the subnet administrator to obtain your API keys
    • Add them to your .env file as MINER_API_KEY and/or VALIDATOR_API_KEY

Important: Never commit your .env file to version control. It contains sensitive credentials.

Step 6: Create Wallets

Create a coldkey and hotkey for your subnet wallet:

# Install bittensor CLI (if not already installed)
pip install bittensor-cli

# Create a coldkey for the validator/miner
btcli wallet new_coldkey --wallet.name <your_wallet_name>

# Create a hotkey for the validator/miner
btcli wallet new_hotkey --wallet.name <your_wallet_name> --wallet.hotkey default

Step 7: Register on the Subnet

Register as a miner or validator on the subnet:

Mainnet (NetUID TBC):

btcli subnet register --netuid 49 --subtensor.network finney --wallet.name <your_wallet_name> --wallet.hotkey default

Testnet (NetUID 292):

btcli subnet register --netuid 292 --subtensor.network test --wallet.name <your_wallet_name> --wallet.hotkey default

Note: Registration requires 0.005 TAO for mainnet or test tokens for testnet.

Step 8: Run the Miner

⚠️ IMPORTANT: Before running the miner, ensure you are in the Python 3.10 virtual environment:

# Activate Python 3.10 virtual environment
source venv_py310/bin/activate  # Linux/macOS
# or
venv_py310\Scripts\activate  # Windows

# Verify you're using Python 3.10
python --version  # Should show Python 3.10.x

Mainnet:

python neurons/miner.py \
  --netuid TBC \
  --subtensor.network finney \
  --wallet.name <your_wallet_name> \
  --wallet.hotkey <your_hotkey> \
  --logging.debug \
  --axon.ip 0.0.0.0 \
  --axon.port <PORT> \
  --axon.external_ip <YOUR_PUBLIC_IP> \
  --axon.external_port <PORT>

Testnet:

python neurons/miner.py \
  --netuid 292 \
  --subtensor.network test \
  --wallet.name <your_wallet_name> \
  --wallet.hotkey <your_hotkey> \
  --logging.debug \
  --axon.ip 0.0.0.0 \
  --axon.port <PORT> \
  --axon.external_ip <YOUR_PUBLIC_IP> \
  --axon.external_port <PORT>

Step 9: Run the Validator

⚠️ IMPORTANT: Before running the validator, ensure you are in the Python 3.10 virtual environment:

# Activate Python 3.10 virtual environment
source venv_py310/bin/activate  # Linux/macOS
# or
venv_py310\Scripts\activate  # Windows

# Verify you're using Python 3.10
python --version  # Should show Python 3.10.x

Mainnet:

python neurons/validator.py \
  --netuid TBC \
  --subtensor.network finney \
  --wallet.name <your_wallet_name> \
  --wallet.hotkey <your_hotkey> \
  --logging.debug \
  --axon.ip 0.0.0.0 \
  --axon.port <PORT> \
  --axon.external_ip <YOUR_PUBLIC_IP> \
  --axon.external_port <PORT>

Testnet:

python neurons/validator.py \
  --netuid 292 \
  --subtensor.network test \
  --wallet.name <your_wallet_name> \
  --wallet.hotkey <your_hotkey> \
  --logging.debug \
  --axon.ip 0.0.0.0 \
  --axon.port <PORT> \
  --axon.external_ip <YOUR_PUBLIC_IP> \
  --axon.external_port <PORT>

πŸ“‹ Network Configuration

Network NetUID Network Name Registration Cost
Mainnet TBC finney 0.005 TAO
Testnet 292 test 0.005 test tokens

πŸ”§ Configuration

GPU Configuration

Ensure your GPU is properly configured for CUDA:

# Check CUDA installation
nvidia-smi

# Verify PyTorch CUDA support
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
python -c "import torch; print(f'CUDA version: {torch.version.cuda}')"

Environment Variables Summary

Variable Required Description
HF_TOKEN βœ… Yes Hugging Face token for downloading AI models
MINER_API_KEY βœ… Yes (for miners) API key for miner authentication
VALIDATOR_API_KEY βœ… Yes (for validators) API key for validator authentication
PROXY_SERVER_URL ❌ No Proxy server URL (defaults to production)

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support and questions:

  • Create an issue on GitHub
  • Check the troubleshooting section
  • Review the API documentation

Built with ❀️ for the Bittensor community

About

Voice AI infrastructure and audio processing toolkit

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages