import type { Metadata } from 'next'; import Link from 'next/link'; import { Sparkline } from '@/components/charts'; import { Dash, IntelListing, str } from '@/components/intelligence/listing-table'; import { Chip } from '@/components/ui/badges'; import { EntityLink, QualityMark } from '@/components/ui/entity'; import { api, safe } from '@/lib/api'; import { fmtDate, fmtInt, num } from '@/lib/format'; import { routes, SITE_NAME, SITE_URL } from '@/lib/site'; export const metadata: Metadata = { title: 'AI frameworks, inference engines, libraries and runtimes — versions, licences, stars', description: 'Training frameworks, inference engines, serving stacks, libraries, runtimes, agent frameworks, orchestration and eval harnesses with latest version, release date, licence and repository stars read from PyPI, GitHub and release pages.', alternates: { canonical: routes.frameworks() }, openGraph: { title: `AI frameworks | ${SITE_NAME}`, url: `${SITE_URL}${routes.frameworks()}`, siteName: SITE_NAME } }; export const revalidate = 300; type Extra = { stars: number[] }; /** Canonical kind vocabulary → label; entity_type is the fallback when no `kind` attribute is stated. */ const KIND_LABELS: Record = { training_framework: 'Training framework', training: 'Training framework', inference_engine: 'Inference engine', inference: 'Inference engine', serving: 'Serving', library: 'Library', runtime: 'Runtime', agent_framework: 'Agent framework', agent: 'Agent framework', orchestration: 'Orchestration', eval_harness: 'Eval harness', evaluation: 'Eval harness', framework: 'Framework', }; const kindOf = (e: { entity_type: string; attributes: Record }) => { const k = str(e.attributes?.kind) ?? str(e.attributes?.category); if (k) return KIND_LABELS[k.toLowerCase().replace(/[\s-]+/g, '_')] ?? k; return KIND_LABELS[e.entity_type] ?? e.entity_type; }; export default async function FrameworksPage({ searchParams }: { searchParams: Promise> }) { const sp = await searchParams; return ( title="Frameworks & runtimes" eyebrow="Frameworks" lede="Training frameworks, inference engines, serving stacks, libraries, runtimes, agent frameworks, orchestration and eval harnesses. Versions and stars are read from PyPI, GitHub and release pages — never estimated." basePath="/frameworks" searchParams={sp} fetch={(q) => api.explore('framework', q)} sorts={[ { value: 'updated', label: 'Recently updated' }, { value: 'stars', label: 'Stars' }, { value: 'release', label: 'Latest release' }, { value: 'name', label: 'Name' }, { value: 'quality', label: 'Data quality' }, ]} filters={sp.org ? [{ kind: 'hidden', name: 'org', value: sp.org }] : []} connectors={['github (repositories)', 'pypi', 'release feeds']} compare enrich={async (items) => { const hist = await Promise.all(items.map((e) => safe(api.entityHistory(e.slug, 'metric.stars')))); const m = new Map(); hist.forEach((h, i) => { const vals = (h?.items ?? []).slice().sort((a, b) => a.observed_at.localeCompare(b.observed_at)).map((c) => num(c.value)).filter((v): v is number => v !== null); m.set(items[i]!.slug, { stars: vals }); }); return m; }} columns={[ { key: 'name', label: 'Framework', primary: true, render: (e) => ( <> {e.description && {e.description}} ), }, { key: 'kind', label: 'Kind', render: (e) => {kindOf(e)} }, { key: 'version', label: 'Latest release', className: 'mono text-xs text-ink', render: (e) => (str(e.attributes?.latest_version) ? <>{(str(e.attributes.latest_version) as string).slice(0, 24)}{str(e.attributes?.latest_release_at) && {fmtDate(str(e.attributes.latest_release_at))}} : ) }, { key: 'license', label: 'Licence', className: 'max-w-[10rem] truncate text-ink-2', render: (e) => str(e.attributes?.license) ?? }, { key: 'stars', label: 'Stars', num: true, className: 'tnum', render: (e, x) => { const v = num(e.attributes?.['metric.stars']); if (v === null) return ; const distinct = new Set(x?.stars ?? []).size; return ( {x && x.stars.length >= 2 && distinct >= 2 && } {fmtInt(v)} ); }, }, { key: 'language', label: 'Language', className: 'text-ink-2', render: (e) => str(e.attributes?.language) ?? }, { key: 'org', label: 'Organization', className: 'text-ink-2', render: (e) => (e.organization ? {e.organization.name} : ) }, { key: 'quality', label: 'Quality', num: true, render: (e) => }, ]} note="Stars are a GitHub metric observed at crawl time; the sparkline appears once the claim history holds two distinct values (see each framework's History tab). Kind falls back to the entity type (framework · library · runtime) when no source states a finer category." /> ); }