Where AI models forge arguments and battle for intellectual supremacy.
Rebatr is a sophisticated web application that orchestrates live debates between different AI models. Watch as GPT-4, Claude, Llama, and other leading AI models engage in structured arguments on any topic you choose.
rebatr-shorten.mp4
- Live AI Debates: Real-time arguments between different AI models
- Dynamic Model Selection: Choose from 100+ AI models via OpenRouter API
- Intelligent Scoring: Advanced algorithm analyzes logic, evidence, and persuasiveness
- Auto Mode: Hands-off debates that run automatically
- Export Results: Save debate transcripts as PDF or text files
- Smart Routing: Automatic debate flow management with strategic prompting
- Real-time Analytics: Live scoring and performance metrics
- Responsive Design: Optimized for desktop, tablet, and mobile
- Keyboard Shortcuts: Power user controls for efficient navigation
- Error Recovery: Robust retry logic and graceful failure handling
- Modern UI: Clean, accessible interface built with Radix UI components
- Dark/Light Themes: Automatic theme switching based on system preferences
- Animations: Smooth transitions and victory celebrations with confetti
- Loading States: Comprehensive feedback during AI generation
- Mobile-First: Fully responsive design that works everywhere
- Next.js 15 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Radix UI - Accessible component primitives
- Next.js API Routes - Serverless API endpoints
- OpenRouter API - Access to 100+ AI models
- Edge Runtime - Fast, global API responses
- Component-Driven - Modular, reusable UI components
- Custom Hooks - Shared state management logic
- Type Safety - Full TypeScript coverage
- Error Boundaries - Graceful error handling
- Node.js 18+
- pnpm (recommended) or npm
- OpenRouter API key (Get one here)
-
Clone the repository
git clone https://github.com/yourusername/rebatr.git cd rebatr -
Install dependencies
pnpm install
-
Start the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
- Enter your OpenRouter API key - Required for accessing AI models
- Choose a debate topic - Select from suggestions or enter your own
- Select AI models - Pick two models to debate (Pro vs Con positions)
- Watch the debate unfold - Enable auto mode or control manually
- Analyze results - View scores, export transcripts, and celebrate winners
rebatr/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── debate/ # Debate generation endpoint
│ │ ├── models/ # Dynamic model fetching
│ │ └── validate-key/ # API key validation
│ ├── debate/ # Debate page
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── ui/ # Base UI components (Radix)
│ ├── debate-arena.tsx # Main orchestrator
│ ├── debate-setup.tsx # Model selection
│ └── debate-display.tsx # Live debate interface
├── hooks/ # Custom React hooks
│ ├── use-api-key.ts # API key management
│ └── use-models.ts # Dynamic model loading
├── lib/ # Core business logic
│ ├── debate-engine.ts # Debate orchestration
│ ├── openrouter.ts # API client
│ └── scoring-engine.ts # Intelligent scoring
└── types/ # TypeScript definitions
└── debate.ts # Core types
- Orchestrates the entire debate flow
- Generates context-aware prompts for each round
- Manages debate phases (opening, development, rebuttal, closing)
- Analyzes arguments across multiple criteria
- Calculates real-time scores and determines winners
- Provides detailed feedback on argument quality
- Fetches latest models from OpenRouter API
- Categorizes models by pricing tier
- Provides fallback models if API fails
Models are dynamically loaded from OpenRouter API and automatically categorized:
- Free Tier: No cost or very low cost models
- Standard Tier: Mid-range pricing models
- Premium Tier: High-performance, higher-cost models
- Classroom debates on historical topics
- Philosophy and ethics discussions
- Literature analysis and interpretation
- Product decision making
- Strategy discussions
- Market analysis debates
- AI model comparison and evaluation
- Argument quality assessment
- Debate methodology research
- Fun debates on pop culture topics
- Creative writing prompts
- AI personality exploration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript for all new code
- ESLint + Prettier for formatting
- Component-driven architecture
- Comprehensive error handling
- First Load: < 2s on 3G networks
- Debate Generation: 2-5s per argument
- Real-time Scoring: < 100ms analysis
- API Keys: Stored locally in browser, never sent to our servers
- Data Privacy: No debate data is stored permanently
- Rate Limiting: Built-in protection against API abuse
- Error Handling: Secure error messages without sensitive data exposure
pnpm build
pnpm startThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built with ❤️ by developers who believe in the power of AI discourse
⭐ Star this repo if you found it useful!