Skip to content

Document architecture, Skippy diagrams, and model packages - #974

Merged
i386 merged 2 commits into
mainfrom
jd/architecture-docs
Jul 13, 2026
Merged

Document architecture, Skippy diagrams, and model packages#974
i386 merged 2 commits into
mainfrom
jd/architecture-docs

Conversation

@i386

@i386 i386 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add an architecture hub covering mesh workflows, Skippy execution, request flow, operating shapes, and the repository map.
  • Render the architecture and Skippy split flows with Mermaid diagrams.
  • Add a public model-package.json schema specification covering layout, fields, artifact integrity, stage selection, generation defaults, validation, and compatibility.
  • Link the package specification from architecture, large-model, and contribution guides.

Why

The website had no single architecture map or public contract for model-package repositories. These docs make the mesh/Skippy execution path and package format easier to understand and implement against.

Validation

  • just website-build
  • git diff --check
  • node --check website/src/assets/mermaid.js

Summary by CodeRabbit

  • New Features
    • Documentation pages now render Mermaid diagrams automatically, with responsive styling for both diagrams and SVG output.
  • Documentation
    • Added an Architecture overview, including end-to-end request handling, mesh responsibilities, and runtime execution concepts.
    • Introduced a full model package specification covering required artifacts, validation rules, and compatibility expectations.
    • Updated Running Large Models with split explanations and prerequisite guidance.
    • Refreshed contributing layer packages to reference the model-package.json contract.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a6be9a4-e6ec-4b01-94c2-5c3f1bb5449d

📥 Commits

Reviewing files that changed from the base of the PR and between 1da30ed and 2f394d8.

📒 Files selected for processing (5)
  • website/src/assets/mermaid.js
  • website/src/assets/site.css
  • website/src/docs/pages/architecture.md
  • website/src/docs/pages/model-package-spec.md
  • website/src/docs/pages/running-large-models.md

📝 Walkthrough

Walkthrough

Adds Mermaid rendering to documentation pages and introduces architecture and model-package documentation, including navigation, request-flow diagrams, split-serving guidance, manifest rules, validation requirements, and compatibility conventions.

Changes

Architecture documentation

Layer / File(s) Summary
Mermaid documentation rendering
website/.eleventy.js, website/src/_includes/docs-base.njk, website/src/assets/mermaid.js, website/src/assets/site.css
Mermaid code blocks are preserved during Markdown processing, rendered client-side, and styled within documentation pages.
Architecture overview and navigation
website/src/_data/docs.js, website/src/docs/pages/architecture.md, website/src/docs/pages/running-large-models.md
Adds Architecture navigation, architecture and request-flow documentation, and guidance for split execution of large models.
Model package specification
website/src/docs/pages/contributing-layer-packages.md, website/src/docs/pages/model-package-spec.md
Documents the model-package.json contract, package layout, manifest fields, stage selection, validation, publishing, and compatibility rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: ndizazzo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main additions: architecture docs, Skippy diagrams, and model package documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jd/architecture-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@i386
i386 marked this pull request as ready for review July 13, 2026 02:46
@github-actions
github-actions Bot requested a review from ndizazzo July 13, 2026 02:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
website/src/assets/mermaid.js (1)

1-49: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add error handling for CDN import and rendering failures.

If the CDN import fails or mermaid.run throws, the error becomes an unhandled rejection. The fallback (raw code visible) is acceptable UX, but wrapping in try/catch prevents console noise and makes failures observable.

