Skip to content

docs: add Messages API, external providers, and mesh HA documentation - #786

Merged
slin1237 merged 1 commit into
mainfrom
slin/docs-update
Mar 17, 2026
Merged

slin1237 merged 1 commit into
mainfrom
slin/docs-update

Conversation

@slin1237

@slin1237 slin1237 commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Catches up documentation with 69 features shipped since the last docs update (~Feb 10).

New Pages

  • reference/api/messages.md — Anthropic Messages API (/v1/messages) with streaming, gRPC backend translation, and connection modes
  • getting-started/external-providers.md — Guide for external providers (OpenAI, Anthropic, xAI, Gemini): worker registration, model discovery fan-out, BYOK, multi-provider routing

Updated Pages

  • reference/configuration.md — New CLI flags: --remove-unhealthy-workers, --disable-tokenizer-autoload, mesh server flags (--enable-mesh, --mesh-host, --mesh-port, --mesh-peer-urls, --mesh-server-name)
  • concepts/architecture/high-availability.md — Quick start CLI examples, Python bindings smg launch --enable-mesh, cache-aware state sync endpoints, --router-selector for k8s pod discovery
  • concepts/routing/cache-aware.md — Event-driven KV block size learning, mesh state synchronization
  • mkdocs.yml — Navigation entries for new pages

Not Documented (Not Ready)

  • Gemini Router (not production-ready)
  • Realtime/WebRTC API (not production-ready)
  • gRPC Servicer (internal)

Test plan

  • mkdocs serve renders all pages without errors
  • New nav entries appear correctly
  • Internal links resolve

Summary by CodeRabbit

  • Documentation
    • Added External LLM Provider Gateway documentation with provider-agnostic routing and auto-detection
    • New Anthropic Messages API reference including streaming support
    • Expanded High Availability documentation with mesh networking quick start and Kubernetes pod discovery
    • Enhanced cache-aware state synchronization documentation for consistent routing state across nodes
    • Updated configuration reference with new tokenizer autoload option and clarified mesh server settings

What changed:
- docs/reference/api/messages.md: new page documenting Anthropic Messages
  API support (/v1/messages), covering streaming, gRPC backend translation,
  and connection modes
- docs/getting-started/external-providers.md: new guide for using SMG with
  external LLM providers (OpenAI, Anthropic, xAI, Gemini), covering worker
  registration, model discovery fan-out, BYOK, and multi-provider routing
- docs/reference/configuration.md: add --remove-unhealthy-workers,
  --disable-tokenizer-autoload, and Mesh Server section (--enable-mesh,
  --mesh-server-name, --mesh-host, --mesh-port, --mesh-peer-urls)
- docs/concepts/architecture/high-availability.md: add quick start CLI
  examples, Python bindings support, cache-aware state sync endpoints,
  --router-selector for k8s pod discovery
- docs/concepts/routing/cache-aware.md: add event-driven block size
  learning from KV events, mesh state synchronization section
- mkdocs.yml: add External Providers and Anthropic Messages API to nav

Why: 69 features shipped since last docs update (~Feb 10) with zero
documentation. This covers the highest-impact user-facing features.

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@slin1237
slin1237 requested a review from CatherineSue as a code owner March 17, 2026 15:05
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the documentation to reflect features shipped since February 10th. It introduces comprehensive guides for integrating with external LLM providers and utilizing the Anthropic Messages API. Additionally, it enhances existing documentation for high-availability architecture, cache-aware routing, and CLI configuration options, ensuring the documentation aligns with the latest capabilities of the system.

