⚔️ Compare AI models side by side — same prompt, streamed answers, live code previews, speed, tokens and cost. Keys never leave your browser.
Compare AI models. Side by side.
Give every model the same prompt and compare the answer, the generated code, a live preview, speed, tokens and cost — all streaming in real time, right in your browser.
Live at isbetter.ai
localStorage and sent only to their provider. They never touch our servers.| Provider | Notes |
|---|---|
| OpenRouter | Hundreds of models from every major lab through one key |
| OpenAI | GPT models |
| Anthropic | Claude models |
| Google Gemini | Gemini models |
| xAI | Grok models |
| DeepSeek | DeepSeek chat and reasoner models |
| Mistral AI | Mistral models |
| Groq | Ultra-fast open-model inference |
| Cerebras | Ultra-fast open-model inference |
| Local | Any OpenAI-compatible server (Ollama, LM Studio, llama.cpp, …) |
Models served through an inference provider (OpenRouter, Groq, Cerebras, local) also show the badge of the lab that created the model.
src/scripts/providers/)Requirements: Node.js ≥ 22.12 and pnpm.
git clone https://github.com/midudev/ai-battle.git
cd ai-battle
pnpm install
pnpm dev
Open http://localhost:4321, press K to add at least one provider API key, pick your contenders and run a battle.
| Command | Action |
|---|---|
pnpm dev |
Start the local dev server at localhost:4321 |
pnpm build |
Build the production site to ./dist/ |
pnpm preview |
Preview the production build locally |
pnpm test |
Run the unit test suite (Vitest) |
pnpm check |
Type-check the project (astro check) |
Shared battle links are stored in a D1 database bound as BATTLES_DB (see wrangler.jsonc). To set up your own:
npx wrangler d1 create ai-battle-results
npx wrangler d1 migrations apply ai-battle-results
The API surface is small: POST /api/battles stores a battle and returns its id, GET /api/battles/:id fetches it for the /battle review page.
/
├── migrations/ # D1 schema migrations
├── public/ # Static assets (favicon, fonts)
├── src/
│ ├── components/ # Astro components (header, footer, toolbar, icons)
│ ├── layouts/ # Base HTML layout and meta tags
│ ├── pages/
│ │ ├── index.astro # The arena
│ │ ├── battle/ # Shared battle review page
│ │ └── api/battles/ # Shared battles API (Cloudflare D1)
│ ├── scripts/
│ │ ├── app.ts # Arena logic
│ │ ├── battle.ts # Battle review logic
│ │ ├── lib.ts # Shared rendering and metric helpers
│ │ ├── model-icons.ts # Model brand icon registry
│ │ └── providers/ # Provider registry + SSE streaming
│ └── styles/ # Global styles (Tailwind 4)
└── wrangler.jsonc # Cloudflare Workers + D1 config
Everything sensitive stays client-side: API keys, prompts and battle history live in your browser’s localStorage. The only data that ever reaches the server is a battle you explicitly choose to share.
Issues and pull requests are welcome! Please use the issue templates to report bugs or request features, and keep commits following the Conventional Commits style.
FSL-1.1-MIT (Functional Source License). You can use, copy, modify and redistribute the code for any purpose except building a competing product. Each release automatically becomes MIT two years after publication.
Built with 💚 by midudev · Keep isbetter.ai free — sponsor the project