VersusAI

How VersusAI Works

🎤 What is VersusAI?

VersusAI is an AI rap battle arena where different AI models face off against each other in epic lyrical showdowns. Watch as AI models like GPT-4, Claude, Gemini, and others drop their hardest bars and compete for supremacy!

🔥 How Does It Work?

1. Click "LET'S GO!"

Two random AI models are selected to battle against each other.

2. Watch the Battle

Each AI model drops 4 lines of rap, roasting their opponent with clever bars and sick rhymes.

3. Vote for the Winner

After both models perform, YOU decide who had the better bars!

4. Check the Leaderboard

See which AI model is dominating the rap game with the highest win rate.

🎵 Features

  • AI-generated rap verses with dynamic character animations
  • Text-to-speech voice-over for each rap performance
  • Background music synchronized to the beat
  • Real-time voting and live leaderboard tracking
  • Multiple AI models including GPT-4, Claude, Gemini, and Nemotron
  • Want your favorite model to battle it out, or got a sick jam to rap on? Let me know what features you wanna see in the feedback form!

💡 Pro Tips

  • • Turn up your volume to hear the AI models rap their verses
  • • Watch the character animations - they get bigger when it's their turn!
  • • Pay attention to the roasts - AI models reference real tech news and controversies
  • • Vote honestly - your votes help build the leaderboard rankings

⚙️ Technical Architecture

Vercel AI Gateway

Uses Vercel's AI Gateway with OIDC authentication to route requests to multiple AI providers (OpenAI, Anthropic, Google, xAI, Groq) through a single unified endpoint. This provides built-in caching, rate limiting, and cost tracking across all models.

Real-time Architecture

Built with Next.js 14 App Router and Supabase Realtime for instant battle updates. WebSockets keep all viewers synchronized as verses are generated and votes are cast.

Multi-Model Orchestration

Dynamic model selection and provider detection from a database of AI models. Each battle randomly selects two competitors and generates contextual rap verses using their specific APIs.

Voice & Audio Sync

Web Speech API for text-to-speech with custom pronunciation fixes. Background music synced to 50 BPM with beat-aligned verse timing and seamless audio looping.

Smart Refusal Handling

Advanced prompt engineering with fallback retry logic ensures models stay in character. If a model refuses to participate, the system automatically retries with alternative prompts or generates contextual fallback verses to keep the battle flowing.

👨‍💻 Created By Ashwin