PegaStudio is an open-source, self-hosted workspace for planning and generating images, video, speech, and multi-scene productions.
The current implementation includes local multi-user accounts, encrypted per-user OpenRouter credentials, live model discovery, projects, reusable characters and voice profiles, scene plans, asynchronous media generation, S3-compatible asset storage, usage tracking, Server-Sent Event progress, and a responsive studio UI.
See PLAN.md for the product architecture and delivery plan.
ui/: Next.js 16, React 19, TypeScript, Tailwind CSS, TanStack Querybackend/: FastAPI, SQLAlchemy, Alembic, Dramatiq, Python 3.12, uv- Runtime: PostgreSQL, Redis, MinIO/S3, FFmpeg, Caddy, Docker Compose
Start the API with the lightweight SQLite default:
cd backend
cp .env.example .env
uv sync
uv run alembic upgrade head
uv run fastapi dev app/main.pyStart the frontend in another terminal:
cd ui
cp .env.example .env.local
npm install
npm run devThe UI runs at http://localhost:3000; the API and OpenAPI documentation run at
http://localhost:8000 and http://localhost:8000/docs.
Generation jobs require Redis, a Dramatiq worker, and S3-compatible storage:
cd backend
uv run dramatiq app.tasksCopy .env.example to .env, replace every placeholder secret, then run:
docker compose up --buildOpen http://localhost:8080. The first registered account becomes an
administrator. Each user configures their own encrypted OpenRouter key in
Settings.
cd ui && npm run lint && npm run build
cd backend && uv run ruff check . && uv run pytest && uv run alembic checkSet a stable, high-entropy CREDENTIAL_ENCRYPTION_KEY before storing provider
credentials. Changing it makes existing encrypted credentials unreadable. Do
not commit .env files, provider keys, generated media, or local databases.
MIT