PromptCompare

A Val Town app for comparing LLM model outputs side-by-side.

Key References

  • docs/vt.md — Val Town platform docs: hosting, runtime, triggers, standard libraries, project structure
  • docs/vt-sqlite.md — Val Town SQLite usage (more up-to-date than vt.md for SQLite)
  • docs/zen.md — OpenCode Zen API gateway docs: endpoints, pricing, model access
  • docs/models.json — Model metadata: IDs, capabilities, costs, context limits, provider SDKs
  • .claude/skills/ai-elements/ — AI Elements component patterns (used as design inspiration, not directly — requires Next.js)

Tech Stack

  • Runtime: Deno (Val Town serverless)
  • Backend: Hono framework
  • Frontend: React 18.2.0 via esm.sh + Tailwind via CDN
  • Database: Val Town SQLite
  • AI Gateway: OpenCode Zen (https://opencode.ai/zen/v1/)
  • Auth: Env var password (PROMPTCOMPARE_PASSWORD) with session cookie

Conventions

  • All React files need /** @jsxImportSource https://esm.sh/react@18.2.0 */
  • Pin all React deps to 18.2.0 with ?deps=react@18.2.0,react-dom@18.2.0
  • Use https://esm.sh for all npm imports
  • SQLite: import from https://esm.town/v/std/sqlite/main.ts (val-scoped DB)
  • Never use Deno in shared/ code
  • Redirects: use new Response(null, { status: 302, headers: { Location: "..." } }) not Response.redirect
  • Entry point: export default app.fetch in backend/index.http.ts