Sandbox for speech experiments with a FastAPI backend and a Svelte frontend.
Recommended prerequisites:
cd backend
cp .env.example .env
uv run --all-extras fastapi dev main.py
# optional: skip --all-extras to use only some functionality- API: http://localhost:8000
- Docs: http://localhost:8000/docs
The forced alignment tool requires a separate service. If you want it, run this in a separate process:
- Repo: https://github.com/stephenmac7/mfa-service
- Expected endpoint: http://localhost:8001
cd frontend
cp .env.example .env
pnpm install
pnpm run devThis will start the app on http://localhost:5173.
This project uses lazy loading for various speech processing models and encoders. Dependencies are loaded on-demand when specific endpoints are first accessed, rather than at application startup. This improves startup time but means:
- First requests to each endpoint may be slower as models are loaded into memory
- Additional dependencies may be required depending on which features you use
- Some imports will fail until you install the necessary optional dependencies for the encoder/tokenizer you want to use
Note on Kanade: the kanade extra should be enough here. We rely on PyTorch's SDPA path in the pinned torch line for the attention optimizations we want.
(Instructions from Svelte -- have not tried this yet)
To create a production version of your app:
npm run buildYou can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.