AudioForge / backend /README.md
OnyxlMunkey's picture
c618549

AudioForge Backend

FastAPI backend for open-source music generation.

Setup

  1. Install dependencies:
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your settings
  1. Start PostgreSQL and Redis (using Docker):
docker-compose up -d postgres redis
  1. Run migrations:
alembic upgrade head
  1. Start the server:
uvicorn app.main:app --reload

Music Generation Models

MusicGen (Required)

MusicGen is used for instrumental music generation. It will be automatically downloaded on first use.

Bark (Optional)

Bark is used for vocal generation. To install:

pip install bark

Or use the Hugging Face transformers version:

pip install transformers[torch] soundfile

Then update app/services/vocal_generation.py to use the transformers-based implementation.

API Documentation

Once running, visit:

Testing

pytest tests/ -v

Development

# Format code
make format

# Type check
make type-check

# Lint
make lint