Spaces:
Build error
Build error
β Environment Configuration Complete
Status: π READY TO LAUNCH
Date: January 16, 2026
User: Keith
π Your Hugging Face Token
Token: YOUR_HUGGINGFACE_TOKEN_HERE
Status: β
Configured in .env file
π Quick Start (3 Commands)
# 1. Create .env file with your token
python scripts/create_env_with_token.py
# 2. Start services with Docker
docker-compose up -d
# 3. Open in browser
start http://localhost:3000
That's it! π
π Detailed Setup Steps
Step 1: Create .env File
Windows:
scripts\create_env_with_token.bat
Linux/Mac:
python scripts/create_env_with_token.py
What this does:
- β
Creates
backend/.envwith your HF token - β Generates secure secret key
- β Configures all environment variables
- β Sets up development defaults
Step 2: Install Dependencies
# Backend
cd backend
pip install -e ".[dev]"
# Frontend
cd frontend
pnpm install
Step 3: Initialize Database
cd backend
python scripts/init_db.py
Step 4: Start Services
Option A: Docker (Recommended)
docker-compose up -d
Option B: Manual
# Terminal 1: Backend
cd backend
uvicorn app.main:app --reload
# Terminal 2: Frontend
cd frontend
pnpm dev
β Verify Setup
# Check backend health
curl http://localhost:8000/health
# Check frontend
curl http://localhost:3000
# Verify HF token is loaded
cd backend
python -c "from app.core.config import settings; print('β
Token loaded!' if settings.HUGGINGFACE_TOKEN else 'β Token missing')"
π΅ Test Music Generation
# Create a test generation
curl -X POST http://localhost:8000/api/v1/generations \
-H "Content-Type: application/json" \
-d '{
"prompt": "A calm acoustic guitar melody",
"duration": 10
}'
Or visit http://localhost:3000 and use the UI!
π What's Configured
Your backend/.env contains:
β
HUGGINGFACE_TOKEN=YOUR_HUGGINGFACE_TOKEN_HERE
β
HF_TOKEN=YOUR_HUGGINGFACE_TOKEN_HERE
β
SECRET_KEY=<auto-generated-secure-key>
β
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/audioforge
β
REDIS_URL=redis://localhost:6379/0
β
MUSICGEN_DEVICE=cpu
β
BARK_DEVICE=cpu
β
DEMUCS_DEVICE=cpu
β
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
β
DEBUG=true
β
ENVIRONMENT=development
β
All features enabled
π― Access Points
After starting services:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
π‘ Pro Tips
π GPU Acceleration
If you have NVIDIA GPU with CUDA:
# Check CUDA availability
python -c "import torch; print('β
CUDA!' if torch.cuda.is_available() else 'β No CUDA')"
# If available, edit backend/.env:
MUSICGEN_DEVICE=cuda
BARK_DEVICE=cuda
DEMUCS_DEVICE=cuda
Benefit: 10-50x faster generation! β‘
π¦ Model Downloads
Models download automatically on first use:
| Model | Size | Download Time |
|---|---|---|
| MusicGen Small | ~1.5GB | 2-5 minutes |
| Bark Small | ~2GB | 3-7 minutes |
| Demucs | ~300MB | 1-2 minutes |
Total: ~4GB (one-time download)
Location: ~/.cache/huggingface/hub/
π Security Notes
- β
.envis in.gitignore(won't be committed) - β
Token is only in your local
.envfile - β
Never share your
.envfile - β Keep your HF token private
π Troubleshooting
Backend won't start?
cd backend
python scripts/verify_setup.py
Token not working?
# Verify token in .env
cat backend/.env | grep HF_TOKEN
# Test token validity
curl -H "Authorization: Bearer YOUR_HUGGINGFACE_TOKEN_HERE" \
https://huggingface.co/api/whoami
Models won't download?
# Test manual download
cd backend
python -c "
from transformers import AutoProcessor
processor = AutoProcessor.from_pretrained('facebook/musicgen-small')
print('β
Models can download!')
"
Database connection error?
# Start PostgreSQL with Docker
docker-compose up -d postgres
# Initialize database
cd backend && python scripts/init_db.py
π Documentation
- Quick Start: QUICK_START.md
- Full Setup: SETUP.md
- HF Token Guide: HUGGINGFACE_SETUP.md
- Launch Guide: LAUNCH_GUIDE.md
- Production Ready: PRODUCTION_READY.md
π You're All Set!
Your environment is 100% configured and ready to go!
Next Steps:
- Run:
python scripts/create_env_with_token.py - Start:
docker-compose up -d - Visit: http://localhost:3000
- Generate: Your first AI music! π΅
π Need Help?
# Run comprehensive verification
python scripts/launch_verification.py --verbose
# Generate launch report
python scripts/generate_launch_report.py
# Check all systems
cd backend && python scripts/verify_setup.py
πΌβ‘ Your Hugging Face token is configured. Time to make some music! π΅
Forged by: FusionPanda
Status: Production Ready
Date: January 16, 2026