🛡️ Proposed fix
 async function renderMermaid() {
   const blocks = document.querySelectorAll("pre > code.language-mermaid");
 
   if (!blocks.length) {
     return;
   }
 
-  const { default: mermaid } = await import(
-    "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs"
-  );
-
-  mermaid.initialize({
-    startOnLoad: false,
-    securityLevel: "strict",
-    theme: "dark",
-    flowchart: {
-      curve: "basis",
-      htmlLabels: true,
-    },
-    sequence: {
-      useMaxWidth: true,
-    },
-  });
-
-  const nodes = [];
-
-  blocks.forEach((code) => {
-    const container = document.createElement("div");
-    const pre = code.parentElement;
-    const frame = pre?.parentElement?.classList.contains("code-copy-frame")
-      ? pre.parentElement
-      : pre;
-
-    container.className = "mermaid";
-    container.setAttribute("role", "img");
-    container.setAttribute("aria-label", "Diagram");
-    container.textContent = code.textContent;
-    frame?.replaceWith(container);
-    nodes.push(container);
-  });
-
-  mermaid.run({ nodes });
+  try {
+    const { default: mermaid } = await import(
+      "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs"
+    );
+
+    mermaid.initialize({
+      startOnLoad: false,
+      securityLevel: "strict",
+      theme: "dark",
+      flowchart: {
+        curve: "basis",
+        htmlLabels: true,
+      },
+      sequence: {
+        useMaxWidth: true,
+      },
+    });
+
+    const nodes = [];
+
+    blocks.forEach((code) => {
+      const container = document.createElement("div");
+      const pre = code.parentElement;
+      const frame = pre?.parentElement?.classList.contains("code-copy-frame")
+        ? pre.parentElement
+        : pre;
+
+      container.className = "mermaid";
+      container.setAttribute("role", "img");
+      container.setAttribute("aria-label", "Diagram");
+      container.textContent = code.textContent;
+      frame?.replaceWith(container);
+      nodes.push(container);
+    });
+
+    await mermaid.run({ nodes });
+  } catch (err) {
+    console.error("Mermaid rendering failed:", err);
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/src/assets/mermaid.js` around lines 1 - 49, Update renderMermaid to
catch failures from the dynamic Mermaid CDN import and the subsequent
mermaid.run call, preventing unhandled rejections while preserving the raw-code
fallback. Make the caught failures observable through appropriate error logging,
and keep the existing rendering flow unchanged when no error occurs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@website/src/assets/mermaid.js`:
- Around line 27-40: Update the Mermaid container labeling in the
block-processing loop to avoid assigning every diagram the inaccurate
“Architecture diagram” label. Derive an accessible label from each diagram’s
content when possible, or use a generic label that accurately applies to all
Mermaid diagrams, while preserving the existing container creation and
replacement behavior.
- Line 42: Update the async flow containing mermaid.run({ nodes }) to await the
returned Promise, keeping it within the surrounding try/catch so rendering
errors are properly propagated and handled.
- Around line 8-23: Update the mermaid.initialize configuration in
website/src/assets/mermaid.js to use an HTML-permitting security level so the
existing htmlLabels and <br/> labels render correctly, while preserving the
other Mermaid options.

In `@website/src/assets/site.css`:
- Around line 4506-4521: Update the .docs-body .doc .mermaid background
declaration to use the existing design-system CSS custom property matching this
dark surface color, such as --bg-1 or --surface-1. If no suitable property
exists, define the required custom property with the root variables and
reference it here, removing the hardcoded `#07090d` value.

In `@website/src/docs/pages/model-package-spec.md`:
- Line 130: Update the activation_width entry in the model package specification
table to mark it as Required instead of Recommended, matching the manifest
validation contract enforced by the model package implementation.
- Around line 236-239: Clarify the checksum-verification wording in the
artifact-integrity section: require each downloaded artifact to be checked
against its corresponding manifest entry’s artifact_bytes and sha256 before
installation. Remove or replace the ambiguous “manifest size” requirement, while
preserving the requirement to atomically install files from fresh partial files.

---

Nitpick comments:
In `@website/src/assets/mermaid.js`:
- Around line 1-49: Update renderMermaid to catch failures from the dynamic
Mermaid CDN import and the subsequent mermaid.run call, preventing unhandled
rejections while preserving the raw-code fallback. Make the caught failures
observable through appropriate error logging, and keep the existing rendering
flow unchanged when no error occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d43ae6e-4899-4270-b82e-3a8c70c1e95a

📥 Commits

Reviewing files that changed from the base of the PR and between c14e458 and 1da30ed.

📒 Files selected for processing (9)
  • website/.eleventy.js
  • website/src/_data/docs.js
  • website/src/_includes/docs-base.njk
  • website/src/assets/mermaid.js
  • website/src/assets/site.css
  • website/src/docs/pages/architecture.md
  • website/src/docs/pages/contributing-layer-packages.md
  • website/src/docs/pages/model-package-spec.md
  • website/src/docs/pages/running-large-models.md

Comment thread website/src/assets/mermaid.js Outdated
Comment thread website/src/assets/mermaid.js Outdated
Comment thread website/src/assets/mermaid.js Outdated
Comment on lines +4506 to +4521
.docs-body .doc .mermaid {
margin: 24px 0;
overflow-x: auto;
padding: 16px;
border: 1px solid var(--line-2);
border-radius: 8px;
background: #07090d;
text-align: center;
}

.docs-body .doc .mermaid svg {
display: inline-block;
max-width: 100%;
height: auto;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a CSS custom property for the mermaid container background color.

The border correctly uses var(--line-2), but background: #07090d`` is a hardcoded hex value. As per coding guidelines, stylesheets should use CSS custom properties for theming and follow the dark-first color palette defined in design.json for all colors.

🎨 Proposed fix
 .docs-body .doc .mermaid {
   margin: 24px 0;
   overflow-x: auto;
   padding: 16px;
   border: 1px solid var(--line-2);
   border-radius: 8px;
-  background: `#07090d`;
+  background: var(--bg-1, `#07090d`);
   text-align: center;
 }

If a matching custom property (e.g., --bg-1 or --surface-1) already exists in the design system, use it directly. Otherwise, define one in the root variables and reference it here.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.docs-body .doc .mermaid {
margin: 24px 0;
overflow-x: auto;
padding: 16px;
border: 1px solid var(--line-2);
border-radius: 8px;
background: #07090d;
text-align: center;
}
.docs-body .doc .mermaid svg {
display: inline-block;
max-width: 100%;
height: auto;
}
.docs-body .doc .mermaid {
margin: 24px 0;
overflow-x: auto;
padding: 16px;
border: 1px solid var(--line-2);
border-radius: 8px;
background: var(--bg-1, `#07090d`);
text-align: center;
}
.docs-body .doc .mermaid svg {
display: inline-block;
max-width: 100%;
height: auto;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/src/assets/site.css` around lines 4506 - 4521, Update the .docs-body
.doc .mermaid background declaration to use the existing design-system CSS
custom property matching this dark surface color, such as --bg-1 or --surface-1.
If no suitable property exists, define the required custom property with the
root variables and reference it here, removing the hardcoded `#07090d` value.

Source: Coding guidelines

Comment thread website/src/docs/pages/model-package-spec.md Outdated
Comment thread website/src/docs/pages/model-package-spec.md Outdated

@ndizazzo ndizazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments for improvements

```mermaid
flowchart TD
App["Application<br/>OpenAI client · SDK · console · plugin"]
APIs["Node APIs<br/>9337 /v1<br/>3131 /api"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to have a blurb for the owned node-control API too (config + commands for attested hosts).

Comment thread website/src/docs/pages/architecture.md Outdated

### Routing and election

Every node exposes the same OpenAI-facing shape. A request is routed by model identity rather than by a user selecting a machine. Per-model election decides which node or stage-0 target is authoritative, while passive clients receive a smaller route view instead of full mesh gossip.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every node -> Every host / worker node

| FFI and language packages | `crates/mesh-llm-ffi/`, `crates/mesh-llm-nodejs/`, `sdk/` |
| Skippy runtime and stage serving | `crates/skippy-*` and `crates/mesh-llm-embedded-runtime/` |
| Protocol definitions | `crates/mesh-llm-protocol/`, `crates/skippy-protocol/`, `proto/` |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add a line for the React Mesh LLM console too

@@ -0,0 +1,284 @@
---

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec is hard line-wrapped and our other docs allow soft line wrapping from markdown renderers... we probably want to remove the limit and the renderer handle wrapping


The [architecture hub](/docs/pages/architecture/) explains how Mesh routes requests into Skippy. See the [model package specification](/docs/pages/model-package-spec/) for the manifest schema, artifact checksums, and stage-selection rules. For package publishing and validation, see [Layer package repositories](https://github.com/Mesh-LLM/mesh-llm/blob/main/docs/LAYER_PACKAGE_REPOS.md).

If you are just trying Mesh for the first time, do not start here. Run the [Quickstart](/docs/pages/quickstart/) first.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to top

@i386
i386 merged commit f00b002 into main Jul 13, 2026
17 checks passed
@i386
i386 deleted the jd/architecture-docs branch July 13, 2026 21:57
@coderabbitai coderabbitai Bot mentioned this pull request Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants