Never stream alone, never miss a chat - Your AI co-host for Live streaming
StreamBuddy is a real-time AI companion for live streamers that provides natural, voice-based interaction during YouTube Live broadcasts. Built with Google's Gemini Live API and GenAI SDK, StreamBuddy processes multimodal inputs (video(future), audio, and chat) to deliver contextually relevant voice responses that enhance stream entertainment and viewer engagement.
View the complete system architecture diagram: StreamBuddy Architecture
- Real-time Multimodal Processing: Analyzes audio streams and live chat simultaneously
- Natural Voice Responses: Generates voice responses with sub-2-second latency using Gemini Live API
- Contextual Commentary: Provides intelligent commentary
- Interactive Chat Processing: Responds to viewer messages with personality and context awareness
- Graceful Interruption Handling: Allows natural conversation flow with interruption support
- Customizable Personality: Configure humor level, supportiveness, playfulness, and response style
- Cloud-Native Deployment: Runs on Google Cloud Platform with automatic scaling
- AI Processing: Google Gemini Live API (multimodal understanding and voice generation)
- Cloud Infrastructure: Google Cloud Platform (Cloud Run, Cloud Logging, Cloud Monitoring, Secret Manager)
- Stream Integration: YouTube Live API
- Programming Language: Python 3.11+
- Python 3.11 or higher
- Google Cloud Platform account with billing enabled
- YouTube Live API OAuth credentials
- Gemini API key from Google AI Studio
- Docker (for containerized deployment)
-
Clone the repository
git clone https://github.com/yaseen2402/StreamBuddy cd StreamBuddy -
Create and activate virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create
.envfile in the root directory:cp .env.example .env
Edit
.envand add your credentials:GOOGLE_API_KEY=your_gemini_api_key_here REMOTE_AUDIO_MODE=true PROACTIVE_AUDIO_MODE=false
Create
env.yamlfor Cloud Run deployment:cp env.yaml.example env.yaml
Edit
env.yaml:GOOGLE_API_KEY: your_gemini_api_key_here REMOTE_AUDIO_MODE: "true" PROACTIVE_AUDIO_MODE: "false" FRONTEND_URL: "http://localhost:3000"
-
Set up YouTube OAuth credentials
a. Go to Google Cloud Console
b. Create a new project or select existing one
c. Enable YouTube Data API v3:
- Navigate to "APIs & Services" → "Library"
- Search for "YouTube Data API v3"
- Click "Enable"
d. Create OAuth 2.0 credentials:
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "OAuth client ID"
- Application type: "Web application"
- Click "Create"
copy the example and fill in your credentials:
cp client_secret_example.json client_secret.json
Edit
client_secret.jsonwith your OAuth client ID and secret from Google Console. -
Start the backend server
python server.py
-
Start the frontend (in a new terminal)
cd frontend npm install # First time only npm run dev
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000