Project Info
๐ฏ
Inspiration
We wanted to create a streaming platform that combines the charm of Live2D anime characters with the power of AI, enabling streamers to host engaging, interactive content with virtual companions that respond to viewers in real-time. ๐
What it does
KawaAI is a live streaming platform featuring AI-powered Live2D characters that: Interactive Virtual Hosts: Live2D characters overlay on streams with smooth animations, breathing, eye blinking, and physics simulation AI-Powered Responses: Characters automatically detect questions in chat and respond contextually using AI, staying in character YouTube Integration: Stream YouTube videos alongside your Live2D character host Real-Time Chat: Built on LiveKit for low-latency, real-time communication Character Personalities: Choose from multiple unique characters, each with distinct personalities and expressions: Haru - Cheerful & Energetic Mao - Cool & Confident Hiyori - Sweet & Gentle Natori - Elegant & Sophisticated Mark - Laid-back Cool Guy Wanko - Playful & Fun Haru - Cheerful & Energetic Mao - Cool & Confident Hiyori - Sweet & Gentle Natori - Elegant & Sophisticated Mark - Laid-back Cool Guy Wanko - Playful & Fun Mouse Tracking: Characters' eyes and head follow your cursor for immersive interaction Expression System: Click on characters to trigger random facial expressions or emotions Stream Replays: Rewatch past streams with the original character and chat history ๐ ๏ธ
How we built it
Frontend (React + TypeScript) Live2D Cubism SDK for Web 5 - Rendering animated 2D characters React 19 with TypeScript for type-safe component architecture Vite for fast development and optimized builds Tailwind CSS 4 for modern, responsive UI design LiveKit Components React for real-time video and data channels Supabase for authentication and database React Router for multi-page navigation Backend (Python Flask) Flask with async support via Hypercorn LiveKit Python SDK for room management and token generation JanitorAI API for intelligent character responses (streaming SSE) Supabase Python Client for database operations CORS-enabled for cross-origin requests Architecture Highlights Custom WebGL renderer integration for Live2D models Singleton framework manager to prevent multiple initializations Character-specific positioning system for optimal framing Server-Sent Events (SSE) parsing for streaming AI responses Real-time message detection with pattern matching Automatic AI agent dispatch system ๐จ Key Technical Achievements Live2D Integration We successfully integrated the complex Live2D Cubism SDK into a React application, which required: Converting the SDK's vanilla TypeScript demo into React components Managing WebGL contexts across component lifecycles Implementing proper cleanup to prevent memory leaks Creating a singleton framework manager for multiple character instances Dynamic character positioning based on model dimensions AI Response System Detects questions in chat using pattern matching (?, what, how, why, etc.) Streams AI responses in real-time using SSE parsing Maintains character personality throughout conversations Prevents duplicate responses with message tracking Gracefully handles API errors and timeouts Character Personalization Each character has: Unique positioning adjustments (some models are taller/shorter) Individual animation sets and expressions Personality-driven AI responses Mouse-tracking for realistic eye movement Click interactions for expression changes ๐๏ธ
Challenges we ran into
Live2D SDK Complexity: The Cubism SDK wasn't designed for React, requiring extensive adaptation of the vanilla TypeScript implementation WebGL Context Management: Multiple character instances caused framework re-initialization errors - solved with a singleton pattern Streaming API Parsing: JanitorAI returns Server-Sent Events, not standard JSON - required custom SSE parser Character Positioning: Each model has different dimensions and anchor points - created dynamic positioning system TypeScript Configuration: The SDK required disabling strict module syntax to work with Vite Motion Playback: Had to properly initialize eye blink and lip sync parameter IDs for motions to work Multi-Component Rendering: Managing 7+ simultaneous Live2D previews without crashes ๐
Accomplishments we're proud of
โ Successfully integrated Live2D Cubism SDK into a modern React application โ Built a working AI chat system that responds contextually and in-character โ Created a smooth, Netflix-like streaming UI with real-time features โ Implemented 6 fully functional characters with unique personalities โ Achieved 60 FPS rendering with transparent backgrounds โ Built a robust character selection system with live previews โ Integrated YouTube playback seamlessly with overlay characters โ Implemented stream replay functionality with full chat history โ Created dynamic user labeling (You, User 1, User 2, etc.) ๐
What we learned
Deep understanding of WebGL rendering pipelines and context management Server-Sent Events (SSE) parsing for streaming AI responses Live2D Cubism SDK architecture and model structure React component lifecycle optimization for resource-intensive rendering Real-time communication patterns with LiveKit Character-based AI prompt engineering Handling multiple simultaneous WebGL instances Database schema design for flexible content storage ๐ฎ
What's next
for KawaAI Near-term Features Lip Sync: Sync character mouth movements with TTS audio output Voice Integration: Add text-to-speech for character voices Advanced Expressions: Trigger specific expressions based on chat sentiment Custom Characters: Allow users to upload their own Live2D models Animation Events: Trigger special animations based on chat interactions Mobile Support: Touch controls for character interaction Monetization: Tips, subscriptions, and virtual gifts for creators Long-term Vision Multi-character Streams: Support multiple characters interacting simultaneously Voice Chat Integration: Let characters respond with voice, not just text Custom Personality Training: Fine-tune AI responses per character Stream Analytics: View metrics, popular clips, and engagement stats Social Features: Follow favorite characters, create watch parties SDK for Creators: Easy integration for content creators to add their own Live2D models ๐จ Built With Frontend: React 19 TypeScript Vite Tailwind CSS 4 Live2D Cubism SDK for Web 5.r.4 LiveKit Components React Supabase JS Client React Router v7 Backend: Python 3.12 FastAPI with Hypercorn (async) LiveKit Python SDK JanitorAI API Fish Audio API Supabase Python Client HTTPX for async HTTP requests Infrastructure: Supabase (Auth, Database, Real-time) LiveKit (WebRTC, Real-time Communication) JanitorAI (LLM API)
This repository has no readme, or GitHub could not be reached.
Analysis
View
Metric
- 16
- 5
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CIn code
- C++In code
- CSSIn code
- ExpressIn code
- FlaskIn code
- HTMLIn code
- JavaScriptIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
14 of 14 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
69 MB
Source files
5,866
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
c25kenneth/kawa-ai
4,000 files ยท 235.7 MB ยท @ 55e4597
Structure
API & routing
126 files ยท 3%Request entry points: routes, handlers and controllers.
Application logic
3,013 files ยท 75%Domain rules, services and shared utilities.
Background jobs
6 files ยท 0%Work run outside a request: tasks, workers and schedules.
Data & schema
74 files ยท 2%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- Python95%
- HTML2%
- C2%
- Markdown1%
- C++0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
kawaai-backend/requirements.txt
pypi ยท 84- aiofiles
- aiohappyeyeballs
- aiohttp
- aiosignal
- annotated-types
- anyio
- attrs
- av
- blinker
- certifi
- cffi
- charset-normalizer
- click
- colorama
- coloredlogs
- distro
- docstring_parser
- eval_type_backport
- +66 more
kawaai-frontend/package.json
npm ยท 24- @livekit/agents
- @livekit/components-react
- @livekit/components-styles
- @supabase/supabase-js
- @tailwindcss/vite
- livekit-client
- livekit-server-sdk
- lucide-react
- react
- react-dom
- react-router-dom
- tailwindcss
- +12 more
kawaai-frontend/CubismSdkForWeb-5-r.4/Samples/TypeScript/Demo/package.json
npm ยท 1010 development-only dependencies.
kawaai-frontend/CubismSdkForWeb-5-r.4/Framework/package.json
npm ยท 88 development-only dependencies.
kawaai-backend/payment/package.json
npm ยท 6- @supabase/supabase-js
- cors
- dotenv
- express
- stripe
- +1 more
kawaai-payment-site/package.json
npm ยท 3- next
- react
- react-dom
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This repository has more files than are indexed here, so the diagram and browser show a partial tree. Open it on GitHub for the complete structure.
This projectโs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.