A production-ready platform for interacting with and comparing leading LLMs from India. Built with Django REST Framework and React.
- π€ Multi-Model Chat - Interact with various AI models from leading providers
- π Comparison Mode - Compare responses from two models side-by-side
- π² Random Mode - Blind test models without knowing which is which
- π Real-time Streaming - Stream AI responses as they're generated
- π³ Message Branching - Create conversation branches and explore different paths
- π€ Share & Export - Share conversations via links or export as JSON/Markdown/TXT
- β Comprehensive Feedback - Rate responses and provide detailed feedback
- π ELO Leaderboard - Track model performance with ELO ratings
- π Dual Authentication - Google OAuth & Anonymous sessions
- πΎ Session Persistence - Continue conversations across sessions
- π± Responsive Design - Works seamlessly on desktop and mobile
backend/
βββ apps/
β βββ user/ # User authentication and profiles
β βββ ai_model/ # AI model registry and integration
β βββ chat_session/ # Session management
β βββ message/ # Message handling and streaming
β βββ feedback/ # User feedback system
β βββ model_metrics/ # Performance tracking and leaderboards
βββ core/ # Core settings and configurations
βββ requirements.txt # Python dependencies
frontend/
βββ src/
β βββ app/ # App configuration and routing
β βββ features/ # Feature-based modules
β β βββ auth/ # Authentication components
β β βββ chat/ # Chat interface and logic
β β βββ models/ # Model selection and testing
β β βββ feedback/ # Feedback components
β β βββ leaderboard/ # Leaderboard views
β βββ shared/ # Shared utilities and components
β βββ styles/ # Global styles
βββ package.json # Node dependencies
- Python 3.11+
- Node.js 18+
- PostgreSQL 14+
- Redis 6+
- Google Cloud account (for OAuth)
- Clone the repository
git clone https://github.com/AI4Bharat/Chat-Arena.git
cd Chat-Arena/backend- Create 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
cp .env.example .envEdit .env with your credentials:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/ai_playground
# Redis
REDIS_URL=redis://localhost:6379
# AI Model API Keys
OPENAI_API_KEY=your-openai-key
GOOGLE_API_KEY=your-google-key
ANTHROPIC_API_KEY=your-anthropic-key
META_API_KEY=your-meta-key
MISTRAL_API_KEY=your-mistral-key
# Firebase/Auth
FIREBASE_CONFIG={"apiKey":"...","authDomain":"..."}
# Security
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=localhost,127.0.0.1- Run migrations
python manage.py migrate
python manage.py createsuperuser- Start backend services
# Terminal 1: Django server
python manage.py runserver
# Terminal 2: Celery worker
celery -A core worker -l info
# Terminal 3: Celery beat (for scheduled tasks)
celery -A core beat -l info- Navigate to frontend directory
cd ../frontend- Install dependencies
npm install- Set up environment variables
cp .env.example .envEdit .env:
REACT_APP_API_URL=http://localhost:8000/api
REACT_APP_WS_URL=ws://localhost:8000/ws
REACT_APP_GOOGLE_CLIENT_ID=your-google-client-id- Start development server
npm run devThe application will be available at http://localhost:5173
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google Identity Toolkit API
- Create OAuth 2.0 credentials
- Add authorized origins:
http://localhost:5173(development)https://your-domain.com(production)
- Direct Mode - Chat with a single AI model
- Compare Mode - Get responses from two models simultaneously
- Random Mode - Blind test with randomly selected models
- Star Ratings - Rate individual responses (1-5 stars)
- Preferences - Choose which model gave a better response
- Categories - Tag feedback with categories (accuracy, creativity, etc.)
- Filter by category (Overall, Creative Writing, Coding, Reasoning)
- View different time periods (Daily, Weekly, All-time)
- See detailed model performance metrics
- Create a model adapter in
backend/apps/ai_model/adapters/ - Register the model in Django admin
- Add API credentials to environment variables
Edit backend/apps/feedback/constants.py to add/modify feedback categories.
- Set up PostgreSQL and Redis instances
- Configure environment variables
- Deploy using provided
Dockerfileorrailway.toml
npm run build
vercel --prodThe API documentation is available at:
- Swagger UI:
http://localhost:8000/api/docs/ - ReDoc:
http://localhost:8000/api/redoc/
python manage.py testnpm run test- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with assistance from Claude (Anthropic) - AI pair programming and architecture design
- Thanks to all the AI model providers for their APIs
- The open-source community for the amazing tools and libraries
This project was developed with significant assistance from Claude 3 Opus, an AI assistant by Anthropic. Claude helped with:
- System architecture design
- Code implementation
- Best practices and patterns
- Documentation
- Problem-solving and debugging
Special thanks to the Anthropic team for creating such a capable AI assistant that made building this complex project possible!
For support, please open an issue in the GitHub repository or contact the maintainers.
Built with β€οΈ and AI assistance