Skip to content

Restructure Gateway & Routing, swap OpenRouter for Unsloth, and author docs as .mdx - #58

Merged
SPIKESPIGEL404 merged 3 commits into
mainfrom
claude/busy-neumann-84008b
Aug 6, 2026
Merged

Restructure Gateway & Routing, swap OpenRouter for Unsloth, and author docs as .mdx#58
SPIKESPIGEL404 merged 3 commits into
mainfrom
claude/busy-neumann-84008b

Conversation

@SPIKESPIGEL404

@SPIKESPIGEL404 SPIKESPIGEL404 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Three things, in three commits: the Gateway & Routing restructure, the model-source swap, and a fix for a rendering bug found while verifying them.

Gateway & Routing

The section is now six pages in reading order, with the separator groups dropped:

  1. Model Fallbacks · 2. Provider Selection · 3. Virtual Model · 4. Model Variants · 5. Bring Your Own Model · 6. Bring Your Own Provider

Two renames, for what the thing is rather than what the API field is called. presets.mdvirtual-model and byok.mdbring-your-own-provider, both via git mv so history follows. Each page carries a callout noting the wire names are unchanged — the API keeps /v1/namespaces/{nsid}/routing-presets, the routing_preset:* scopes, and byok.

Bring Your Own Model is new. Every technical claim is drawn from existing source-of-truth pages (integrations/models, guides/self-host, ollama/vllm): the api_base/api_protocol/models[].id shape, bitrouter init / config validate, bitrouter route <provider>:<model>, the compatibility.chat_completions switches, and the models: + strategy: priority alias form. It's paired explicitly against Bring Your Own Provider — your weights vs. your account — and hands off to register-as-a-provider for anything Cloud has to reach.

The tools / agents / governance pages (mcp-gateway, server-tools, websearch, web-fetch, acp-gateway, subagent, advisor, fusion, guardrails, structured-outputs) are out of the section nav but stay in the tree at their current URLs, so the ~90 inbound links from other sections keep working. Reverting is one meta.json edit.

Model sources

OpenRouter unpublished. Moved to content/_unpublished/ rather than deleted, dropped from the nav and from the two card grids, redirected to /docs/integrations/models. The aggregator provider block it documented is already the worked example on that page, and /docs/guides/migrate-from-openrouter is untouched.

Unsloth added. There was a stale draft in _unpublished with two real errors, so it was rewritten against Unsloth's current docs rather than published as-is:

  • it put the server on :8000; Unsloth defaults to :8888, which also invalidated the reciprocal "vLLM and Unsloth both default to :8000" callout on the vLLM page (removed)
  • it carried an import line, which the authoring contract forbids

Verified for the new page: install via curl -fsSL https://unsloth.ai/install.sh | sh; unsloth run --model … prints the endpoint and an sk-unsloth-… key; /v1/chat/completions, /v1/messages, and GET /v1/models all answer on the same port; the key is mandatory, unlike Ollama and vLLM.

.md.mdx (the reason the last commit touches 45 files)

While verifying the card grids above, it turned out <Callout>, <Cards>, and <Tabs> were rendering to nothing on every docs page — tag and body alike. fumadocs-mdx picks its processor from the file extension and nothing else:

getProcessor(filePath.endsWith(".mdx") ? "mdx" : "md")

format is applied after the mdxOptions spread in the createProcessor call, so no config in source.config.ts can override it. In markdown mode JSX isn't parsed, so <Callout type="info"> opened a CommonMark HTML block running to the next blank line — the whole block became one raw HTML node, and MDX drops those without rehype-raw. That's the bare <!-- --> the pages emitted. This was live on production and affected 41 of 45 pages.

pnpm lint:docs passed throughout, because it validates the component whitelist rather than the output — which is why it went unnoticed.

The fix is the rename alone; no page bodies were edited. The only braces outside code fences are the intended <Tabs items={[…]}> props, there are no bare angle brackets in prose, and the no-imports rule is unaffected since the components are already global via getMDXComponents. check-docs.mjs already matched .mdx?. One hard-coded path in generate-supported-tables.mjs was repointed so prebuild doesn't fail, and the authoring contract in AGENTS.md / docs/CONTRIBUTING.md now says .mdx and explains why the extension is load-bearing.

