forked from llm-d/llm-d.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
383 lines (368 loc) · 13.7 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
383 lines (368 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
// @ts-check
// See https://docusaurus.io/docs/api/docusaurus-config
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { themes as prismThemes } from 'prism-react-renderer';
import { makeDocsPreprocessor } from './scripts/lib/preprocess.mjs';
import { loadMenuConfig, makeSidebarItemsGenerator, validateMenuConfig } from './scripts/lib/sidebar.mjs';
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
const GITHUB_REPO = 'https://github.com/llm-d/llm-d';
// Self-adjusting versioning: derive the version map from versions.json (which
// docusaurus writes newest-first). The newest release is served at /docs and the
// rest at /docs/<version>; the committed dev docs/ are the unreleased "dev"
// version at /docs/dev. Reading the file lets `llmd-site version cut` recreate
// versioned_docs/ without the config hard-coding a version that may be absent.
const siteDir = path.dirname(fileURLToPath(import.meta.url));
// menu-config.json is authored in llm-d/llm-d (docs/menu-config.json) and synced
// into docs/ alongside the docs it describes. It may be absent before the first
// sync, so loadMenuConfig tolerates a missing file and we only validate when docs/ exists.
const docsDir = path.join(siteDir, 'docs');
const menuConfig = loadMenuConfig(path.join(docsDir, 'menu-config.json'));
if (fs.existsSync(docsDir)) validateMenuConfig(menuConfig, docsDir);
const versionsFile = path.join(siteDir, 'versions.json');
/** @type {string[]} */
const releasedVersions = fs.existsSync(versionsFile)
? JSON.parse(fs.readFileSync(versionsFile, 'utf8'))
: [];
const LATEST_VERSION = releasedVersions[0];
const docsVersions = LATEST_VERSION
? {
lastVersion: LATEST_VERSION,
versions: {
// Released versions first (newest = default at /docs, older at /docs/<v>),
// then the unreleased dev version last — this is the version dropdown order.
...Object.fromEntries(
releasedVersions.map((v) => [
v,
{
// Mark the default (newest) release, served at /docs, as "(latest)".
label: v === LATEST_VERSION ? `v${v} (latest)` : `v${v}`,
path: v === LATEST_VERSION ? '' : v,
badge: true,
},
]),
),
current: { label: 'dev', path: 'dev', banner: 'unreleased' },
},
}
: {};
/** Docs are synced from llm-d/llm-d into docs/ (see tools/llmd-site).
* Map a synced doc back to its source file for the "Edit this page" link.
* @type {import('@docusaurus/plugin-content-docs').EditUrlFunction} */
function docsEditUrl({ versionDocsDirPath, docPath }) {
// Only the current ("next") version maps cleanly back to the live source tree.
if (versionDocsDirPath !== 'docs') return undefined;
return `${GITHUB_REPO}/edit/main/docs/${docPath}`;
}
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "llm-d",
tagline: "Kubernetes-native, high-performance distributed LLM inference",
favicon: "img/llm-d-favicon.png",
url: "https://llm-d.ai",
baseUrl: "/",
organizationName: "llm-d",
projectName: "llm-d",
trailingSlash: false,
onBrokenLinks: "warn",
onBrokenAnchors: "warn",
i18n: {
defaultLocale: "en",
locales: ["en"],
},
markdown: {
// .md -> CommonMark (forgiving of the raw HTML in the synced GitHub docs),
// .mdx -> MDX (blog posts, community index/events, getting-started).
format: "detect",
mermaid: true,
// Render-time link/image/brace fixes for the pristine synced docs copy.
preprocessor: makeDocsPreprocessor({ docsDir }),
hooks: {
onBrokenMarkdownLinks: "warn",
onBrokenMarkdownImages: "warn",
},
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: "docs",
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
routeBasePath: "docs",
sidebarPath: "./sidebars.js",
editUrl: docsEditUrl,
sidebarItemsGenerator: makeSidebarItemsGenerator(menuConfig),
// Native versioning: the synced docs/ are the unreleased "dev" version;
// released versions are frozen snapshots under versioned_docs/.
includeCurrentVersion: true,
...docsVersions,
},
blog: {
path: "blog",
routeBasePath: "blog",
showReadingTime: true,
readingTime: ({ content, defaultReadingTime, locale }) =>
defaultReadingTime({
content: content.replace(
/<!-- reading-time-exclude:start -->[\s\S]*?<!-- reading-time-exclude:end -->/g,
"",
),
locale,
}),
blogSidebarTitle: "All posts",
blogSidebarCount: "ALL",
editUrl: `${GITHUB_REPO}/edit/main/website/`,
feedOptions: {
type: ["rss", "atom"],
xslt: true,
},
onInlineTags: "warn",
onInlineAuthors: "warn",
onUntruncatedBlogPosts: "ignore",
},
theme: {
customCss: "./src/css/custom.css",
},
sitemap: {
changefreq: "weekly",
priority: 0.5,
ignorePatterns: ["/tags/**"],
},
}),
],
],
plugins: [
// Client-side redirects for URLs that have moved (e.g. renamed blog slugs).
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/blog/bottleneck-aware-scheduling-for-llm-inference",
to: "/blog/sticky-until-saturated-token-aware-routing",
},
],
},
],
// Community section as its own docs instance (mirrors docusaurus.io/community).
[
"@docusaurus/plugin-content-docs",
{
id: "community",
path: "community",
routeBasePath: "community",
sidebarPath: "./sidebarsCommunity.js",
},
],
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.css",
type: "text/css",
integrity:
"sha384-8mbt0RMYO82eOsn+Rafjm7RQ5iXXpWaVfsGzqL+0/AY4ybVWIwUQ2TeyVK0Rk29T",
crossorigin: "anonymous",
},
],
themes: [
"@docusaurus/theme-mermaid",
// Offline full-text search (docs + blog + community).
/** @type {import('@docusaurus/types').PluginConfig} */
([
"@easyops-cn/docusaurus-search-local",
{
hashed: true,
indexBlog: true,
indexPages: true,
docsRouteBasePath: ["/docs", "/community"],
highlightSearchTermsOnTargetPage: true,
},
]),
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: "img/llm-d-social-card.jpg",
colorMode: {
respectPrefersColorScheme: true,
},
announcementBar: {
id: "llm-d-0-8-0",
content:
'🎉 <b>llm-d 0.8 is here!</b> Multimodal, batch & flow-control graduate to production, with broader accelerator support and initial RL. <a href="/docs/getting-started/quickstart"><b>See what\'s new →</b></a>',
textColor: "#ffffff",
isCloseable: true,
},
docs: {
sidebar: {
hideable: true,
autoCollapseCategories: false,
},
},
navbar: {
logo: {
alt: "llm-d",
src: "img/llm-d-logotype-and-icon.svg",
srcDark: "img/llm-d-logotype-and-icon-dark.svg",
href: "/",
},
items: [
{
// Plain link (not a version-aware docSidebar item) so "Docs" always
// opens the latest release at /docs, regardless of the version the
// visitor last viewed (dev/0.7 are reachable via the dropdown).
to: "/docs",
position: "left",
label: "Docs",
},
{ to: "/blog", label: "Blog", position: "left" },
{
type: "docSidebar",
sidebarId: "communitySidebar",
docsPluginId: "community",
position: "left",
label: "Contributing",
},
{
type: "docsVersionDropdown",
// On the left, right after Community (consistent navbar spacing).
position: "left",
dropdownActiveClassDisabled: true,
// Order the dropdown releases-first (newest default at top), dev last.
versions: [...releasedVersions, "current"],
},
{
// GitHub icon + live star count (see src/components/GithubStarsNavbarItem).
type: "custom-githubStars",
href: GITHUB_REPO,
position: "right",
"aria-label": "GitHub repository",
},
{
href: "https://llm-d.ai/slack",
position: "right",
className: "header-slack-link",
label: "Join Slack",
"aria-label": "llm-d Slack",
},
],
},
footer: {
style: "dark",
logo: {
alt: "llm-d Logo",
src: "img/cncf-color.svg",
srcDark: "img/cncf-white.png",
href: "https://cncf.io",
target: "_blank",
width: 240,
className: "footer-logo",
style: {
marginRight: "10px",
},
},
links: [
{
title: "Documentation",
items: [
{
html: '<a href="/docs" class="footer__link-item">Getting Started</a>',
},
{
html: '<a href="/docs/architecture" class="footer__link-item">Architecture</a>',
},
{
html: '<a href="/docs/well-lit-paths" class="footer__link-item">Well-Lit Paths</a>',
},
],
},
{
title: "Community",
items: [
{
html: '<a href="/community" class="footer__link-item">Contact us</a>',
},
{
html: '<a href="/community/contribute" class="footer__link-item">Contributing</a>',
},
{
html: '<a href="/community/code-of-conduct" class="footer__link-item">Code of Conduct</a>',
},
],
},
{
title: "More",
items: [
{
html: '<a href="/blog" class="footer__link-item">Blog</a>',
},
{
label: "Privacy Policy",
href: "https://www.redhat.com/en/about/privacy-policy",
},
],
},
{
title: "Social",
items: [
{
html: `
<div class="footer-socials" role="navigation" aria-label="Social links">
<div class="footer-socials-row">
<a href="https://github.com/llm-d/" target="_blank" rel="noreferrer noopener" aria-label="GitHub">
<img src="/img/new-social/github-mark-white.png" alt="GitHub" />
</a>
<a href="https://linkedin.com/company/llm-d" target="_blank" rel="noreferrer noopener" aria-label="LinkedIn">
<img src="/img/new-social/linkedin-mark-white.png" alt="LinkedIn" />
</a>
<a href="https://llm-d.slack.com" target="_blank" rel="noreferrer noopener" aria-label="Slack">
<img src="/img/new-social/slack-mark-white.png" alt="Slack" />
</a>
<a href="https://www.reddit.com/r/llm_d/" target="_blank" rel="noreferrer noopener" aria-label="Reddit">
<img src="/img/new-social/reddit-mark-white.png" alt="Reddit" />
</a>
<a href="https://bsky.app/profile/llm-d.ai" target="_blank" rel="noreferrer noopener" aria-label="Bluesky">
<img src="/img/new-social/bluesky-mark-white.svg" alt="Bluesky" />
</a>
<a href="https://x.com/_llm_d_" target="_blank" rel="noreferrer noopener" aria-label="X / Twitter">
<img src="/img/new-social/x-mark-white.png" alt="X / Twitter" />
</a>
<a href="https://www.youtube.com/@llm-d-project" target="_blank" rel="noreferrer noopener" aria-label="YouTube">
<img src="/img/new-social/youtube-mark-white.svg" alt="YouTube" />
</a>
</div>
<div class="footer-cncf">
<img class="footer-cncf-logo" src="/img/CNCF-logo.svg" alt="CNCF" />
<span>llm-d is a CNCF Sandbox project</span>
</div>
<div class="footer-socials-cta">
<a href="/slack" target="_self" rel="noreferrer noopener" aria-label="Join our Slack">
<span class="button-link">Join our Slack</span>
</a>
</div>
</div>
`,
},
],
},
],
copyright: `Copyright llm-d a Series of LF Projects, LLC. Apache 2.0 License.<br />\
We are a Cloud Native Computing Foundation sandbox project.<br />\
For website terms of use, trademark policy and other project policies please see <a href="https://lfprojects.org/policies/" target="_blank" rel="noreferrer noopener">https://lfprojects.org/policies/</a>`,
},
prism: {
theme: prismThemes.oneLight,
darkTheme: prismThemes.oneDark,
additionalLanguages: ["bash", "yaml", "json", "toml", "promql"],
},
mermaid: {
theme: { light: "neutral", dark: "dark" },
},
}),
};
export default config;