Skip to content

Document SDK embedding - #973

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

Document SDK embedding#973
i386 merged 2 commits into
mainfrom
jd/sdk-embedding-docs

Conversation

@i386

@i386 i386 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Add an SDK overview covering the Client/Node roles, lifecycle, platform support, native runtime artifacts, and shared embedding rules.
  • Add language-specific website guides for:
    • Rust
    • Node.js and Electron
    • Java/Kotlin/Android
    • Swift and Apple platforms
  • Document both client-only mesh inference and embedded local serving.
  • Include runtime packaging, console assets, identity persistence, typed errors, mobile lifecycle, and Apple export-compliance notes.
  • Call out that Android mesh inference and model management are supported while local Android serving is not currently advertised.

Why

The website had no SDK navigation or language-specific embedding guides, leaving application developers to reconstruct the integration flow from repository-level SDK READMEs.

Validation

  • just website-build

Summary by CodeRabbit

  • New Features
    • Added a new “SDKs” documentation section with an overview and platform-specific guides for Rust, Node.js & Electron, JVM/Android, and Swift.
    • Included end-to-end instructions for connecting as a client, embedding local serving, streaming chat, and handling lifecycle/cleanup and SDK runtime behavior.
    • Covered optional console integration and mobile/desktop support considerations.
  • Documentation
    • Expanded SDK guidance with examples for tokens/keys, reconnecting with stable identity, and typed error handling.
  • Chores
    • Improved site release metadata by deriving the SDK version to generate the fallback release tag automatically.

@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: 547f2c74-0432-4c95-bdd4-0dc489222173

📥 Commits

Reviewing files that changed from the base of the PR and between 482a2fd and 7aa823e.

📒 Files selected for processing (5)
  • website/src/_data/site.js
  • website/src/docs/pages/sdk-kotlin.md
  • website/src/docs/pages/sdk-node.md
  • website/src/docs/pages/sdk-rust.md
  • website/src/docs/pages/sdk-swift.md

📝 Walkthrough

Walkthrough

Adds SDK navigation and overview documentation plus language-specific guides for client connections, embedded serving, native runtimes, model lifecycles, console hosting, and platform integration across Rust, Node.js/Electron, JVM/Android, and Swift. Site metadata now derives the SDK version from Cargo.toml.

Changes

SDK Documentation

Layer / File(s) Summary
SDK overview and navigation
website/src/_data/docs.js, website/src/docs/pages/sdk.md
Adds the SDK navigation entry and documents shared client/node roles, lifecycle rules, platform support, runtime artifacts, language links, and integration requirements.
Dynamic SDK version metadata
website/src/_data/site.js
Reads the workspace SDK version from Cargo.toml and uses it for site metadata and the GitHub release fallback tag.
Client installation and connectivity guides
website/src/docs/pages/sdk-kotlin.md, website/src/docs/pages/sdk-node.md, website/src/docs/pages/sdk-rust.md, website/src/docs/pages/sdk-swift.md
Adds installation instructions and remote-client examples with lifecycle, identity, authentication, model listing, and streaming chat guidance.
Embedded serving and lifecycle guides
website/src/docs/pages/sdk-kotlin.md, website/src/docs/pages/sdk-node.md, website/src/docs/pages/sdk-rust.md, website/src/docs/pages/sdk-swift.md
Documents native runtime resolution, embedded nodes, model download/load/inference/unload flows, shutdown handling, and unsupported-serving behavior.
Console and platform integration
website/src/docs/pages/sdk-kotlin.md, website/src/docs/pages/sdk-node.md, website/src/docs/pages/sdk-rust.md, website/src/docs/pages/sdk-swift.md
Adds optional console hosting instructions and Electron, Android, JVM, and Apple packaging and lifecycle guidance.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: michaelneale, 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 summarizes the main change: adding SDK embedding documentation and related guides.
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/sdk-embedding-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.

@i386
i386 marked this pull request as ready for review July 13, 2026 02:35
@i386
i386 requested review from michaelneale and ndizazzo July 13, 2026 02:35
@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.

@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: 2

🧹 Nitpick comments (3)
website/src/docs/pages/sdk-rust.md (2)

82-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use a consistent model reference across language guides.

This example uses unsloth/Qwen3-0.6B-GGUF:Q4_K_M while the Node.js (line 80), Kotlin (line 105), and Swift (line 95) guides all use Qwen2.5-3B-Instruct-Q4_K_M. Using the same model reference across guides makes cross-language comparison easier for users.