Checks

  • pnpm build — full production build, 120 doc pages prerendered, no MDX parse errors
  • pnpm lint:docs — OK, 45 docs across 5 sections
  • pnpm test — 83/83
  • pnpm generate:cli reproduces the CLI reference byte-identically from the edited overlay
  • Recovered content confirmed in the built output; zero escaped &lt;Tabs / &lt;Callout / &lt;Cards remain. Card links on /docs/integrations now appear twice each (sidebar + card) instead of once
  • Redirects verified as 308s: /docs/gateway-and-routing/presets, /docs/gateway-and-routing/byok, /docs/features/presets, /docs/cloud/byok, /docs/models-and-routing/presets, /docs/integrations/openrouter
  • Merged main's (guide) tab restructure; the CLI reference move to /docs/usage/cli/* is preserved

🤖 Generated with Claude Code

SPIKESPIGEL404 and others added 3 commits August 6, 2026 18:23
Gateway & Routing now carries six pages in reading order: model
fallbacks, provider selection, virtual model, model variants, bring your
own model, bring your own provider. Two pages are renamed for what they
are rather than what the API field is called — presets → virtual model,
external providers (BYOK) → bring your own provider — with a callout on
each noting the wire name is unchanged (`routing-presets`, `byok`).

Bring your own model is new: the provider-block shape for an endpoint you
serve yourself, the CLI flow around it, and how it composes with
fallbacks and virtual models. The remaining tools/agents/governance pages
stay in the tree and keep their URLs, but drop out of the section nav for
now.

In integrations, the OpenRouter page is unpublished (the aggregator
provider block it documented is the worked example on the model-sources
page; the migration guide is unaffected), and Unsloth is added alongside
Ollama and vLLM. The Unsloth draft in _unpublished was stale: it put the
server on :8000 and carried an import line. Corrected against Unsloth's
docs — the server defaults to :8888 and requires an `sk-unsloth-…` key —
which also retires the "both default to :8000" clash note on the vLLM
page.

Old URLs redirect. Docs lint and the unit tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…4008b

# Conflicts:
#	content/_unpublished/integrations/openrouter.md
#	content/docs/(guide)/gateway-and-routing/bring-your-own-model.md
#	content/docs/(guide)/gateway-and-routing/bring-your-own-provider.md
#	content/docs/(guide)/gateway-and-routing/byok.md
#	content/docs/(guide)/gateway-and-routing/presets.md
#	content/docs/(guide)/gateway-and-routing/virtual-model.md
#	content/docs/(guide)/integrations/openrouter.md
#	content/docs/(guide)/integrations/unsloth.md
#	content/docs/gateway-and-routing/byok.md
#	content/docs/integrations/openrouter.md
`<Callout>`, `<Cards>`, and `<Tabs>` rendered to nothing on every docs
page — tag and body alike. fumadocs-mdx picks its processor from the file
extension and nothing else:

  getProcessor(filePath.endsWith(".mdx") ? "mdx" : "md")

`format` is applied after the mdxOptions spread in the createProcessor
call, so no config in source.config.ts can override it. In markdown mode
JSX isn't parsed, so `<Callout type="info">` opened a CommonMark HTML
block that ran to the next blank line — the whole block became one raw
HTML node, and MDX drops those without rehype-raw. That's the bare
`<!-- -->` the pages were emitting.

`pnpm lint:docs` passed the entire time, because it validates the
component whitelist rather than the output, which is why this survived so
long. 41 of the 45 hand-authored pages were affected: 5 dropped blocks in
each migration guide, 4 in the quickstart, 3 in self-host, and so on.

So: rename all 45 `content/docs/**/*.md` to `.mdx`. The pages themselves
need no edits — the only braces outside code fences are the intended
`<Tabs items={[…]}>` props, and there are no bare angle brackets in prose
— and the no-imports rule is unaffected, since the components are already
global via getMDXComponents. check-docs.mjs already matched `.mdx?`.

generate-supported-tables.mjs had the one hard-coded path, now pointed at
the .mdx target so prebuild doesn't fail. The authoring contract in
AGENTS.md and docs/CONTRIBUTING.md now says .mdx and explains why the
extension is load-bearing, so nobody reintroduces a .md page.

Verified with a full `pnpm build`: 120 doc pages prerender, no MDX parse
errors, and the previously-missing content is present in the output —
zero escaped `&lt;Tabs` / `&lt;Callout` / `&lt;Cards` remain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SPIKESPIGEL404 SPIKESPIGEL404 changed the title Restructure Gateway & Routing; swap OpenRouter for Unsloth in model sources Restructure Gateway & Routing, swap OpenRouter for Unsloth, and author docs as .mdx Aug 6, 2026
@SPIKESPIGEL404
SPIKESPIGEL404 merged commit f2bc8bc into main Aug 6, 2026
1 check passed
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.

1 participant