Real-Time AI Avatar & Video Generation Platform
NEURA is a production-grade platform for creating AI-powered videos and real-time avatar presentations. It supports:
- Offline Video Generation: Create high-quality AI presenter videos
- Live Avatar Streaming: Real-time WebRTC streaming with < 500ms latency
- Custom TTS: Coqui XTTS v2 voice synthesis with word-level timing for lip sync
- Voice Profiles: Pre-configured voices (Alex, Sarah, James, Emma, David)
- LLM Integration: Local (LM Studio) and cloud (Gemini) support
Frontend (Next.js 14)
│
API Gateway (FastAPI)
│
AI Orchestrator
│
┌───────┼───────┬───────┬───────┬───────┐
│ LLM │ TTS │Avatar │Render │ Live │
└───────┴───────┴───────┴───────┴───────┘
│
GPU Workers (Celery)
│
PostgreSQL │ Redis │ MinIO
- Docker & Docker Compose
- Node.js 18+
- Python 3.11+
- LM Studio (optional, for local LLM)
- Deepgram API Key (optional, for live STT)
- Gemini API Key (optional, for cloud LLM)
- Clone and setup environment
cd Neura
cp .env.example .env.local- Configure API Keys (optional for live features)
# Edit .env.local and add:
DEEPGRAM_API_KEY=your-deepgram-key
GEMINI_API_KEY=your-gemini-key- Start all services
docker compose up -d- Seed default data (voices and avatars)
docker exec neura-backend python seed_defaults.py- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
| Service | Port | Description |
|---|---|---|
| Frontend | 3000 | Next.js dashboard |
| Backend | 8000 | FastAPI gateway |
| TTS | 8001 | Coqui XTTS synthesis |
| Live | 8003 | WebRTC streaming |
| PostgreSQL | 5432 | Database |
| Redis | 6379 | Cache & queues |
| MinIO | 9000 | Object storage |
Pre-configured voices for immediate use:
| Voice | Gender | Style | Best For |
|---|---|---|---|
| Alex | Male | Conversational | Business presentations |
| Sarah | Female | Friendly | Tutorials |
| James | Male | Authoritative | Documentaries |
| Emma | Female | Energetic | Marketing |
| David | Male | Calm | Wellness content |
Preview voices at /voices or via API:
GET /api/v1/tts/voices/{id}/previewReal-time AI conversation via WebRTC:
- Go to
/live - Select an avatar and voice
- Click "Go Live"
- Speak into microphone
- AI responds with synthesized voice
Pipeline: Audio → STT (Deepgram) → LLM (Gemini) → TTS → WebRTC Stream
Create pre-rendered AI presenter videos:
- Go to
/studio - Write or generate a script
- Select avatar and voice
- Configure settings
- Generate video
neura/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── routers/ # API routes
│ │ ├── models/ # SQLAlchemy models
│ │ └── workers/ # Celery tasks
│ └── seed_defaults.py # Default data seeder
│
├── frontend/ # Next.js frontend
│ └── src/
│ ├── app/(dashboard)/ # Protected pages
│ ├── hooks/useWebRTC.ts # WebRTC logic
│ └── lib/api.ts # API client
│
├── services/
│ ├── live/ # WebRTC live service
│ │ ├── main.py # WebRTC offer/answer
│ │ ├── pipeline.py # STT→LLM→TTS pipeline
│ │ └── stream_track.py # TTS audio streaming
│ ├── tts/ # Coqui XTTS synthesis
│ └── avatar/ # Wav2Lip rendering
│
└── docker-compose.yml
POST /api/v1/auth/register- RegisterPOST /api/v1/auth/login- LoginPOST /api/v1/auth/refresh- Refresh token
GET /api/v1/videos- List videosPOST /api/v1/videos- Create videoPOST /api/v1/videos/{id}/generate- Generate
GET /api/v1/avatars- List avatarsPOST /api/v1/avatars- Create avatar
GET /api/v1/tts/voices- List voicesGET /api/v1/tts/voices/{id}/preview- Preview voicePOST /api/v1/tts/generate- Generate TTS
POST /api/v1/live/start- Start sessionPOST /api/v1/live/{session_id}/stop- Stop sessionWS /api/v1/live/ws/{session_id}- WebSocket for signaling
# Database
DATABASE_URL=postgresql+asyncpg://neura:neura@postgres:5432/neura
# Redis
REDIS_URL=redis://redis:6379/0
# JWT
JWT_SECRET_KEY=your-secret-key
# LLM (choose one)
LLM_PROVIDER=gemini
GEMINI_API_KEY=your-gemini-key
# OR
LLM_PROVIDER=lmstudio
LMSTUDIO_BASE_URL=http://host.docker.internal:1234/v1
# Live AI Features
DEEPGRAM_API_KEY=your-deepgram-key
# S3 Storage
S3_ENDPOINT=http://minio:9000
S3_ACCESS_KEY=minio
S3_SECRET_KEY=minio123| Metric | Target |
|---|---|
| Live latency | < 500ms |
| Video render | < 3 min/min |
| API response | < 200ms |
| Uptime | 99.9% |
- Frontend: Next.js 14, React, TailwindCSS, Zustand
- Backend: FastAPI, SQLAlchemy, Celery
- Database: PostgreSQL, Redis
- AI/ML: Coqui XTTS v2, Deepgram STT, Gemini LLM
- Streaming: aiortc (WebRTC), MediaRecorder
- Infrastructure: Docker, MinIO
The XTTS model (1.87GB) may not have downloaded. Check:
docker logs neura-tts | grep -i "xtts\|error"The live-service uses host networking. Ensure port 8003 is free:
lsof -i :8003Clear browser localStorage and re-login:
localStorage.clear()Proprietary - All rights reserved
Built with ❤️ by the NEURA team