♻️ Suggested change
-    .model("unsloth/Qwen3-0.6B-GGUF:Q4_K_M")
+    .model("Qwen2.5-3B-Instruct-Q4_K_M")
🤖 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/docs/pages/sdk-rust.md` around lines 82 - 84, Update the model
reference in the Rust MeshNode builder example to Qwen2.5-3B-Instruct-Q4_K_M,
matching the Node.js, Kotlin, and Swift guides while leaving the surrounding
builder flow unchanged.

116-118: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider explicitly mentioning ServingUnsupported for consistency.

The overview (sdk.md line 58) instructs targets without validated local serving to surface the typed ServingUnsupported error. The Kotlin guide (line 126) and Swift guide (line 118) both explicitly name it. The upstream Rust FFI maps MeshApiError::Unsupported { feature } to FfiError::ServingUnsupported. Mentioning the specific variant here would help Rust developers handle the unsupported-serving case correctly.

♻️ Suggested addition
 Return `MeshApiError`/`anyhow::Error` to the application boundary, report download and serving progress, and always unload a served model before shutting down when requests may still be in flight. Use an app-owned cache and avoid sharing one mutable runtime directory between concurrent nodes.
+
+When the host platform lacks a validated native runtime, `MeshApiError::Unsupported { feature }` surfaces as the typed `ServingUnsupported` error through the FFI layer. Handle it explicitly and show an actionable message rather than silently falling back.
🤖 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/docs/pages/sdk-rust.md` around lines 116 - 118, Update the
“Errors and shutdown” guidance to explicitly name the typed ServingUnsupported
error for targets without validated local serving, while preserving the existing
MeshApiError/anyhow::Error boundary guidance and shutdown requirements.
website/src/docs/pages/sdk-node.md (1)

127-129: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider explicitly mentioning the ServingUnsupported typed error.

The overview (sdk.md line 58) instructs targets without validated local serving to surface the typed ServingUnsupported error. The Kotlin guide (line 126) and Swift guide (line 118) both explicitly name it, but this section only says "serving errors" generically. Adding the specific error name would improve cross-guide consistency and help Node.js/Electron developers handle the unsupported-serving case correctly.

♻️ Suggested addition
 The Node API exposes `Client` for remote inference and `Node` for serving, model management, status, reconnect, and console hosting. Handle runtime resolution failures, unavailable endpoints, model download failures, and serving errors as application errors. Persist the owner keypair instead of generating a new one each time the Electron window opens.
+
+When the host platform lacks a validated native runtime, the SDK surfaces a `ServingUnsupported` error rather than silently falling back. Catch and surface this to the user with an actionable message.
🤖 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/docs/pages/sdk-node.md` around lines 127 - 129, Update the
“Runtime and errors” section to explicitly name the typed ServingUnsupported
error alongside the existing serving-error guidance, preserving the current
Node.js/Electron error-handling instructions.
🤖 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/docs/pages/sdk-rust.md`:
- Around line 67-73: Set allow_download explicitly to false in the
NativeRuntimeInstallOptions passed to install_native_runtime, preserving the
example’s opt-in download behavior while retaining the existing defaulted
fields.

In `@website/src/docs/pages/sdk-swift.md`:
- Around line 43-44: Replace the asynchronous defer cleanup around
client.start() and the corresponding serving example with structured do/catch or
equivalent control flow that always awaits client.stop() or node.stop() before
the function exits, including when startup or serving throws. Preserve the
existing success behavior while guaranteeing cleanup completion in both
examples.

---

Nitpick comments:
In `@website/src/docs/pages/sdk-node.md`:
- Around line 127-129: Update the “Runtime and errors” section to explicitly
name the typed ServingUnsupported error alongside the existing serving-error
guidance, preserving the current Node.js/Electron error-handling instructions.

In `@website/src/docs/pages/sdk-rust.md`:
- Around line 82-84: Update the model reference in the Rust MeshNode builder
example to Qwen2.5-3B-Instruct-Q4_K_M, matching the Node.js, Kotlin, and Swift
guides while leaving the surrounding builder flow unchanged.
- Around line 116-118: Update the “Errors and shutdown” guidance to explicitly
name the typed ServingUnsupported error for targets without validated local
serving, while preserving the existing MeshApiError/anyhow::Error boundary
guidance and shutdown requirements.
🪄 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: 3df0c71f-5c04-4bfb-b1f7-5275c60edc24

📥 Commits

Reviewing files that changed from the base of the PR and between c14e458 and 482a2fd.

📒 Files selected for processing (6)
  • website/src/_data/docs.js
  • website/src/docs/pages/sdk-kotlin.md
  • website/src/docs/pages/sdk-node.md
  • website/src/docs/pages/sdk-rust.md
  • website/src/docs/pages/sdk-swift.md
  • website/src/docs/pages/sdk.md

Comment thread website/src/docs/pages/sdk-rust.md
Comment thread website/src/docs/pages/sdk-swift.md Outdated
Comment thread website/src/docs/pages/sdk-swift.md Outdated

```swift
dependencies: [
.package(url: "https://github.com/Mesh-LLM/mesh-llm", from: "0.72.1"),

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.

@i386 hopefully people copy/pasting this don't run into old version issues - I wonder if we should have some way to generate these or have a "latest" tag here instead?

@i386
i386 merged commit 7580e62 into main Jul 13, 2026
1 of 2 checks passed
@i386
i386 deleted the jd/sdk-embedding-docs branch July 13, 2026 22:08
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.

3 participants