From 97e235080335cabcaea5d32d49f45c54bf0523fe Mon Sep 17 00:00:00 2001 From: Zijie Xia Date: Wed, 29 Jul 2026 17:08:34 -0700 Subject: [PATCH 1/2] [docs] Rotate popular models on the docs and Cookbook landing pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs landing page hard-coded a ~180-line Kimi-K3 hero, and the Cookbook landing page had no model entrance at all. Both now render one shared list (docs_new/src/snippets/configs/popular-models.jsx) through one component: index.mdx cookbook/intro.mdx variant="hero" keeps the existing banner design, one slide per model. The Cookbook strip is the compact form — brand mark, name, tags, "Open" — since that page's content column is 472px and prose would push the guide cards off screen. Featuring a different model is now a list edit, not a page edit. Seeded with Kimi-K3, Inkling, and GLM-5.2; tags and blurbs come from each model's own cookbook config and page (platform counts from supportedHardware, precisions from quantizations). Rotation pauses on hover/focus and is skipped under prefers-reduced-motion; dots and prev/next sit in the card chrome, never in the slide body, so no glyph inside a slide reads as "next" when it would navigate instead. Also renames the Kimi nav group and cookbook card from "Moonshotai" to "Kimi (Moonshot AI)". Page paths are unchanged, so no URLs move. Co-Authored-By: Claude Opus 5 --- docs_new/cookbook/autoregressive/intro.mdx | 2 +- docs_new/cookbook/intro.mdx | 6 + docs_new/docs.json | 2 +- docs_new/index.mdx | 184 +------ docs_new/src/snippets/_popular_models.jsx | 458 ++++++++++++++++++ .../src/snippets/configs/popular-models.jsx | 66 +++ 6 files changed, 538 insertions(+), 180 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 0e7a8993fd152..7daefe64258de 100644 --- a/docs_new/cookbook/autoregressive/intro.mdx +++ b/docs_new/cookbook/autoregressive/intro.mdx @@ -68,7 +68,7 @@ metatags: img="/cards/logos/openai.png" /> ## Guides diff --git a/docs_new/docs.json b/docs_new/docs.json index 0a62fe616b8bb..46d522ca741e1 100644 --- a/docs_new/docs.json +++ b/docs_new/docs.json @@ -1058,7 +1058,7 @@ ] }, { - "group": "Moonshotai", + "group": "Kimi (Moonshot AI)", "pages": [ "cookbook/autoregressive/Moonshotai/Kimi-K3", "cookbook/autoregressive/Moonshotai/Kimi-K2.7-Code", diff --git a/docs_new/index.mdx b/docs_new/index.mdx index 51771793ecd74..74ff885dfd3a5 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 0000000000000..e646781dcd69e --- /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", + }, + }, +]; From d1a4f8b5e371ec19e07de4abd892dd8e34a849a0 Mon Sep 17 00:00:00 2001 From: Zijie Xia Date: Wed, 29 Jul 2026 17:24:03 -0700 Subject: [PATCH 2/2] [docs] Cookbook: lead the autoregressive nav with Kimi, Thinking Machines, GLM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hoist those three vendor groups to the top of the Autoregressive Models nav, ahead of Qwen; the remaining 23 keep their relative order. The cookbook card grid mirrors the nav order, so it is reordered the same way. Group names and page paths are untouched — only the ordering moves, so no URLs change. Co-Authored-By: Claude Opus 5 --- docs_new/cookbook/autoregressive/intro.mdx | 36 ++++++------ docs_new/docs.json | 66 +++++++++++----------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/docs_new/cookbook/autoregressive/intro.mdx b/docs_new/cookbook/autoregressive/intro.mdx index 7daefe64258de..4bd913b4966ad 100644 --- a/docs_new/cookbook/autoregressive/intro.mdx +++ b/docs_new/cookbook/autoregressive/intro.mdx @@ -7,6 +7,24 @@ metatags: --- + + + - - -