Restructure Gateway & Routing, swap OpenRouter for Unsloth, and author docs as .mdx - #58
Merged
Merged
Conversation
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 `<Tabs` / `<Callout` / `<Cards` remain.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Two renames, for what the thing is rather than what the API field is called.
presets.md→virtual-modelandbyok.md→bring-your-own-provider, both viagit mvso history follows. Each page carries a callout noting the wire names are unchanged — the API keeps/v1/namespaces/{nsid}/routing-presets, therouting_preset:*scopes, andbyok.Bring Your Own Model is new. Every technical claim is drawn from existing source-of-truth pages (
integrations/models,guides/self-host,ollama/vllm): theapi_base/api_protocol/models[].idshape,bitrouter init/config validate,bitrouter route <provider>:<model>, thecompatibility.chat_completionsswitches, and themodels:+strategy: priorityalias form. It's paired explicitly against Bring Your Own Provider — your weights vs. your account — and hands off toregister-as-a-providerfor 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.jsonedit.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-openrouteris untouched.Unsloth added. There was a stale draft in
_unpublishedwith two real errors, so it was rewritten against Unsloth's current docs rather than published as-is::8000; Unsloth defaults to:8888, which also invalidated the reciprocal "vLLM and Unsloth both default to :8000" callout on the vLLM page (removed)importline, which the authoring contract forbidsVerified for the new page: install via
curl -fsSL https://unsloth.ai/install.sh | sh;unsloth run --model …prints the endpoint and ansk-unsloth-…key;/v1/chat/completions,/v1/messages, andGET /v1/modelsall 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-mdxpicks its processor from the file extension and nothing else:formatis applied after themdxOptionsspread in thecreateProcessorcall, so no config insource.config.tscan 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 withoutrehype-raw. That's the bare<!-- -->the pages emitted. This was live on production and affected 41 of 45 pages.pnpm lint:docspassed 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 viagetMDXComponents.check-docs.mjsalready matched.mdx?. One hard-coded path ingenerate-supported-tables.mjswas repointed soprebuilddoesn't fail, and the authoring contract inAGENTS.md/docs/CONTRIBUTING.mdnow says.mdxand explains why the extension is load-bearing.Checks
pnpm build— full production build, 120 doc pages prerendered, no MDX parse errorspnpm lint:docs— OK, 45 docs across 5 sectionspnpm test— 83/83pnpm generate:clireproduces the CLI reference byte-identically from the edited overlay<Tabs/<Callout/<Cardsremain. Card links on/docs/integrationsnow appear twice each (sidebar + card) instead of once/docs/gateway-and-routing/presets,/docs/gateway-and-routing/byok,/docs/features/presets,/docs/cloud/byok,/docs/models-and-routing/presets,/docs/integrations/openroutermain's(guide)tab restructure; the CLI reference move to/docs/usage/cli/*is preserved🤖 Generated with Claude Code