From 5efbb18a6f89c3d804d0f89aa765717459f39268 Mon Sep 17 00:00:00 2001 From: zijiexia <37504505+zijiexia@users.noreply.github.com> Date: Wed, 29 Jul 2026 17:46:50 -0700 Subject: [PATCH] [docs] Rotate popular models on the landing pages, lead the Cookbook nav with Kimi (#32835) Co-authored-by: Claude Opus 5 --- docs_new/cookbook/autoregressive/intro.mdx | 36 +- docs_new/cookbook/intro.mdx | 6 + docs_new/docs.json | 66 +-- docs_new/index.mdx | 184 +------ docs_new/src/snippets/_popular_models.jsx | 458 ++++++++++++++++++ .../src/snippets/configs/popular-models.jsx | 66 +++ 6 files changed, 587 insertions(+), 229 deletions(-) create mode 100644 docs_new/src/snippets/_popular_models.jsx create mode 100644 docs_new/src/snippets/configs/popular-models.jsx diff --git a/docs_new/cookbook/autoregressive/intro.mdx b/docs_new/cookbook/autoregressive/intro.mdx index 0e7a8993f..4bd913b49 100644 --- a/docs_new/cookbook/autoregressive/intro.mdx +++ b/docs_new/cookbook/autoregressive/intro.mdx @@ -7,6 +7,24 @@ metatags: --- + + + - - - ## Guides diff --git a/docs_new/docs.json b/docs_new/docs.json index 0a62fe616..a18368a78 100644 --- a/docs_new/docs.json +++ b/docs_new/docs.json @@ -969,6 +969,39 @@ "group": "Autoregressive Models", "pages": [ "cookbook/autoregressive/intro", + { + "group": "Kimi (Moonshot AI)", + "pages": [ + "cookbook/autoregressive/Moonshotai/Kimi-K3", + "cookbook/autoregressive/Moonshotai/Kimi-K2.7-Code", + "cookbook/autoregressive/Moonshotai/Kimi-K2.6", + "cookbook/autoregressive/Moonshotai/Kimi-K2.5", + "cookbook/autoregressive/Moonshotai/Kimi-K2", + "cookbook/autoregressive/Moonshotai/Kimi-Linear" + ] + }, + { + "group": "Thinking Machines", + "pages": [ + "cookbook/autoregressive/ThinkingMachines/Inkling" + ] + }, + { + "group": "GLM", + "pages": [ + "cookbook/autoregressive/GLM/GLM-5.2", + "cookbook/autoregressive/GLM/GLM-5.1", + "cookbook/autoregressive/GLM/GLM-5", + "cookbook/autoregressive/GLM/GLM-OCR", + "cookbook/autoregressive/GLM/GLM-Glyph", + "cookbook/autoregressive/GLM/GLM-4.7", + "cookbook/autoregressive/GLM/GLM-4.7-Flash", + "cookbook/autoregressive/GLM/GLM-4.6", + "cookbook/autoregressive/GLM/GLM-4.6V", + "cookbook/autoregressive/GLM/GLM-4.5", + "cookbook/autoregressive/GLM/GLM-4.5V" + ] + }, { "group": "Qwen", "pages": [ @@ -1009,28 +1042,6 @@ "cookbook/autoregressive/Llama/Llama3.1" ] }, - { - "group": "GLM", - "pages": [ - "cookbook/autoregressive/GLM/GLM-5.2", - "cookbook/autoregressive/GLM/GLM-5.1", - "cookbook/autoregressive/GLM/GLM-5", - "cookbook/autoregressive/GLM/GLM-OCR", - "cookbook/autoregressive/GLM/GLM-Glyph", - "cookbook/autoregressive/GLM/GLM-4.7", - "cookbook/autoregressive/GLM/GLM-4.7-Flash", - "cookbook/autoregressive/GLM/GLM-4.6", - "cookbook/autoregressive/GLM/GLM-4.6V", - "cookbook/autoregressive/GLM/GLM-4.5", - "cookbook/autoregressive/GLM/GLM-4.5V" - ] - }, - { - "group": "Thinking Machines", - "pages": [ - "cookbook/autoregressive/ThinkingMachines/Inkling" - ] - }, { "group": "Meituan", "pages": [ @@ -1057,17 +1068,6 @@ "cookbook/autoregressive/OpenAI/GPT-OSS" ] }, - { - "group": "Moonshotai", - "pages": [ - "cookbook/autoregressive/Moonshotai/Kimi-K3", - "cookbook/autoregressive/Moonshotai/Kimi-K2.7-Code", - "cookbook/autoregressive/Moonshotai/Kimi-K2.6", - "cookbook/autoregressive/Moonshotai/Kimi-K2.5", - "cookbook/autoregressive/Moonshotai/Kimi-K2", - "cookbook/autoregressive/Moonshotai/Kimi-Linear" - ] - }, { "group": "MiniMax", "pages": [ diff --git a/docs_new/index.mdx b/docs_new/index.mdx index 51771793e..74ff885df 100644 --- a/docs_new/index.mdx +++ b/docs_new/index.mdx @@ -9,184 +9,12 @@ keywords: mode: wide --- -
-
- +import { popularModels } from "/src/snippets/configs/popular-models.jsx"; +import { PopularModels } from "/src/snippets/_popular_models.jsx"; + +{/* One hero per model, rotating. The Cookbook landing page renders the same + list as a compact strip. Edit the list, not this page. */} + // docs home +// // cookbook home +// +// variant="hero" full-width banner per model — headline, blurb, tags, CTA, +// brand tile, from the entry's `hero` block. +// variant="strip" (default) one compact line per model — brand mark, name, +// tags, "Open" button. No prose; the tags carry the pitch. +// +// Rotation pauses on hover/focus and is skipped under prefers-reduced-motion. +// +// One export for both shapes: Mintlify evaluates each exported component on its +// own at hydration, so anything two components would share (rotation state, the +// timer, the control cluster) has to sit inside one — module-level helpers are +// out of scope by the time this runs. + +export const PopularModels = ({ + models = [], + variant = "strip", + // A hero blurb takes longer to read than one line of tags. + interval = variant === "hero" ? 9000 : 6000, + label = "Popular models", +}) => { + const [index, setIndex] = useState(0); + const [paused, setPaused] = useState(false); + const [reduceMotion, setReduceMotion] = useState(false); + + useEffect(() => { + if (typeof window === "undefined" || !window.matchMedia) return; + const mq = window.matchMedia("(prefers-reduced-motion: reduce)"); + const sync = () => setReduceMotion(mq.matches); + sync(); + mq.addEventListener("change", sync); + return () => mq.removeEventListener("change", sync); + }, []); + + const count = models.length; + const isHero = variant === "hero"; + + // Functional update so the timer never closes over a stale index. + useEffect(() => { + if (count < 2 || paused || reduceMotion) return; + const id = window.setInterval( + () => setIndex((i) => (i + 1) % count), + Math.max(2000, interval) + ); + return () => window.clearInterval(id); + }, [count, paused, reduceMotion, interval]); + + // A shortened list must not leave the track parked past its last slide. + const active = count ? Math.min(index, count - 1) : 0; + + if (!count) return null; + + const navButtonStyle = { + display: "inline-flex", + alignItems: "center", + justifyContent: "center", + width: "1.15rem", + height: "1.15rem", + padding: 0, + border: "1px solid rgba(255, 255, 255, 0.28)", + borderRadius: "999px", + background: "rgba(255, 255, 255, 0.1)", + color: "rgba(255, 255, 255, 0.92)", + fontSize: "0.8rem", + lineHeight: 1, + cursor: "pointer", + }; + + const controls = + count > 1 ? ( + + + + {models.map((m, i) => ( + + + ) : null; + + // Only the active slide is opaque: mid-slide, a visible neighbour reads as two + // half-drawn cards rather than as motion. + const slideStyle = (i) => ({ + flex: "0 0 100%", + minWidth: 0, + opacity: i === active ? 1 : 0, + pointerEvents: i === active ? "auto" : "none", + transition: reduceMotion ? "none" : "opacity 0.3s ease", + }); + + const tagChip = (t, big) => ( + + {t} + + ); + + const heroSlide = (m, i) => { + const hero = m.hero || {}; + const cta = hero.cta || `Open the ${m.name} cookbook`; + return ( +
+
+
+ + {hero.headline || m.name} + + {hero.blurb ? ( + // A div, not a p: MDX rewrites `p` to its own inline element, so a + // paragraph here would depend on how that element is styled. +
+ {hero.blurb} +
+ ) : null} +
+ {(hero.tags || m.tags || []).map((t) => tagChip(t, true))} +
+ + {cta} → + +
+ + +
+ ); + }; + + const stripSlide = (m, i) => ( + + + + + + + {m.name} + + {m.badge ? ( + + {m.badge} + + ) : null} + + + + {(m.tags || []).map((t) => tagChip(t, false))} + + + + + Open → + + + ); + + return ( +
+
setPaused(true)} + onMouseLeave={() => setPaused(false)} + onFocus={() => setPaused(true)} + onBlur={() => setPaused(false)} + aria-roledescription="carousel" + aria-label={label} + style={{ + position: "relative", + overflow: "hidden", + margin: isHero ? "0 0 1.5rem" : "1.5rem 0", + padding: isHero ? "clamp(1.5rem, 4vw, 2.5rem)" : "0.8rem 1rem 0.9rem", + border: "1px solid rgba(251, 146, 60, 0.35)", + borderRadius: isHero ? "1rem" : "0.9rem", + background: "linear-gradient(135deg, #111827 0%, #31202f 58%, #9a3412 100%)", + boxShadow: isHero + ? "0 20px 45px rgba(17, 24, 39, 0.18)" + : "0 14px 32px rgba(17, 24, 39, 0.16)", + color: "#ffffff", + }} + > + +
+ ); +}; diff --git a/docs_new/src/snippets/configs/popular-models.jsx b/docs_new/src/snippets/configs/popular-models.jsx new file mode 100644 index 000000000..e646781dc --- /dev/null +++ b/docs_new/src/snippets/configs/popular-models.jsx @@ -0,0 +1,66 @@ +// Single `export const popularModels` literal — no spreads/calls/IIFE (Mintlify +// re-evals at hydration). +// +// Rotated by (/src/snippets/_popular_models.jsx) on the docs home +// (`variant="hero"`, uses each entry's `hero` block) and the Cookbook home +// (compact strip, uses `name` / `badge` / `tags`). Both walk this list in order, +// so an entry added here becomes a slide on both; an entry with no `hero` block +// still rotates on the home page, just without a blurb. +// +// Keep the copy to claims that hold on the linked page: platform counts from that +// model's config `supportedHardware`, precisions from its `quantizations`, blurbs +// paraphrasing that page's own opening. + +export const popularModels = [ + { + name: "Kimi-K3", + vendor: "Moonshot AI", + href: "/cookbook/autoregressive/Moonshotai/Kimi-K3", + logo: "/cards/logos/moonshotai.png", + badge: "New", + tags: ["8 platforms", "PD disagg", "DSPARK"], + hero: { + eyebrow: "Featured model · New", + headline: "Meet Kimi-K3 on SGLang", + blurb: + "SGLang natively implements and deeply optimizes K3's new architecture with fused KDA decode kernels, DP attention, MTP, PD disaggregation, and KDA-aware prefix caching. Kimi-K3 is supported on both NVIDIA and AMD GPUs.", + tags: ["2.8T parameters", "Fused KDA decode", "NVIDIA + AMD"], + cta: "Open the Kimi-K3 cookbook", + caption: "Kimi-K3 deployment guide", + }, + }, + { + name: "Inkling", + vendor: "Thinking Machines", + href: "/cookbook/autoregressive/ThinkingMachines/Inkling", + logo: "/cards/logos/thinkingmachines.png", + badge: "New", + tags: ["7 platforms", "NVFP4 / BF16", "MTP + DSpark"], + hero: { + eyebrow: "Featured model · New", + headline: "Meet Inkling on SGLang", + blurb: + "Thinking Machines' open-weights Mixture-of-Experts model — 975B parameters, 41B active per token, a 1M-token context window, and native text, image, and audio input. The cookbook covers its MTP speculative-decoding path and long-context prefix caching on NVIDIA and AMD.", + tags: ["975B · 41B active", "1M context", "Text + image + audio"], + cta: "Open the Inkling cookbook", + caption: "Inkling deployment guide", + }, + }, + { + name: "GLM-5.2", + vendor: "Z.ai", + href: "/cookbook/autoregressive/GLM/GLM-5.2", + logo: "/cards/logos/glm.png", + badge: "New", + tags: ["7 platforms", "DSA attention", "FP8 / NVFP4"], + hero: { + eyebrow: "Featured model · New", + headline: "Meet GLM-5.2 on SGLang", + blurb: + "Z.ai's DeepSeek-Sparse-Attention Mixture-of-Experts model, with MTP speculative decoding and a 1M-token context window. Recipes cover FP8, BF16, and NVFP4 across H200, B200, B300, GB300, and AMD MI300X / MI325X / MI355X.", + tags: ["DSA attention", "1M context", "FP8 / BF16 / NVFP4"], + cta: "Open the GLM-5.2 cookbook", + caption: "GLM-5.2 deployment guide", + }, + }, +];