HTML 77.2%
TypeScript 10.5%
Python 9.6%
JavaScript 2.5%
1import type { Metadata } from 'next';2import Link from 'next/link';3import { CompareTrayBar } from '@/components/compare/compare-tray-bar';4import { type Current, MODEL_PARAM_KEYS, MODEL_SORTS, ModelsFilterRail, modelsHref, UnderstoodChips } from '@/components/models/models-filters';5import { ModelsTable, ModelsTerminal } from '@/components/models/models-terminal';6import { parseScale } from '@/components/models/shared';7import { Hint } from '@/components/ui/hint';8import { Pagination } from '@/components/ui/pagination';9import { Container, Note } from '@/components/ui/section';10import { Unavailable } from '@/components/ui/unavailable';11import { api, apiD1, safe } from '@/lib/api';12import { fmtInt } from '@/lib/format';13import { routes, SITE_NAME, SITE_URL } from '@/lib/site';1415export const metadata: Metadata = {16 title: 'AI models — parameters, context, openness, licences & pricing',17 description: 'Every canonical AI model release in the atlas: parameters, context window, openness, canonical licence, release date and data quality — filterable, sortable and shareable, with provenance on every value.',18 alternates: { canonical: '/models' },19 openGraph: { title: `AI models — parameters, context, openness, licences & pricing | ${SITE_NAME}`, url: `${SITE_URL}/models`, type: 'website' },20};21export const revalidate = 120;2223type SP = Record<string, string | undefined>;24const LIMIT = 50;2526export default async function ModelsPage({ searchParams }: { searchParams: Promise<SP> }) {27 const sp = await searchParams;28 const current: Current = {};29 for (const k of MODEL_PARAM_KEYS) if (sp[k]) current[k] = sp[k];30 const offset = Math.max(0, Number(current.offset) || 0);31 const sort = current.sort ?? 'updated';32 const order = current.order;33 const [page, stats] = await Promise.all([34 safe(35 apiD1.models({36 q: current.q,37 org: current.org,38 family: current.family,39 openness: current.openness,40 modality: current.modality,41 status: current.status,42 license: current.license,43 trust: current.trust,44 reasoning: current.reasoning,45 include: current.include,46 min_params: parseScale(current.min_params),47 max_params: parseScale(current.max_params),48 min_context: parseScale(current.min_context),49 year_from: current.year_from,50 year_to: current.year_to,51 sort,52 order,53 limit: LIMIT,54 offset,55 facets: 1,56 }),57 ),58 safe(api.stats()),59 ]);60 const href = (patch: Record<string, string | number | undefined | null>) => modelsHref(current, patch);61 const sortHref: Record<string, string> = {};62 for (const s of [...MODEL_SORTS.map((x) => x.value)]) sortHref[s] = href({ sort: s, order: sort === s && order !== 'asc' ? 'asc' : undefined, offset: undefined });63 const filterCount = Object.keys(current).filter((k) => !['sort', 'order', 'offset'].includes(k)).length;64 const artifacts = current.include === 'artifacts';65 const definition = stats?.definitions?.models ?? page?.facets?.definitions?.models ?? 'Canonical model releases; artifacts, quantisations, conversions and folded evaluation variants are excluded.';66 const artifactsDef = stats?.definitions?.artifacts;67 const ld = { '@context': 'https://schema.org', '@type': 'CollectionPage', name: 'AI models', url: `${SITE_URL}/models`, description: metadata.description, isPartOf: { '@type': 'WebSite', name: SITE_NAME, url: SITE_URL }, ...(page ? { mainEntity: { '@type': 'ItemList', numberOfItems: page.total, itemListElement: page.items.slice(0, 10).map((m, i) => ({ '@type': 'ListItem', position: offset + i + 1, url: `${SITE_URL}${routes.entity(m)}`, name: m.name })) } } : {}) };6869 return (70 <>71 <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(ld) }} />72 <Container wide>73 <header className="flex flex-col gap-3 pb-4 pt-6 md:flex-row md:items-end md:justify-between md:pt-8">74 <div className="min-w-0">75 <p className="eyebrow">Models</p>76 <h1 className="display mt-1 text-[26px] md:text-[34px]">AI models</h1>77 <p className="mt-2 max-w-2xl text-sm text-ink-2">Canonical model releases across every lab and modality. Parameters, context, openness and licences exactly as their sources state them — one row per real model, artifacts folded under their canonical release.</p>78 </div>79 {page && (80 <p className="tnum flex items-center gap-1 text-sm text-ink-2" data-models-count>81 <span className="font-semibold text-ink">{fmtInt(page.total)}</span> {artifacts ? 'models + artifacts' : 'canonical models'} <span className="text-ink-3">{artifacts ? '(artifacts included)' : '(artifacts excluded)'}</span>82 <Hint text={artifacts ? (artifactsDef ? `${definition} Artifacts: ${artifactsDef}` : definition) : definition} align="right" />83 </p>84 )}85 </header>86 <UnderstoodChips current={current} facets={page?.facets} className="pb-3" />87 </Container>8889 <ModelsTerminal filters={<ModelsFilterRail current={current} facets={page?.facets} universeNote={artifactsDef} />} filterCount={filterCount} items={page?.items ?? []}>90 {!page ? (91 <Unavailable what="Models" reason="The API did not answer. Try again in a moment." />92 ) : (93 <>94 <div className="flex flex-wrap items-center justify-between gap-2 pb-1 text-xs text-ink-3">95 <p>96 Sort:{' '}97 {MODEL_SORTS.map((s, i) => (98 <span key={s.value}>99 {i > 0 && ' · '}100 <Link href={sortHref[s.value] ?? '#'} className={sort === s.value ? 'font-medium text-ink' : 'hover:text-ink'} aria-current={sort === s.value ? 'true' : undefined}>101 {s.label}102 </Link>103 </span>104 ))}105 </p>106 <p className="tnum">107 {page.items.length ? `${fmtInt(offset + 1)}–${fmtInt(offset + page.items.length)} of ${fmtInt(page.total)}` : '0 rows'} · {page.universe ?? 'canonical models'}108 </p>109 </div>110 <ModelsTable items={page.items} sort={sort} order={order} sortHref={sortHref} orgHrefTemplate={href({ org: '__ORG__', offset: undefined })} offset={offset} />111 <Pagination total={page.total} limit={LIMIT} offset={offset} makeHref={(o) => href({ offset: o || undefined })} className="mt-4" />112 <Note className="mt-3">113 Best price = cheapest current offer across providers when the listing carries one (USD per 1M tokens); otherwise open the model for its provider deployments. Data quality is how well AI Atlas knows the entity, not how good the model is. Rows focus with the keyboard: ↑ ↓ move, Enter inspects. <Link href="/methodology" className="link">Methodology →</Link>114 </Note>115 </>116 )}117 </ModelsTerminal>118 <CompareTrayBar />119 </>120 );121}122