import getDB from "@/utils/getDB" import Head from "next/head" import Link from "next/link" export const getStaticPaths = async () => { const db = await getDB() const prompts = await db.all(`SELECT * FROM prompts`) return { paths: prompts.map((prompt) => ({ params: { slug: prompt.slug }, })), fallback: false, } } export const getStaticProps = async (props) => { const db = await getDB() const slug = props.params.slug const prompt = await db.get(`SELECT * FROM prompts WHERE slug = ?`, [slug]) // get results with their model (join) const results = await db.all( `SELECT * FROM results INNER JOIN models ON results.model = models.id WHERE prompt = ? ORDER BY models.name ASC`, [prompt.id] ) return { props: { prompt, results } } } export default function Prompt({ prompt, results }) { return ( <>
{prompt.text}
Note: {prompt.note}
}Model | Answer | Latency | Chars / s |
---|---|---|---|
{result.name} |
{result.result.trim()} |
{result.duration}ms | {result.rate} |
Edit: as this got popular, I added an email form to receive notifications for future benchmark results: (no spam, max 1 email per month) |
---|