About this project
ModelBench — answering “Which model should we use, and what will it cost?”
The problem
Every team adopting LLMs asks the same question. Picking by reputation usually means paying for a frontier model on a task a small model handles fine — often a 10–30× cost difference at production volume — or shipping a cheap model that quietly fails on edge cases.
The approach
Define the business task once: a versioned prompt, 5–20 realistic test inputs with reference answers, and a rubric. ModelBench runs every input on every chosen model, records latency, tokens and cost, then uses an LLM-as-judge grader (a fixed model) to score each output 1–5 with a one-line reason.
The recommendation is deliberately boring: the cheapest model whose pass rate clears the target — with the highest-quality and fastest models shown alongside, and every output inspectable side by side.
Architecture
Browser (React, TanStack Start) │ every read, write and AI call via server functions ▼ Server functions ──► Lovable AI Gateway (models under test + grader) │ ▼ Lovable Cloud database
Tables: tasks, prompt_versions, test_inputs, runs, run_calls, prices, settings — Row Level Security on, no direct browser access.
Server functions: read functions (getTasks, getTask, getRun, getPrices, getSettings), createTask, savePromptVersion, saveTestInputs, saveRubric, createRun, executeCall (one model call), gradeCall (one grade), setRunStatus, updatePrice, updateSettings, resetDemo. The browser orchestrates a run with a concurrency limit of 4, so each request stays short and a reload resumes where it left off. Costs are never stored — they are derived from token counts × the current price table.
What I'd do next
- Move orchestration to a durable server-side queue with retries and per-provider rate limits.
- Calibrate the grader against human labels and report grader agreement; add exact-match checks for JSON tasks.
- Repeat runs to report variance and confidence intervals, not single-sample scores.
- Pull live provider prices, add auth and per-client workspaces, and export a shareable recommendation report.