Public
OpenRouter OpenMic joke battle.
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Last Model Standing — OpenRouter OpenMic

A comedy roast eval: 10 LLMs each tell one joke. You rate them 1–10. Highest score wins.

Models are called via OpenRouter; each gets a distinct ElevenLabs voice for delivery. Falls back to canned jokes and the browser's Web Speech API when keys aren't configured.

Architecture

Rendering mermaid diagram...

File layout

FilePurpose
main.tsxHono server, routes, OpenRouter + ElevenLabs proxies
shared/models.tsMODELS lineup, PROMPT, FAKE_JOKES, cleanJoke — shared between server and (via /api/lineup) client
frontend/index.htmlStage scaffold
frontend/script.tsClient logic — fetches lineup, prepares show, plays audio, scores
frontend/style.cssTheme

Env vars

VarEffect when missing
OPENROUTER_API_KEYFalls back to canned jokes from FAKE_JOKES
ELEVENLABS_API_KEY (or XI_API_KEY)Falls back to browser TTS via SpeechSynthesisUtterance

Modes

  • Test mode (default): canned jokes, no API calls to OpenRouter.
  • Live mode: toggle the "live jokes" checkbox in the UI, or append ?live=1. Hits OpenRouter for real model jokes.

Routes

MethodPathReturns
GET/The stage UI
GET/frontend/*Static assets (CSS, transpiled TS)
GET/sourceRedirect to this val's source on Val Town
GET/api/lineup{ prompt, models }
POST/api/joke{ joke, mode, model }
POST/api/audioaudio/mpeg stream (or JSON error with browserVoiceFallback)

Remix

Click "view source" in the bottom-right of the live page, or fork from Val Town directly.