diff --git a/.github/workflows/build-cuda.yml b/.github/workflows/build-cuda.yml new file mode 100644 index 00000000..7076b3f4 --- /dev/null +++ b/.github/workflows/build-cuda.yml @@ -0,0 +1,73 @@ +name: Build CUDA Backend + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + build-cuda-windows: + runs-on: windows-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r backend/requirements.txt + + - name: Install PyTorch with CUDA 12.1 + run: | + pip install torch --index-url https://download.pytorch.org/whl/cu121 --force-reinstall --no-deps + pip install torchaudio --index-url https://download.pytorch.org/whl/cu121 + + - name: Verify CUDA support in torch + run: | + python -c "import torch; print(f'CUDA available in build: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda}')" + + - name: Build CUDA server binary + shell: bash + working-directory: backend + run: python build_binary.py --cuda + + - name: Split binary for GitHub Releases + shell: bash + run: | + python scripts/split_binary.py \ + backend/dist/voicebox-server-cuda.exe \ + --output release-assets/ + + - name: Upload split parts to GitHub Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: | + release-assets/voicebox-server-cuda.part*.exe + release-assets/voicebox-server-cuda.sha256 + release-assets/voicebox-server-cuda.manifest + draft: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload binary as workflow artifact (for testing) + uses: actions/upload-artifact@v4 + with: + name: voicebox-server-cuda-windows + path: backend/dist/voicebox-server-cuda.exe + retention-days: 7 + + # Linux CUDA build can be added later with: + # build-cuda-linux: + # runs-on: ubuntu-22.04 + # ... diff --git a/CHANGELOG.md b/CHANGELOG.md index b7116d39..d662bd3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to Voicebox will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed +- **Profile Name Validation** - Added proper validation to prevent duplicate profile names ([#134](https://github.com/jamiepine/voicebox/issues/134)) + - Users now receive clear error messages when attempting to create or update profiles with duplicate names + - Improved error handling in create and update profile API endpoints + - Added comprehensive test suite for duplicate name validation + ## [0.1.0] - 2026-01-25 ### Added @@ -55,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Audio export failing when Tauri save dialog returns object instead of string path +- OpenAPI client generator script now documents the local backend port and avoids an unused loop variable warning ### Added - **Makefile** - Comprehensive development workflow automation with commands for setup, development, building, testing, and code quality checks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 765da827..ee101d76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,26 @@ Thank you for your interest in contributing to Voicebox! This document provides ### Development Setup -**Using the Makefile (recommended for macOS/Linux):** Run `make setup` to install all dependencies, then `make dev` to start development servers. See `make help` for all available commands. +**Using `just` (recommended):** + +Install [just](https://github.com/casey/just) (`brew install just` or `cargo install just`), then: + +```bash +just setup # creates venv, installs Python + JS deps +just dev # starts backend + desktop app in one terminal +``` + +Other useful commands: + +```bash +just dev-web # backend + web app (no Tauri/Rust build) +just dev-backend # backend only +just kill # stop all dev processes +just clean-all # nuke everything and start fresh +just --list # see all available commands +``` + +**Using the Makefile:** Run `make setup` then `make dev`. See `make help` for all commands. **Manual setup (required for Windows):** @@ -407,7 +426,7 @@ See [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for common issues and sol - **Backend won't start:** Check Python version (3.11+), ensure venv is activated, install dependencies - **Tauri build fails:** Ensure Rust is installed, clean build with `cd tauri/src-tauri && cargo clean` -- **OpenAPI client generation fails:** Ensure backend is running, check `curl http://localhost:8000/openapi.json` +- **OpenAPI client generation fails:** Ensure backend is running, check `curl http://localhost:17493/openapi.json` ## Questions? diff --git a/Makefile b/Makefile index 620f6c8c..38918613 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ setup-python: $(VENV)/bin/activate ## Set up Python virtual environment and depe @echo -e "$(BLUE)Installing Python dependencies...$(NC)" $(PIP) install --upgrade pip $(PIP) install -r $(BACKEND_DIR)/requirements.txt + $(PIP) install --no-deps chatterbox-tts @if [ "$$(uname -m)" = "arm64" ] && [ "$$(uname)" = "Darwin" ]; then \ echo -e "$(BLUE)Detected Apple Silicon - installing MLX dependencies...$(NC)"; \ $(PIP) install -r $(BACKEND_DIR)/requirements-mlx.txt; \ @@ -79,7 +80,11 @@ dev: ## Start backend + desktop app (parallel) @echo -e "$(YELLOW)Note: If Tauri fails, run 'make build-server' first or use separate terminals$(NC)" @trap 'kill 0' EXIT; \ $(MAKE) dev-backend & \ - sleep 2 && $(MAKE) dev-frontend & \ + sleep 2 && if [ "$$(uname)" = "Linux" ] && lspci 2>/dev/null | grep -qi nvidia; then \ + WEBKIT_DISABLE_DMABUF_RENDERER=1 $(MAKE) dev-frontend; \ + else \ + $(MAKE) dev-frontend; \ + fi & \ wait dev-backend: ## Start FastAPI backend server diff --git a/README.md b/README.md index f0ea11f8..9abb9edf 100644 --- a/README.md +++ b/README.md @@ -147,17 +147,20 @@ Create multi-voice narratives, podcasts, and conversations with a timeline-based Voicebox exposes a full REST API, so you can integrate voice synthesis into your own apps. +For the current local app and development workflow, the backend is typically available at `http://localhost:17493`. +If you launch the backend manually with a different host or port, use that address instead. + ```bash # Generate speech -curl -X POST http://localhost:8000/generate \ +curl -X POST http://localhost:17493/generate \ -H "Content-Type: application/json" \ -d '{"text": "Hello world", "profile_id": "abc123", "language": "en"}' # List voice profiles -curl http://localhost:8000/profiles +curl http://localhost:17493/profiles # Create a profile -curl -X POST http://localhost:8000/profiles \ +curl -X POST http://localhost:17493/profiles \ -H "Content-Type: application/json" \ -d '{"name": "My Voice", "language": "en"}' ``` @@ -170,7 +173,7 @@ curl -X POST http://localhost:8000/profiles \ - Voice assistants - Content creation automation -Full API documentation available at `http://localhost:8000/docs` when running. +Full API documentation is available at `http://localhost:17493/docs` in the default local workflow, or at `/docs` on whatever server address you configured. --- @@ -225,42 +228,21 @@ Voicebox aims to be the **one-stop shop for everything voice** — cloning, synt See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed setup and contribution guidelines. -**Using the Makefile (recommended):** Run `make help` to see all available commands for setup, development, building, and testing. - ### Quick Start -**With Makefile (Unix/macOS/Linux):** - ```bash -# Clone the repo git clone https://github.com/jamiepine/voicebox.git cd voicebox -# Setup everything -make setup - -# Start development -make dev +just setup # creates Python venv, installs all deps +just dev # starts backend + desktop app ``` -**Manual setup (all platforms):** +Install [just](https://github.com/casey/just): `brew install just` or `cargo install just`. Run `just --list` to see all commands. -```bash -# Clone the repo -git clone https://github.com/jamiepine/voicebox.git -cd voicebox +Also available via Makefile: `make setup && make dev` (run `make help` for all commands). -# Install dependencies -bun install - -# Install Python dependencies -cd backend && pip install -r requirements.txt && cd .. - -# Start development -bun run dev -``` - -**Prerequisites:** [Bun](https://bun.sh), [Rust](https://rustup.rs), [Python 3.11+](https://python.org). [XCode on macOS](https://developer.apple.com/xcode/). +**Prerequisites:** [Bun](https://bun.sh), [Rust](https://rustup.rs), [Python 3.11+](https://python.org), [XCode on macOS](https://developer.apple.com/xcode/). **Performance:** - **Apple Silicon (M1/M2/M3)**: Uses MLX backend with native Metal acceleration for 4-5x faster inference diff --git a/app/src/components/Generation/FloatingGenerateBox.tsx b/app/src/components/Generation/FloatingGenerateBox.tsx index 0461e58b..f4e44aab 100644 --- a/app/src/components/Generation/FloatingGenerateBox.tsx +++ b/app/src/components/Generation/FloatingGenerateBox.tsx @@ -323,7 +323,7 @@ export function FloatingGenerateBox({ - {isExpanded && ( + {isExpanded && form.watch('engine') === 'qwen' && ( - ( - - - - - )} - /> + + + diff --git a/app/src/components/Generation/GenerationForm.tsx b/app/src/components/Generation/GenerationForm.tsx index 31b100f8..26fd13e3 100644 --- a/app/src/components/Generation/GenerationForm.tsx +++ b/app/src/components/Generation/GenerationForm.tsx @@ -76,29 +76,74 @@ export function GenerationForm() { )} /> - ( - - Delivery Instructions (optional) - -