Files
hanzo.ai/lib/models/links.ts
zeekay 8bf2e0cfab The model card is a card: the family hero, a links row, facts in a grid, the call in four tabs, the price in a line
Every model page opens in the family pages' frame (the name, one line, two
actions) over a links row: the model's GitHub and Hugging Face, from its
catalogue record and kept only when the build reads a 200, and this site's
leaderboard and benchmarks for its family. Facts are a grid of labelled cells;
a Kai page sets what ships today beside the Kai-1.7 target, each its own
column. The quick start is a segmented control over TypeScript, Python, cURL
and Go, in the shape the model's endpoint takes: a decision model's are the
/v1/decisions severity call, each run against production and answered (the
list-shaped body the card printed was refused 422). The guest key, which
api.hanzo.ai no longer accepts, gives way to Get an API key. /kai's first action reads Get decisions, as the card's does.
2026-10-17 03:57:20 -07:00

38 lines
1.7 KiB
TypeScript

/**
* A model page's links row: the model's public repositories and the boards on
* this site that hold its results.
*
* The repositories come from the model's catalogue record (the price list's
* `links`, the Zen catalogue's `github` and `huggingface`) and reach a page
* only if they answered 200 when the build asked (lib/models/served). The
* boards are this site's own: /benchmarks has a chapter per family, and the
* families with a ranked board name it as the leaderboard. A link a model has
* none of is not drawn.
*/
export type Kind = 'github' | 'huggingface' | 'leaderboard' | 'benchmarks'
export interface Link {
kind: Kind
label: string
href: string
}
/** Where each family's results are on /benchmarks (components/benchmarks/Showcase). */
export const BOARDS: Readonly<Record<string, { leaderboard?: string; benchmarks: string }>> = {
kai: { leaderboard: '/benchmarks#leaderboard', benchmarks: '/benchmarks#kai' },
enso: { leaderboard: '/benchmarks#frontier', benchmarks: '/benchmarks#enso' },
zen: { benchmarks: '/benchmarks#zen' },
}
/** The links a model page draws, in the row's order. */
export function links(m: { github?: string; huggingface?: string; family?: string }): Link[] {
const board = m.family ? BOARDS[m.family] : undefined
const out: Link[] = []
if (m.github) out.push({ kind: 'github', label: 'GitHub', href: m.github })
if (m.huggingface) out.push({ kind: 'huggingface', label: 'Hugging Face', href: m.huggingface })
if (board?.leaderboard) out.push({ kind: 'leaderboard', label: 'Leaderboard', href: board.leaderboard })
if (board) out.push({ kind: 'benchmarks', label: 'Benchmarks', href: board.benchmarks })
return out
}