Inspiration

We wanted to bring the magic of Epic Rap Battles of History to AI — what if anyone could pit any two historical figures against each other in a rap battle and hear the result as an actual song? The idea of Napoleon roasting Genghis Khan or Cleopatra dissing Queen Elizabeth was too fun not to build.

What it does

Eleven-Mile lets users pick any two historical figures and generates a full rap battle song between them. Claude AI writes the lyrics — complete with historically accurate burns, clever wordplay, and laugh-out-loud punchlines. ElevenLabs' Music API then produces each section as a unique vocal track with voices matched to each figure's gender, ethnicity, and personality. The app splices everything together into a seamless song and plays it back in a fullscreen performance mode with Wikipedia portraits, live lyrics tracking, an audio visualizer, and a winner vote at the end. Battles are saved and shareable via URL.

How we built it

CLAUDE CODE! Which:

  • Frontend: React + Vite with Web Audio API for audio visualization, silence trimming, and crossfade splicing
    • Backend: Express 5 serving both the API and built frontend
    • Lyrics Generation: Claude API (claude-sonnet-4-20250514) generates 5 lyric variants in parallel, each focusing on a different quality (humor, burns, wordplay, energy, storytelling). A separate Claude reviewer grades all 5 and picks the best, with humor weighted 3x
    • Music Generation: ElevenLabs Music Compose API with deterministic seeds per rapper for voice consistency across verses
    • Database: Supabase (Postgres + Storage) for persisting battles and audio files
    • Hosting: JadeHosting for the Node.js container ## Challenges we ran into
    • Voice consistency: Each API call to ElevenLabs could produce a completely different voice for the same character. We solved this with deterministic seeds derived from the rapper's name.
    • Gender accuracy: The AI kept giving female historical figures male rapper voices. We had to engineer the prompt to force "male" or "female" as the first word of every vocal description with explicit examples.
    • Silence between sections: Splicing independent audio tracks left awkward dead air. We built a custom silence trimmer using relative energy thresholds (2% of peak) and 400ms crossfades to make transitions seamless.
    • Deployment: Our original SQLite database produced binary incompatibility errors (ARM Mac vs Linux container). We pivoted the entire backend to Supabase mid-project.

Accomplishments that we're proud of

I'm 13 years old and here with my Dad.

What we learned

  • The Jade guys are awesome. So cool to watch them live debug an issue we were having

  • Prompt engineering matters enormously for creative output — the difference between one generic prompt and a focused multi-variant pipeline with review is night and day

    • Web Audio API is incredibly powerful for in-browser audio processing — we're doing real-time visualization, silence detection, and crossfade mixing all client-side
    • AI music generation APIs have strict concurrency limits that require careful batching
    • Sometimes the best solution to a deployment problem is to rethink your architecture entirely (SQLite → Supabase)

What's next for Eleven-Mile

TO THE MOON

Built With

  • claude
  • elevenlabs
  • jade
  • supabase
Share this project:

Updates