Highlights

  • Anthropic Messages API Documentation: A new page was added detailing support for the Anthropic Messages API (/v1/messages), including streaming, gRPC backend translation, and various connection modes.
  • External Providers Guide: A new guide was introduced for integrating with external LLM providers such as OpenAI, Anthropic, xAI, and Gemini, covering worker registration, model discovery, Bring Your Own Key (BYOK), and multi-provider routing.
  • Configuration Updates: New CLI flags like --remove-unhealthy-workers and --disable-tokenizer-autoload were documented, along with updated descriptions for mesh server flags and the --router-selector for Kubernetes pod discovery.
  • High Availability Enhancements: The HA architecture documentation was updated with quick start CLI examples, Python bindings for mesh enablement, details on cache-aware state sync endpoints, and Kubernetes pod discovery using --router-selector.
  • Cache-Aware Routing Details: The cache-aware routing documentation was expanded to include event-driven KV block size learning and mesh state synchronization across router nodes.
Changelog
  • docs/concepts/architecture/high-availability.md
    • Added a "Quick Start" section for enabling mesh networking.
    • Included documentation for the --router-selector flag and Python entrypoint for mesh.
    • Detailed "Cache-Aware State Sync" with specific mesh endpoints.
    • Added a section on "Kubernetes Pod Discovery" using --router-selector.
  • docs/concepts/routing/cache-aware.md
    • Introduced "Event-Driven Block Size" learning from worker KV events.
    • Added "Mesh State Synchronization" details for cache-aware routing in HA mode.
  • docs/getting-started/external-providers.md
    • New page added, covering supported providers, quick start, model discovery, API key handling, and multi-provider routing.
  • docs/reference/api/messages.md
    • New page added, documenting the Anthropic Messages API endpoint, request examples, streaming, gRPC backend integration, connection modes, and features.
  • docs/reference/configuration.md
    • Added documentation for the --disable-tokenizer-autoload flag.
    • Updated descriptions for mesh server configuration flags (--enable-mesh, --mesh-server-name, --mesh-host, --mesh-port, --mesh-peer-urls).
    • Clarified the description for the --remove-unhealthy-workers flag.
  • mkdocs.yml
    • Added "External Providers" to the "Getting Started" navigation.
    • Added "Anthropic Messages API" to the "API" reference navigation.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This pull request adds comprehensive documentation for external LLM provider gateway support (focusing on Anthropic integration), expands high-availability and cache-aware routing documentation with mesh networking details, introduces a new --disable-tokenizer-autoload configuration option, and updates the documentation navigation structure.

Changes

Cohort / File(s) Summary
High-Availability & Cache-Aware Routing Docs
docs/concepts/architecture/high-availability.md, docs/concepts/routing/cache-aware.md
Added Quick Start for mesh networking, Command Line Options (--router-selector flag), Cache-Aware State Sync with exposed endpoints, and Kubernetes Pod Discovery documentation. Note: cache-aware.md contains duplicated Event-Driven Block Size and Mesh State Synchronization sections that appear twice in the document.
External Provider Integration
docs/getting-started/external-providers.md, docs/reference/api/messages.md
New documentation pages describing SMG's external LLM provider gateway with Anthropic Messages API integration, including provider-agnostic routing, auto-detection, API key handling, streaming support, and usage examples.
Configuration Reference
docs/reference/configuration.md
Added --disable-tokenizer-autoload configuration option, reworded Mesh Server Configuration section with clarified descriptions for --enable-mesh, --mesh-server-name, --mesh-host, and --mesh-peer-urls; updated Remove Unhealthy Workers description.
Navigation Structure
mkdocs.yml
Added two new navigation entries: External Providers under Getting Started > Advanced Features and Anthropic Messages API under Reference > API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

anthropic

Suggested reviewers

  • CatherineSue
  • key4ng
  • XinyueZhang369

Poem

🐰 New docs hop into view,
With Anthropic pathways shiny and true,
Mesh networks dance, providers align,
Configuration blooms—what a fine design! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely describes the main changes: adding documentation for Messages API, external providers, and mesh HA features.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slin/docs-update
📝 Coding Plan
  • Generate coding plan for human review comments

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

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 17, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds extensive documentation for several new features, including the Anthropic Messages API, external provider integration, and high-availability mesh networking. The changes are well-structured and add valuable information. I've found a few issues in the examples provided, primarily an incorrect model name used in the Anthropic API examples which will cause them to fail, and a potentially confusing IP address in a quick-start guide. Addressing these will improve the accuracy and user-friendliness of the new documentation.

Comment thread docs/getting-started/external-providers.md
Comment thread docs/reference/api/messages.md
Comment thread docs/reference/api/messages.md
Comment thread docs/concepts/architecture/high-availability.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/getting-started/external-providers.md`:
- Around line 9-16: The "Before you begin" heading inside the prerequisites div
currently uses an h4 markdown token (#### Before you begin), skipping h2/h3 and
violating heading hierarchy; update the heading to a proper h2/h3 level (e.g.,
replace '#### Before you begin' with '## Before you begin') or alternatively
retain the semantic heading level and apply CSS styling to the .prerequisites
container to preserve visual appearance—modify the markdown token in the <div
class="prerequisites"> block accordingly (look for the '#### Before you begin'
text) and ensure the new heading level follows h1 without skipping levels.

In `@docs/reference/api/messages.md`:
- Around line 15-17: The fenced code block showing the endpoint "POST
/v1/messages" is missing a language specifier; update that fenced block to
include a language (e.g., use ```http) so the block becomes a language-tagged
code fence, which resolves markdownlint MD040 and enables proper syntax
highlighting for the "POST /v1/messages" example.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: efb9a21f-c5a5-4548-844c-8d88d4b1edfe

📥 Commits

Reviewing files that changed from the base of the PR and between af25cf9 and 0b80f0c.

📒 Files selected for processing (6)
  • docs/concepts/architecture/high-availability.md
  • docs/concepts/routing/cache-aware.md
  • docs/getting-started/external-providers.md
  • docs/reference/api/messages.md
  • docs/reference/configuration.md
  • mkdocs.yml

Comment thread docs/getting-started/external-providers.md
Comment on lines +15 to +17
```
POST /v1/messages
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add language specifier to fenced code block.

The code block for the endpoint lacks a language specifier. This triggers markdownlint MD040 and may affect syntax highlighting in the rendered documentation.

📝 Proposed fix
-```
+```http
 POST /v1/messages
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 15-15: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reference/api/messages.md` around lines 15 - 17, The fenced code block
showing the endpoint "POST /v1/messages" is missing a language specifier; update
that fenced block to include a language (e.g., use ```http) so the block becomes
a language-tagged code fence, which resolves markdownlint MD040 and enables
proper syntax highlighting for the "POST /v1/messages" example.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b80f0ce5b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +71 to +73
1. Fans out the request to all healthy external workers concurrently
2. Forwards the caller's token to each upstream provider
3. Aggregates and returns the discovered models from all providers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop claiming /v1/models aggregates all providers

The model discovery section says the gateway aggregates results from all external providers, but the implementation in model_gateway/src/routers/router_manager.rs (fetch_upstream_models) fans out and then returns on the first non-empty upstream response, not a merged union. In multi-provider BYOK setups this means users will only see one provider’s models, so this new documentation is materially inaccurate for GET /v1/models behavior.

Useful? React with 👍 / 👎.

Comment on lines +300 to +302
- `GET /mesh/cluster/status` — Cluster membership
- `GET /mesh/workers/state` — Worker state sync
- `GET /mesh/policies/state` — Policy state sync

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace invalid /mesh endpoints with real HA API paths

This new endpoint list documents /mesh/cluster/status, /mesh/workers/state, and /mesh/policies/state, but the server only registers /ha/status, /ha/workers, and /ha/policies in model_gateway/src/server.rs. Operators following these docs will get 404s for all listed paths, which breaks HA observability and troubleshooting workflows.

Useful? React with 👍 / 👎.

@slin1237
slin1237 merged commit 6dca0c8 into main Mar 17, 2026
6 checks passed
@slin1237
slin1237 deleted the slin/docs-update branch March 17, 2026 15:16
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant