From eed99b0383946c364ca683e264533fac0fb1c203 Mon Sep 17 00:00:00 2001 From: Spikel Date: Fri, 7 Aug 2026 12:11:01 +0800 Subject: [PATCH 1/2] Rename docs nav sections and surface the tool-calling pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gateway & Routing → Models & Routing, Observability & Evaluation → Evals & Tracing, and the tool-calling pages split out into a new MCP & Tool Calling section. Ten pages under gateway-and-routing/ were written but absent from its meta.json `pages` list, so fumadocs never rendered them in the sidebar. Seven of them (mcp-gateway, server-tools, advisor, subagent, fusion, websearch, web-fetch) form the new section; structured-outputs and guardrails join Models & Routing. acp-gateway moves with the tool pages but stays unlisted — its ACP v2 story isn't live yet. The section slug went models-and-routing → gateway-and-routing in 2026-08 and now back, so the old reverse redirects would have become self-redirects. Those are dropped and replaced with per-page 301s from gateway-and-routing/ to whichever section each page landed in, plus a wildcard for observability/ → evals-and-tracing/. Also updates check-docs.mjs's section list, llms.txt (which now mirrors the three sections and drops two redirect hops), the CLI overlays, and adds a note on the MCP gateway page distinguishing it from the origin MCP server in Usage — the two point in opposite directions and now sit in adjacent sections. Verified: pnpm build, pnpm test (83), pnpm lint:docs all pass, and a redirect audit confirms no self-redirects, loops, shadowed live pages, or broken internal /docs links. Co-Authored-By: Claude Opus 5 --- .models-snapshot.json | 118 +++++++++++----- .providers-snapshot.json | 41 +++--- cli-overlays/harnesses.md | 2 +- cli-overlays/index.md | 4 +- cli-overlays/misc.md | 2 +- cli-overlays/policy.md | 2 +- cli-overlays/providers.md | 2 +- cli-overlays/route.md | 2 +- cli-overlays/tools.md | 2 +- content/_unpublished/integrations/cline.mdx | 2 +- .../integrations/github-copilot.mdx | 2 +- .../_unpublished/integrations/kilocode.mdx | 2 +- .../_unpublished/integrations/lm-studio.mdx | 2 +- .../integrations/local-models.mdx | 2 +- .../_unpublished/integrations/openhands.mdx | 2 +- .../_unpublished/integrations/openrouter.md | 2 +- .../evaluation.mdx | 8 +- .../meta.json | 2 +- .../opentelemetry.mdx | 8 +- .../tracing.mdx | 8 +- .../acp-gateway.mdx | 0 .../advisor.mdx | 8 +- .../fusion.mdx | 6 +- .../mcp-gateway.mdx | 8 +- .../(guide)/mcp-and-tool-calling/meta.json | 14 ++ .../server-tools.mdx | 8 +- .../subagent.mdx | 6 +- .../web-fetch.mdx | 12 +- .../websearch.mdx | 10 +- content/docs/(guide)/meta.json | 5 +- .../bring-your-own-model.mdx | 8 +- .../bring-your-own-provider.mdx | 2 +- .../guardrails.mdx | 0 .../meta.json | 6 +- .../model-fallback.mdx | 2 +- .../model-variants.mdx | 8 +- .../provider-selection.mdx | 6 +- .../structured-outputs.mdx | 2 +- .../virtual-model.mdx | 12 +- .../(guide)/overview/bitrouter-vs-litellm.mdx | 4 +- .../overview/bitrouter-vs-openrouter.mdx | 4 +- content/docs/(guide)/overview/quickstart.mdx | 14 +- .../(guide)/overview/supported-models.mdx | 37 ++--- .../(guide)/overview/what-is-bitrouter.mdx | 12 +- content/docs/(guide)/usage/cli.mdx | 16 +-- content/docs/(guide)/usage/configuration.mdx | 22 +-- content/docs/(guide)/usage/mcp.mdx | 4 +- content/docs/(guide)/usage/tui.mdx | 2 +- content/docs/guides/build-a-plugin.mdx | 4 +- content/docs/guides/migrate-from-litellm.mdx | 32 ++--- .../docs/guides/migrate-from-openrouter.mdx | 2 +- .../docs/guides/migrate-from-tensorzero.mdx | 30 ++-- content/docs/guides/self-host.mdx | 8 +- content/docs/integrations/claude-code.mdx | 4 +- .../docs/integrations/claude-subscription.mdx | 2 +- .../docs/integrations/codex-subscription.mdx | 2 +- content/docs/integrations/codex.mdx | 2 +- content/docs/integrations/harnesses.mdx | 2 +- content/docs/integrations/hermes.mdx | 2 +- content/docs/integrations/index.mdx | 2 +- content/docs/integrations/models.mdx | 4 +- content/docs/integrations/ollama.mdx | 2 +- content/docs/integrations/openclaw.mdx | 2 +- content/docs/integrations/opencode.mdx | 2 +- content/docs/integrations/pi.mdx | 2 +- content/docs/integrations/unsloth.mdx | 4 +- content/docs/integrations/vllm.mdx | 2 +- lib/llms-txt.ts | 36 +++-- lib/mcp/format.test.ts | 8 +- next.config.ts | 131 ++++++++++-------- scripts/check-docs.mjs | 5 +- 71 files changed, 428 insertions(+), 315 deletions(-) rename content/docs/(guide)/{observability => evals-and-tracing}/evaluation.mdx (89%) rename content/docs/(guide)/{observability => evals-and-tracing}/meta.json (74%) rename content/docs/(guide)/{observability => evals-and-tracing}/opentelemetry.mdx (94%) rename content/docs/(guide)/{observability => evals-and-tracing}/tracing.mdx (82%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/acp-gateway.mdx (100%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/advisor.mdx (87%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/fusion.mdx (93%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/mcp-gateway.mdx (84%) create mode 100644 content/docs/(guide)/mcp-and-tool-calling/meta.json rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/server-tools.mdx (81%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/subagent.mdx (91%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/web-fetch.mdx (77%) rename content/docs/(guide)/{gateway-and-routing => mcp-and-tool-calling}/websearch.mdx (81%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/bring-your-own-model.mdx (84%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/bring-your-own-provider.mdx (97%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/guardrails.mdx (100%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/meta.json (63%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/model-fallback.mdx (93%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/model-variants.mdx (84%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/provider-selection.mdx (85%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/structured-outputs.mdx (98%) rename content/docs/(guide)/{gateway-and-routing => models-and-routing}/virtual-model.mdx (88%) diff --git a/.models-snapshot.json b/.models-snapshot.json index 87c35a0..bbf9e23 100644 --- a/.models-snapshot.json +++ b/.models-snapshot.json @@ -1,5 +1,5 @@ { - "count": 49, + "count": 52, "models": [ { "id": "anthropic/claude-fable-5", @@ -98,6 +98,23 @@ "outputUsdPerM": 25, "openWeights": false }, + { + "id": "anthropic/claude-opus-5", + "name": "Anthropic: Claude Opus 5", + "inputModalities": [ + "text", + "image" + ], + "outputModalities": [ + "text" + ], + "maxInputTokens": 1000000, + "capabilities": [], + "providers": 2, + "inputUsdPerM": 5, + "outputUsdPerM": 25, + "openWeights": false + }, { "id": "anthropic/claude-sonnet-4.6", "name": "Anthropic: Claude Sonnet 4.6", @@ -158,8 +175,8 @@ "tools" ], "providers": 6, - "inputUsdPerM": 0.21, - "outputUsdPerM": 0.315, + "inputUsdPerM": 0.252, + "outputUsdPerM": 0.378, "openWeights": true }, { @@ -177,8 +194,27 @@ "tools" ], "providers": 7, - "inputUsdPerM": 0.0983, - "outputUsdPerM": 0.1966, + "inputUsdPerM": 0.112, + "outputUsdPerM": 0.224, + "openWeights": true + }, + { + "id": "deepseek/deepseek-v4-flash-0731", + "name": "DeepSeek: DeepSeek V4 Flash 0731", + "inputModalities": [ + "text" + ], + "outputModalities": [ + "text" + ], + "maxInputTokens": 1000000, + "capabilities": [ + "reasoning", + "tools" + ], + "providers": 4, + "inputUsdPerM": 0.14, + "outputUsdPerM": 0.28, "openWeights": true }, { @@ -197,8 +233,8 @@ "tools" ], "providers": 8, - "inputUsdPerM": 1.305, - "outputUsdPerM": 2.61, + "inputUsdPerM": 0.435, + "outputUsdPerM": 0.87, "openWeights": true }, { @@ -307,8 +343,8 @@ "tools" ], "providers": 6, - "inputUsdPerM": 0.225, - "outputUsdPerM": 0.9, + "inputUsdPerM": 0.15, + "outputUsdPerM": 1.2, "openWeights": true }, { @@ -326,8 +362,8 @@ "tools" ], "providers": 3, - "inputUsdPerM": 0.225, - "outputUsdPerM": 0.9, + "inputUsdPerM": 0.3, + "outputUsdPerM": 1.2, "openWeights": true }, { @@ -387,8 +423,8 @@ "tools" ], "providers": 10, - "inputUsdPerM": 0.7125, - "outputUsdPerM": 3, + "inputUsdPerM": 0.66, + "outputUsdPerM": 3.5, "openWeights": true }, { @@ -408,8 +444,8 @@ "tools" ], "providers": 5, - "inputUsdPerM": 0.7125, - "outputUsdPerM": 3, + "inputUsdPerM": 0.73, + "outputUsdPerM": 3.5, "openWeights": true }, { @@ -513,8 +549,8 @@ "tools" ], "providers": 1, - "inputUsdPerM": 1, - "outputUsdPerM": 6, + "inputUsdPerM": 0.2, + "outputUsdPerM": 1.2, "openWeights": false }, { @@ -555,8 +591,8 @@ "tools" ], "providers": 1, - "inputUsdPerM": 2.5, - "outputUsdPerM": 15, + "inputUsdPerM": 2, + "outputUsdPerM": 12, "openWeights": false }, { @@ -656,8 +692,8 @@ "maxInputTokens": 1000000, "capabilities": [], "providers": 4, - "inputUsdPerM": 1.875, - "outputUsdPerM": 5.625, + "inputUsdPerM": 2.5, + "outputUsdPerM": 7.5, "openWeights": false }, { @@ -677,6 +713,24 @@ "outputUsdPerM": 1.6, "openWeights": false }, + { + "id": "qwen/qwen3.8-max", + "name": "Qwen: Qwen3.8 Max", + "inputModalities": [ + "text", + "image", + "video" + ], + "outputModalities": [ + "text" + ], + "maxInputTokens": 1000000, + "capabilities": [], + "providers": 1, + "inputUsdPerM": 2, + "outputUsdPerM": 6, + "openWeights": false + }, { "id": "stepfun/step-3.5-flash", "name": "StepFun: Step 3.5 Flash", @@ -692,8 +746,8 @@ "tools" ], "providers": 3, - "inputUsdPerM": 0.072, - "outputUsdPerM": 0.216, + "inputUsdPerM": 0.1, + "outputUsdPerM": 0.3, "openWeights": true }, { @@ -711,8 +765,8 @@ "structured_outputs" ], "providers": 3, - "inputUsdPerM": 0.15, - "outputUsdPerM": 0.8625, + "inputUsdPerM": 0.185, + "outputUsdPerM": 1.11, "openWeights": true }, { @@ -842,9 +896,9 @@ "reasoning", "tools" ], - "providers": 2, - "inputUsdPerM": 0.3, - "outputUsdPerM": 1.5, + "providers": 3, + "inputUsdPerM": 0.14, + "outputUsdPerM": 0.28, "openWeights": true }, { @@ -862,8 +916,8 @@ "tools" ], "providers": 2, - "inputUsdPerM": 0.75, - "outputUsdPerM": 2.25, + "inputUsdPerM": 0.435, + "outputUsdPerM": 0.87, "openWeights": true }, { @@ -936,8 +990,8 @@ "tools" ], "providers": 8, - "inputUsdPerM": 0.97, - "outputUsdPerM": 3.07, + "inputUsdPerM": 0.979, + "outputUsdPerM": 3.08, "openWeights": true } ] diff --git a/.providers-snapshot.json b/.providers-snapshot.json index b76ca10..9cd55d5 100644 --- a/.providers-snapshot.json +++ b/.providers-snapshot.json @@ -11,7 +11,7 @@ "openai", "responses" ], - "models": 8 + "models": 9 }, { "id": "alibaba_cn", @@ -23,7 +23,7 @@ "openai", "responses" ], - "models": 13 + "models": 15 }, { "id": "alibaba_coding_plan", @@ -43,7 +43,7 @@ "protocols": [ "openai" ], - "models": 4 + "models": 7 }, { "id": "anthropic", @@ -53,7 +53,7 @@ "protocols": [ "anthropic" ], - "models": 8 + "models": 9 }, { "id": "atlascloud", @@ -63,7 +63,7 @@ "protocols": [ "openai" ], - "models": 13 + "models": 15 }, { "id": "aws-bedrock", @@ -74,7 +74,7 @@ "openai", "responses" ], - "models": 17 + "models": 18 }, { "id": "azure", @@ -85,7 +85,7 @@ "openai", "responses" ], - "models": 18 + "models": 20 }, { "id": "bitrouter", @@ -95,7 +95,7 @@ "protocols": [ "openai" ], - "models": 49 + "models": 52 }, { "id": "byteplus", @@ -135,7 +135,7 @@ "protocols": [ "anthropic" ], - "models": 7 + "models": 8 }, { "id": "deepseek", @@ -144,7 +144,8 @@ "billing": "usage_token", "protocols": [ "anthropic", - "openai" + "openai", + "responses" ], "models": 2 }, @@ -156,7 +157,7 @@ "protocols": [ "openai" ], - "models": 17 + "models": 19 }, { "id": "gmicloud", @@ -238,9 +239,11 @@ "headquarters": "US", "billing": "usage_token", "protocols": [ - "openai" + "anthropic", + "openai", + "responses" ], - "models": 15 + "models": 18 }, { "id": "openai", @@ -271,7 +274,7 @@ "protocols": [ "openai" ], - "models": 20 + "models": 23 }, { "id": "opencode-zen", @@ -281,7 +284,7 @@ "protocols": [ "openai" ], - "models": 30 + "models": 32 }, { "id": "openrouter", @@ -293,7 +296,7 @@ "openai", "responses" ], - "models": 51 + "models": 55 }, { "id": "phala", @@ -303,7 +306,7 @@ "protocols": [ "openai" ], - "models": 5 + "models": 6 }, { "id": "qianfan", @@ -313,7 +316,7 @@ "protocols": [ "openai" ], - "models": 8 + "models": 9 }, { "id": "qianfan_cn", @@ -333,7 +336,7 @@ "protocols": [ "openai" ], - "models": 5 + "models": 6 }, { "id": "siliconflow", diff --git a/cli-overlays/harnesses.md b/cli-overlays/harnesses.md index 6006620..7cac38b 100644 --- a/cli-overlays/harnesses.md +++ b/cli-overlays/harnesses.md @@ -18,4 +18,4 @@ Points the harness's API base URL at the local daemon — the same wiring the [I bitrouter spawn -p "summarize the diff" --model @coding ``` -Spawns an ACP-compatible harness as a headless sub-agent, routed through the daemon by default. This is the mechanism behind the [Subagent](/docs/gateway-and-routing/subagent) feature. +Spawns an ACP-compatible harness as a headless sub-agent, routed through the daemon by default. This is the mechanism behind the [Subagent](/docs/mcp-and-tool-calling/subagent) feature. diff --git a/cli-overlays/index.md b/cli-overlays/index.md index 2767373..243a6da 100644 --- a/cli-overlays/index.md +++ b/cli-overlays/index.md @@ -19,11 +19,11 @@ Every command below is **generated from the binary's own `--help`**, so the flag | Variable | Effect | | --- | --- | -| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_ZEN_API_KEY` | Zero-config BYOK — auto-enables the provider. See [BYOK](/docs/gateway-and-routing/bring-your-own-provider) | +| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_ZEN_API_KEY` | Zero-config BYOK — auto-enables the provider. See [BYOK](/docs/models-and-routing/bring-your-own-provider) | | `BITROUTER_API_KEY` | Cloud API key; enables the managed `bitrouter` provider | | `BITROUTER_HOME` | Config discovery override (see above) | | `BITROUTER_OAUTH_AS` | Override the OAuth authorization server for self-hosted Cloud | -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Opt in to OTLP export. See [OpenTelemetry](/docs/observability/opentelemetry) | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Opt in to OTLP export. See [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) | ## Command map diff --git a/cli-overlays/misc.md b/cli-overlays/misc.md index 519de38..630c5d5 100644 --- a/cli-overlays/misc.md +++ b/cli-overlays/misc.md @@ -4,7 +4,7 @@ title: Key, workflow-state, and update ## @key sign -Mints a **virtual key** bound to an access-control policy — the per-key guardrails surface (allowed models, budgets, rate limits), distinct from routing policies. See [Guardrails](/docs/gateway-and-routing/guardrails). +Mints a **virtual key** bound to an access-control policy — the per-key guardrails surface (allowed models, budgets, rate limits), distinct from routing policies. See [Guardrails](/docs/models-and-routing/guardrails). ```bash bitrouter key sign --user ci --policy nightly-cap diff --git a/cli-overlays/policy.md b/cli-overlays/policy.md index d8ca579..084e840 100644 --- a/cli-overlays/policy.md +++ b/cli-overlays/policy.md @@ -5,7 +5,7 @@ title: Policy Routing policies are the artifact the [self-improving loop](/docs/overview/what-is-bitrouter) learns into: `init` scaffolds `policy-lock.yaml` and binds it to a preset, live traffic teaches the adequacy ledger, and `evolve --apply` folds proven downgrades back into the file. The walkthrough, table, and ledger semantics are in [Adaptive routing](/docs/overview/quickstart#adaptive-routing). -`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-virtual-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/gateway-and-routing/guardrails). +`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-virtual-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/models-and-routing/guardrails). ## @policy init diff --git a/cli-overlays/providers.md b/cli-overlays/providers.md index 90d5d23..76f432c 100644 --- a/cli-overlays/providers.md +++ b/cli-overlays/providers.md @@ -2,7 +2,7 @@ title: Providers --- -Two ways a provider becomes available: **BYOK** (its API key in the environment — see [BYOK](/docs/gateway-and-routing/bring-your-own-provider)) and **`providers login`** (OAuth against subscription providers such as Claude or Codex subscriptions — see [Integrations](/docs/integrations)). `providers list` shows the catalog and which providers are active in the current config. +Two ways a provider becomes available: **BYOK** (its API key in the environment — see [BYOK](/docs/models-and-routing/bring-your-own-provider)) and **`providers login`** (OAuth against subscription providers such as Claude or Codex subscriptions — see [Integrations](/docs/integrations)). `providers list` shows the catalog and which providers are active in the current config. ## @providers login diff --git a/cli-overlays/route.md b/cli-overlays/route.md index 466e6a4..33cf0de 100644 --- a/cli-overlays/route.md +++ b/cli-overlays/route.md @@ -22,4 +22,4 @@ bitrouter models --provider anthropic ## @observe status -Reports the OTel exporter's live state — endpoint, sampler, cardinality usage, in-flight spans. The verification step for [OpenTelemetry](/docs/observability/opentelemetry). +Reports the OTel exporter's live state — endpoint, sampler, cardinality usage, in-flight spans. The verification step for [OpenTelemetry](/docs/evals-and-tracing/opentelemetry). diff --git a/cli-overlays/tools.md b/cli-overlays/tools.md index bc49a52..55876c1 100644 --- a/cli-overlays/tools.md +++ b/cli-overlays/tools.md @@ -2,7 +2,7 @@ title: Tools, agents, and ACP --- -The command surfaces behind the [Tools](/docs/gateway-and-routing/mcp-gateway) and [Agents](/docs/gateway-and-routing/acp-gateway) gateways: `tools` introspects the MCP upstreams declared under `mcp_servers`, `agents` manages the ACP agent catalog, and `acp` runs per-session headless agent sessions. +The command surfaces behind the [Tools](/docs/mcp-and-tool-calling/mcp-gateway) and [Agents](/docs/mcp-and-tool-calling/acp-gateway) gateways: `tools` introspects the MCP upstreams declared under `mcp_servers`, `agents` manages the ACP agent catalog, and `acp` runs per-session headless agent sessions. ## @tools discover diff --git a/content/_unpublished/integrations/cline.mdx b/content/_unpublished/integrations/cline.mdx index 0d086ff..5f04119 100644 --- a/content/_unpublished/integrations/cline.mdx +++ b/content/_unpublished/integrations/cline.mdx @@ -42,4 +42,4 @@ Send a message in Cline and confirm a response. BitRouter's `bitrouter-served-by ## Learn more - [Cline — OpenAI-compatible provider](https://docs.cline.bot/provider-config/openai-compatible) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/content/_unpublished/integrations/github-copilot.mdx b/content/_unpublished/integrations/github-copilot.mdx index 1102c6e..762cd8b 100644 --- a/content/_unpublished/integrations/github-copilot.mdx +++ b/content/_unpublished/integrations/github-copilot.mdx @@ -62,4 +62,4 @@ Use any registry id in `provider/model` form — `openai/gpt-4o`, `anthropic/cla - [Copilot CLI — BYOK models](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models) - [VS Code — language models (BYOK)](https://code.visualstudio.com/docs/agent-customization/language-models) -- [Model fallback](/docs/gateway-and-routing/model-fallback) +- [Model fallback](/docs/models-and-routing/model-fallback) diff --git a/content/_unpublished/integrations/kilocode.mdx b/content/_unpublished/integrations/kilocode.mdx index 82f87a4..9521f68 100644 --- a/content/_unpublished/integrations/kilocode.mdx +++ b/content/_unpublished/integrations/kilocode.mdx @@ -42,4 +42,4 @@ Start a task in Kilo Code and confirm a response. BitRouter's `bitrouter-served- ## Learn more - [Kilo Code — OpenAI-compatible providers](https://kilo.ai/docs/ai-providers/openai-compatible) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/content/_unpublished/integrations/lm-studio.mdx b/content/_unpublished/integrations/lm-studio.mdx index bcc004a..db14e72 100644 --- a/content/_unpublished/integrations/lm-studio.mdx +++ b/content/_unpublished/integrations/lm-studio.mdx @@ -46,4 +46,4 @@ Then [start BitRouter and send a request](/docs/integrations/local-models#start- ## Learn more - [LM Studio — OpenAI-compatible API](https://lmstudio.ai/docs/app/api/endpoints/openai) -- [Model fallback](/docs/gateway-and-routing/model-fallback) — fail over from LM Studio to a hosted model. +- [Model fallback](/docs/models-and-routing/model-fallback) — fail over from LM Studio to a hosted model. diff --git a/content/_unpublished/integrations/local-models.mdx b/content/_unpublished/integrations/local-models.mdx index edf8c92..c5a9137 100644 --- a/content/_unpublished/integrations/local-models.mdx +++ b/content/_unpublished/integrations/local-models.mdx @@ -67,7 +67,7 @@ curl http://localhost:4356/v1/chat/completions \ The bare model name (`llama3.1`) also works — BitRouter auto-cascades it to whichever active provider declares it. The provider-qualified `ollama:llama3.1` form pins the request to that exact provider. -**Mix local and hosted.** Declare a [virtual model](/docs/gateway-and-routing/model-fallback) whose endpoints list your local provider first and a hosted one second: requests run on local hardware for free and fail over to the hosted model on error or overload — one model name, automatic failover. +**Mix local and hosted.** Declare a [virtual model](/docs/models-and-routing/model-fallback) whose endpoints list your local provider first and a hosted one second: requests run on local hardware for free and fail over to the hosted model on error or overload — one model name, automatic failover. For the concepts behind this — why front a local server, and the registry-detection alternative — see [Local & private models](/docs/integrations/models). diff --git a/content/_unpublished/integrations/openhands.mdx b/content/_unpublished/integrations/openhands.mdx index c758296..2386736 100644 --- a/content/_unpublished/integrations/openhands.mdx +++ b/content/_unpublished/integrations/openhands.mdx @@ -62,4 +62,4 @@ Run a task in OpenHands and confirm a response. BitRouter's `bitrouter-served-by - [OpenHands — LLM configuration](https://docs.openhands.dev/openhands/usage/llms/openai-llms) - [LiteLLM — OpenAI-compatible endpoints](https://docs.litellm.ai/docs/providers/openai_compatible) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/content/_unpublished/integrations/openrouter.md b/content/_unpublished/integrations/openrouter.md index 45fa873..a4a7522 100644 --- a/content/_unpublished/integrations/openrouter.md +++ b/content/_unpublished/integrations/openrouter.md @@ -46,4 +46,4 @@ Then [start BitRouter and send a request](/docs/integrations/models#start-bitrou ## Learn more - [OpenRouter — API reference](https://openrouter.ai/docs/api-reference/overview) -- [Provider selection](/docs/gateway-and-routing/provider-selection) · [Model fallback](/docs/gateway-and-routing/model-fallback) +- [Provider selection](/docs/models-and-routing/provider-selection) · [Model fallback](/docs/models-and-routing/model-fallback) diff --git a/content/docs/(guide)/observability/evaluation.mdx b/content/docs/(guide)/evals-and-tracing/evaluation.mdx similarity index 89% rename from content/docs/(guide)/observability/evaluation.mdx rename to content/docs/(guide)/evals-and-tracing/evaluation.mdx index 5f52f97..2cb341b 100644 --- a/content/docs/(guide)/observability/evaluation.mdx +++ b/content/docs/(guide)/evals-and-tracing/evaluation.mdx @@ -30,8 +30,8 @@ You don't configure the classifier itself — it runs whenever a policy has adeq Every request is metered into the local database with an estimated charge, so *what did that run cost?* is answerable per request, per model, and per provider — the raw material for cost-objective evaluation. Two ways to read it: -- **Traces** — the settlement span carries cost attributes into your OTLP backend, so cost sits next to latency and outcome on every request. See [OpenTelemetry](/docs/observability/opentelemetry). -- **Hosted** — on BitRouter Cloud, spend, tokens, and the per-request log are hosted for you; content is never stored. See [Tracing](/docs/observability/tracing). +- **Traces** — the settlement span carries cost attributes into your OTLP backend, so cost sits next to latency and outcome on every request. See [OpenTelemetry](/docs/evals-and-tracing/opentelemetry). +- **Hosted** — on BitRouter Cloud, spend, tokens, and the per-request log are hosted for you; content is never stored. See [Tracing](/docs/evals-and-tracing/tracing). ## Traces as the eval substrate @@ -47,6 +47,6 @@ The dedicated eval engine — scoring each *run* and routing decision against a - - + + diff --git a/content/docs/(guide)/observability/meta.json b/content/docs/(guide)/evals-and-tracing/meta.json similarity index 74% rename from content/docs/(guide)/observability/meta.json rename to content/docs/(guide)/evals-and-tracing/meta.json index 07a25b2..24648dc 100644 --- a/content/docs/(guide)/observability/meta.json +++ b/content/docs/(guide)/evals-and-tracing/meta.json @@ -1,5 +1,5 @@ { - "title": "Observability & Evaluation", + "title": "Evals & Tracing", "icon": "Activity", "collapsible": false, "pages": [ diff --git a/content/docs/(guide)/observability/opentelemetry.mdx b/content/docs/(guide)/evals-and-tracing/opentelemetry.mdx similarity index 94% rename from content/docs/(guide)/observability/opentelemetry.mdx rename to content/docs/(guide)/evals-and-tracing/opentelemetry.mdx index 7be71f0..bbf6146 100644 --- a/content/docs/(guide)/observability/opentelemetry.mdx +++ b/content/docs/(guide)/evals-and-tracing/opentelemetry.mdx @@ -5,7 +5,7 @@ description: BitRouter is OpenTelemetry-native — traces and metrics for every BitRouter is **OpenTelemetry-native**. Every request you send through the router becomes a **trace** — the full lifecycle from ingress through routing, each upstream attempt (including failovers), and settlement — plus a set of **metrics**, all following the [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) and pushed over OTLP to any backend you already run. -Everything on this page is **open-source** and runs entirely on your own infrastructure — there's no BitRouter telemetry endpoint in the middle. It's **off until you point it somewhere**, and it excludes message content by default. If you'd rather not run a collector, [Tracing](/docs/observability/tracing) gives you a hosted request view with nothing to operate. +Everything on this page is **open-source** and runs entirely on your own infrastructure — there's no BitRouter telemetry endpoint in the middle. It's **off until you point it somewhere**, and it excludes message content by default. If you'd rather not run a collector, [Tracing](/docs/evals-and-tracing/tracing) gives you a hosted request view with nothing to operate. ## How a trace looks @@ -238,8 +238,8 @@ router and confirm the trace lands in your backend; you should see one inbound ## Next steps - + - - + + diff --git a/content/docs/(guide)/observability/tracing.mdx b/content/docs/(guide)/evals-and-tracing/tracing.mdx similarity index 82% rename from content/docs/(guide)/observability/tracing.mdx rename to content/docs/(guide)/evals-and-tracing/tracing.mdx index ef0c8f0..2b60fe1 100644 --- a/content/docs/(guide)/observability/tracing.mdx +++ b/content/docs/(guide)/evals-and-tracing/tracing.mdx @@ -3,7 +3,7 @@ title: Tracing description: The hosted request view on BitRouter Cloud — spend, tokens, and a per-request log traced server-side, with no collector to run. Receipts, never content. --- -The open-source [OpenTelemetry](/docs/observability/opentelemetry) export runs on your own backend. **BitRouter Cloud** gives you the hosted alternative: every `/v1` request is traced into an **Activity** view server-side — no collector, no warehouse, nothing to run. Content (prompts and responses) is never stored. +The open-source [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) export runs on your own backend. **BitRouter Cloud** gives you the hosted alternative: every `/v1` request is traced into an **Activity** view server-side — no collector, no warehouse, nothing to run. Content (prompts and responses) is never stored. ## The Activity dashboard @@ -49,7 +49,7 @@ These are the same `bitrouter cloud usage` and `bitrouter cloud requests` comman ## Deep traces -Cloud stores per-request **receipts**, not OpenTelemetry span waterfalls. When you need the full span tree — the ingress span, the routing decision, and a `CLIENT` span per upstream attempt — that lives in **your own OTLP collector**. Wire it up once with the open-source [OpenTelemetry](/docs/observability/opentelemetry) export and the Activity view links out to it. +Cloud stores per-request **receipts**, not OpenTelemetry span waterfalls. When you need the full span tree — the ingress span, the routing decision, and a `CLIENT` span per upstream attempt — that lives in **your own OTLP collector**. Wire it up once with the open-source [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) export and the Activity view links out to it. ## Per-namespace usage from the CLI @@ -66,7 +66,7 @@ An agent or CI job using a namespace-scoped credential can only read usage for i ## Next steps - - + + diff --git a/content/docs/(guide)/gateway-and-routing/acp-gateway.mdx b/content/docs/(guide)/mcp-and-tool-calling/acp-gateway.mdx similarity index 100% rename from content/docs/(guide)/gateway-and-routing/acp-gateway.mdx rename to content/docs/(guide)/mcp-and-tool-calling/acp-gateway.mdx diff --git a/content/docs/(guide)/gateway-and-routing/advisor.mdx b/content/docs/(guide)/mcp-and-tool-calling/advisor.mdx similarity index 87% rename from content/docs/(guide)/gateway-and-routing/advisor.mdx rename to content/docs/(guide)/mcp-and-tool-calling/advisor.mdx index 9084659..c1fc856 100644 --- a/content/docs/(guide)/gateway-and-routing/advisor.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/advisor.mdx @@ -69,7 +69,7 @@ When the calling model invokes the tool, it supplies: | `prompt` | A clear, self-contained question for the advisor. | | `model` | Optional per-call override of the advisor model. | -The advisor answers and its advice is returned to the calling model, which then continues the task. Unlike [Sub-agent](/docs/gateway-and-routing/subagent), the advisor doesn't take over the work — it just answers a question. +The advisor answers and its advice is returned to the calling model, which then continues the task. Unlike [Sub-agent](/docs/mcp-and-tool-calling/subagent), the advisor doesn't take over the work — it just answers a question. ## Configuration @@ -91,6 +91,6 @@ Advisor is enabled and managed on **BitRouter Cloud**, with per-run cost for the ## See also -- [Sub-agent](/docs/gateway-and-routing/subagent) — delegate a self-contained task instead of asking a question -- [Fusion](/docs/gateway-and-routing/fusion) — deliberate across a panel of models on one prompt -- [Model variants](/docs/gateway-and-routing/model-variants) — address a stronger variant of a model as the advisor +- [Sub-agent](/docs/mcp-and-tool-calling/subagent) — delegate a self-contained task instead of asking a question +- [Fusion](/docs/mcp-and-tool-calling/fusion) — deliberate across a panel of models on one prompt +- [Model variants](/docs/models-and-routing/model-variants) — address a stronger variant of a model as the advisor diff --git a/content/docs/(guide)/gateway-and-routing/fusion.mdx b/content/docs/(guide)/mcp-and-tool-calling/fusion.mdx similarity index 93% rename from content/docs/(guide)/gateway-and-routing/fusion.mdx rename to content/docs/(guide)/mcp-and-tool-calling/fusion.mdx index 7e724fd..16971b4 100644 --- a/content/docs/(guide)/gateway-and-routing/fusion.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/fusion.mdx @@ -87,6 +87,6 @@ Fusion is enabled and managed on **BitRouter Cloud** — a curated default panel ## See also -- [Sub-agent](/docs/gateway-and-routing/subagent) — delegate a self-contained task to a single worker model -- [Advisor](/docs/gateway-and-routing/advisor) — consult one stronger model mid-task -- [Provider selection](/docs/gateway-and-routing/provider-selection) — control which provider serves each panel model +- [Sub-agent](/docs/mcp-and-tool-calling/subagent) — delegate a self-contained task to a single worker model +- [Advisor](/docs/mcp-and-tool-calling/advisor) — consult one stronger model mid-task +- [Provider selection](/docs/models-and-routing/provider-selection) — control which provider serves each panel model diff --git a/content/docs/(guide)/gateway-and-routing/mcp-gateway.mdx b/content/docs/(guide)/mcp-and-tool-calling/mcp-gateway.mdx similarity index 84% rename from content/docs/(guide)/gateway-and-routing/mcp-gateway.mdx rename to content/docs/(guide)/mcp-and-tool-calling/mcp-gateway.mdx index c10fcf9..c9ec4ff 100644 --- a/content/docs/(guide)/gateway-and-routing/mcp-gateway.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/mcp-gateway.mdx @@ -14,6 +14,10 @@ An agent's callable tools are [MCP](https://modelcontextprotocol.io) servers. Ea BitRouter's **MCP gateway** sits in front of them and proxies them. Your agent connects to one BitRouter endpoint; behind it, the gateway forwards **tool discovery** and **tool calls** to the right upstream host and relays the responses back. One connection, many tool servers — mirroring how BitRouter treats models. + +Not to be confused with the [BitRouter MCP server](/docs/usage/mcp), which points the other way: it exposes BitRouter *itself* as a handful of tools (`complete`, `list_models`, `status`) for an MCP client to call. The gateway here puts BitRouter *in front of* everyone else's MCP servers. + + Routing tools through one gateway buys you three things you'd otherwise rebuild per agent: - **Uniform auth** — the agent authenticates once to BitRouter, instead of carrying credentials for every upstream server. @@ -34,5 +38,5 @@ The second capability an agent acquires is **know-how**. **Agent Skills** are dr ## Learn how to -- [Server tools](/docs/gateway-and-routing/server-tools) — let BitRouter run the tool-calling loop for you, server-side. -- [Toolsets](/docs/gateway-and-routing/server-tools#how-tools-are-bundled-toolsets) — how the tools advertised on a request are bundled and namespaced. +- [Server tools](/docs/mcp-and-tool-calling/server-tools) — let BitRouter run the tool-calling loop for you, server-side. +- [Toolsets](/docs/mcp-and-tool-calling/server-tools#how-tools-are-bundled-toolsets) — how the tools advertised on a request are bundled and namespaced. diff --git a/content/docs/(guide)/mcp-and-tool-calling/meta.json b/content/docs/(guide)/mcp-and-tool-calling/meta.json new file mode 100644 index 0000000..b3fb42e --- /dev/null +++ b/content/docs/(guide)/mcp-and-tool-calling/meta.json @@ -0,0 +1,14 @@ +{ + "title": "MCP & Tool Calling", + "icon": "Wrench", + "collapsible": false, + "pages": [ + "mcp-gateway", + "server-tools", + "advisor", + "subagent", + "fusion", + "websearch", + "web-fetch" + ] +} diff --git a/content/docs/(guide)/gateway-and-routing/server-tools.mdx b/content/docs/(guide)/mcp-and-tool-calling/server-tools.mdx similarity index 81% rename from content/docs/(guide)/gateway-and-routing/server-tools.mdx rename to content/docs/(guide)/mcp-and-tool-calling/server-tools.mdx index 454c3ce..1736d66 100644 --- a/content/docs/(guide)/gateway-and-routing/server-tools.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/server-tools.mdx @@ -32,7 +32,7 @@ You turn server tools on by declaring them in the request's `tools` array — no } ``` -Two more built-ins, [**Web search**](/docs/gateway-and-routing/websearch) and [**Web fetch**](/docs/gateway-and-routing/web-fetch), work the same way — declare `bitrouter:web_search` or `bitrouter:web_fetch` to give the model a search or a BYOK URL reader backed by a key you bring. +Two more built-ins, [**Web search**](/docs/mcp-and-tool-calling/websearch) and [**Web fetch**](/docs/mcp-and-tool-calling/web-fetch), work the same way — declare `bitrouter:web_search` or `bitrouter:web_fetch` to give the model a search or a BYOK URL reader backed by a key you bring. MCP-server tools are wired through configuration instead — set `server_tools.mcp_servers` to the servers whose tools BitRouter should run inside the loop. @@ -40,9 +40,9 @@ MCP-server tools are wired through configuration instead — set `server_tools.m Three of the built-ins wrap a **nested model call** instead of an external side effect. Each gets its own page: -- [**Advisor**](/docs/gateway-and-routing/advisor) — the running model consults a stronger model on one hard sub-question mid-generation, without escalating the whole request. -- [**Sub-agent**](/docs/gateway-and-routing/subagent) — the model delegates a self-contained task to a cheaper, faster worker that runs in isolation and returns only its result. -- [**Fusion**](/docs/gateway-and-routing/fusion) — a panel of models answers in parallel, a judge compares (not merges) their answers, and the calling model writes the final reply from that analysis. +- [**Advisor**](/docs/mcp-and-tool-calling/advisor) — the running model consults a stronger model on one hard sub-question mid-generation, without escalating the whole request. +- [**Sub-agent**](/docs/mcp-and-tool-calling/subagent) — the model delegates a self-contained task to a cheaper, faster worker that runs in isolation and returns only its result. +- [**Fusion**](/docs/mcp-and-tool-calling/fusion) — a panel of models answers in parallel, a judge compares (not merges) their answers, and the calling model writes the final reply from that analysis. Advisor, Sub-agent, and Fusion are each backed by model calls nested inside your request. They cost what their underlying model calls cost, and they appear in your usage history like any other call. diff --git a/content/docs/(guide)/gateway-and-routing/subagent.mdx b/content/docs/(guide)/mcp-and-tool-calling/subagent.mdx similarity index 91% rename from content/docs/(guide)/gateway-and-routing/subagent.mdx rename to content/docs/(guide)/mcp-and-tool-calling/subagent.mdx index d2493cd..16f357f 100644 --- a/content/docs/(guide)/gateway-and-routing/subagent.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/subagent.mdx @@ -91,6 +91,6 @@ Sub-agent is enabled and managed on **BitRouter Cloud**, with per-run cost for t ## See also -- [Advisor](/docs/gateway-and-routing/advisor) — consult a stronger model for guidance instead of delegating a task -- [Fusion](/docs/gateway-and-routing/fusion) — deliberate across a panel of models on one prompt -- [Provider selection](/docs/gateway-and-routing/provider-selection) — control which provider serves the worker model +- [Advisor](/docs/mcp-and-tool-calling/advisor) — consult a stronger model for guidance instead of delegating a task +- [Fusion](/docs/mcp-and-tool-calling/fusion) — deliberate across a panel of models on one prompt +- [Provider selection](/docs/models-and-routing/provider-selection) — control which provider serves the worker model diff --git a/content/docs/(guide)/gateway-and-routing/web-fetch.mdx b/content/docs/(guide)/mcp-and-tool-calling/web-fetch.mdx similarity index 77% rename from content/docs/(guide)/gateway-and-routing/web-fetch.mdx rename to content/docs/(guide)/mcp-and-tool-calling/web-fetch.mdx index 136ca83..84f6480 100644 --- a/content/docs/(guide)/gateway-and-routing/web-fetch.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/web-fetch.mdx @@ -3,9 +3,9 @@ title: Web fetch description: A built-in web_fetch server tool — give any model routed through BitRouter a BYOK URL-content fetcher, served by an extraction backend you bring keys for. --- -`web_fetch` is a built-in [server tool](/docs/gateway-and-routing/server-tools): BitRouter runs the fetch itself, inside the tool-calling loop, and feeds the extracted page back to the model. So **any model routed through BitRouter gains a URL reader** — hand it a link and it gets clean, normalized page content — and the extraction engine behind it is one you bring a key for. +`web_fetch` is a built-in [server tool](/docs/mcp-and-tool-calling/server-tools): BitRouter runs the fetch itself, inside the tool-calling loop, and feeds the extracted page back to the model. So **any model routed through BitRouter gains a URL reader** — hand it a link and it gets clean, normalized page content — and the extraction engine behind it is one you bring a key for. -It's the same family as Advisor, SubAgent, Fusion, and [Web search](/docs/gateway-and-routing/websearch): off by default, enabled in config, and advertised to the model only on requests that declare it. +It's the same family as Advisor, SubAgent, Fusion, and [Web search](/docs/mcp-and-tool-calling/websearch): off by default, enabled in config, and advertised to the model only on requests that declare it. ## How it works @@ -32,7 +32,7 @@ From there the model calls `web_fetch` with a `url`; BitRouter fetches it throug } ``` -`title` and `published` are optional — no engine fills them all, so the contract is additive. The loop bounds (`max_iterations`, `tool_timeout`, …) and approval policy from [server tools](/docs/gateway-and-routing/server-tools#how-the-loop-runs) apply unchanged. +`title` and `published` are optional — no engine fills them all, so the contract is additive. The loop bounds (`max_iterations`, `tool_timeout`, …) and approval policy from [server tools](/docs/mcp-and-tool-calling/server-tools#how-the-loop-runs) apply unchanged. ## Enabling it @@ -77,6 +77,6 @@ Each backend calls the engine's REST API directly and takes an optional `api_key ## Learn more -- [Server tools](/docs/gateway-and-routing/server-tools) — the loop that runs `web_fetch`, plus Advisor, SubAgent, and Fusion. -- [Web search](/docs/gateway-and-routing/websearch) — the sibling built-in that searches instead of fetching. -- [OpenTelemetry](/docs/observability/opentelemetry) — every nested fetch call shows up in your traces like any other. +- [Server tools](/docs/mcp-and-tool-calling/server-tools) — the loop that runs `web_fetch`, plus Advisor, SubAgent, and Fusion. +- [Web search](/docs/mcp-and-tool-calling/websearch) — the sibling built-in that searches instead of fetching. +- [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) — every nested fetch call shows up in your traces like any other. diff --git a/content/docs/(guide)/gateway-and-routing/websearch.mdx b/content/docs/(guide)/mcp-and-tool-calling/websearch.mdx similarity index 81% rename from content/docs/(guide)/gateway-and-routing/websearch.mdx rename to content/docs/(guide)/mcp-and-tool-calling/websearch.mdx index 4a7a2cc..50791c1 100644 --- a/content/docs/(guide)/gateway-and-routing/websearch.mdx +++ b/content/docs/(guide)/mcp-and-tool-calling/websearch.mdx @@ -3,7 +3,7 @@ title: Web search description: A built-in web_search server tool — give any model routed through BitRouter a web search, served by a search backend you bring keys for. --- -`web_search` is a built-in [server tool](/docs/gateway-and-routing/server-tools): BitRouter runs the search itself, inside the tool-calling loop, and feeds the results back to the model. So **any model routed through BitRouter gains a web search** — even one with no native search of its own — and the engine behind it is one you bring a key for. +`web_search` is a built-in [server tool](/docs/mcp-and-tool-calling/server-tools): BitRouter runs the search itself, inside the tool-calling loop, and feeds the results back to the model. So **any model routed through BitRouter gains a web search** — even one with no native search of its own — and the engine behind it is one you bring a key for. It's the same family as Advisor, SubAgent, and Fusion: off by default, enabled in config, and advertised to the model only on requests that declare it. @@ -31,7 +31,7 @@ A caller turns it on for a request by declaring it in the `tools` array: } ``` -Every per-result field except `url` is optional — no engine fills them all, so the contract is additive. `answer` is present only for the answer-engine `native` backend; the REST engines (Parallel, Exa, Firecrawl, Tavily) return `results` and no `answer`. The loop bounds (`max_iterations`, `tool_timeout`, …) and approval policy from [server tools](/docs/gateway-and-routing/server-tools#how-the-loop-runs) apply unchanged. +Every per-result field except `url` is optional — no engine fills them all, so the contract is additive. `answer` is present only for the answer-engine `native` backend; the REST engines (Parallel, Exa, Firecrawl, Tavily) return `results` and no `answer`. The loop bounds (`max_iterations`, `tool_timeout`, …) and approval policy from [server tools](/docs/mcp-and-tool-calling/server-tools#how-the-loop-runs) apply unchanged. ## Enabling it @@ -80,6 +80,6 @@ A caller overrides the default by naming a backend in the declaration's `args.ba ## Learn more -- [Server tools](/docs/gateway-and-routing/server-tools) — the loop that runs `web_search`, plus Advisor, SubAgent, and Fusion. -- [Toolsets](/docs/gateway-and-routing/server-tools#how-tools-are-bundled-toolsets) — how tools advertised on a request are bundled and namespaced. -- [OpenTelemetry](/docs/observability/opentelemetry) — every nested search call shows up in your traces like any other. +- [Server tools](/docs/mcp-and-tool-calling/server-tools) — the loop that runs `web_search`, plus Advisor, SubAgent, and Fusion. +- [Toolsets](/docs/mcp-and-tool-calling/server-tools#how-tools-are-bundled-toolsets) — how tools advertised on a request are bundled and namespaced. +- [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) — every nested search call shows up in your traces like any other. diff --git a/content/docs/(guide)/meta.json b/content/docs/(guide)/meta.json index dcf1d5f..a5ec51f 100644 --- a/content/docs/(guide)/meta.json +++ b/content/docs/(guide)/meta.json @@ -6,7 +6,8 @@ "pages": [ "overview", "usage", - "gateway-and-routing", - "observability" + "models-and-routing", + "mcp-and-tool-calling", + "evals-and-tracing" ] } diff --git a/content/docs/(guide)/gateway-and-routing/bring-your-own-model.mdx b/content/docs/(guide)/models-and-routing/bring-your-own-model.mdx similarity index 84% rename from content/docs/(guide)/gateway-and-routing/bring-your-own-model.mdx rename to content/docs/(guide)/models-and-routing/bring-your-own-model.mdx index fc83a82..1e5a5fa 100644 --- a/content/docs/(guide)/gateway-and-routing/bring-your-own-model.mdx +++ b/content/docs/(guide)/models-and-routing/bring-your-own-model.mdx @@ -5,7 +5,7 @@ description: Put a model you serve yourself — a local runner, a fine-tune, a p Bring your own model means the weights are yours: a model running on your laptop, a fine-tune you serve on your own GPUs, or an inference endpoint inside your own network. BitRouter fronts it as one more provider, so agents address it by id and never learn the difference between your GPU and a hosted API. -This is the mirror image of [bring your own provider](/docs/gateway-and-routing/bring-your-own-provider): there, someone else's model on your account; here, your model on whatever hardware you like. +This is the mirror image of [bring your own provider](/docs/models-and-routing/bring-your-own-provider): there, someone else's model on your account; here, your model on whatever hardware you like. ## The shape: one provider block @@ -76,9 +76,9 @@ The provider-qualified form (`my-cluster:`) pins the request to that exac Once declared, your endpoint is eligible for the rest of the gateway: -- [**Model fallbacks**](/docs/gateway-and-routing/model-fallback) — put your model first in the `models` list and a hosted model after it. Requests run on your hardware and only spill over when it errors or is saturated. -- [**Virtual models**](/docs/gateway-and-routing/virtual-model) — give that pairing a single name. Self-hosted, the `models` section of `bitrouter.yaml` does it with a `priority` strategy over an ordered `endpoints` list; on Cloud, a saved `@name`. -- [**Provider selection**](/docs/gateway-and-routing/provider-selection) and [**model variants**](/docs/gateway-and-routing/model-variants) rank *among* the providers serving a model, so they matter here once your endpoint is one of several serving the same id — a model only your cluster serves has nothing to re-rank. +- [**Model fallbacks**](/docs/models-and-routing/model-fallback) — put your model first in the `models` list and a hosted model after it. Requests run on your hardware and only spill over when it errors or is saturated. +- [**Virtual models**](/docs/models-and-routing/virtual-model) — give that pairing a single name. Self-hosted, the `models` section of `bitrouter.yaml` does it with a `priority` strategy over an ordered `endpoints` list; on Cloud, a saved `@name`. +- [**Provider selection**](/docs/models-and-routing/provider-selection) and [**model variants**](/docs/models-and-routing/model-variants) rank *among* the providers serving a model, so they matter here once your endpoint is one of several serving the same id — a model only your cluster serves has nothing to re-rank. ## Compatibility switches diff --git a/content/docs/(guide)/gateway-and-routing/bring-your-own-provider.mdx b/content/docs/(guide)/models-and-routing/bring-your-own-provider.mdx similarity index 97% rename from content/docs/(guide)/gateway-and-routing/bring-your-own-provider.mdx rename to content/docs/(guide)/models-and-routing/bring-your-own-provider.mdx index e93545f..64000c3 100644 --- a/content/docs/(guide)/gateway-and-routing/bring-your-own-provider.mdx +++ b/content/docs/(guide)/models-and-routing/bring-your-own-provider.mdx @@ -5,7 +5,7 @@ description: Route through your own provider account — pay the provider direct Bring your own provider — **BYOK** (bring your own key) in the API and CLI — routes your requests using your own provider account, not BitRouter's. You pay the provider directly at their list price — BitRouter takes no rev share, adds no per-token fee, and never holds your keys in plaintext. -Where [bring your own model](/docs/gateway-and-routing/bring-your-own-model) is about weights you serve yourself, this page is about *someone else's* model reached on *your* account. +Where [bring your own model](/docs/models-and-routing/bring-your-own-model) is about weights you serve yourself, this page is about *someone else's* model reached on *your* account. BYOK works the same way regardless of deployment: diff --git a/content/docs/(guide)/gateway-and-routing/guardrails.mdx b/content/docs/(guide)/models-and-routing/guardrails.mdx similarity index 100% rename from content/docs/(guide)/gateway-and-routing/guardrails.mdx rename to content/docs/(guide)/models-and-routing/guardrails.mdx diff --git a/content/docs/(guide)/gateway-and-routing/meta.json b/content/docs/(guide)/models-and-routing/meta.json similarity index 63% rename from content/docs/(guide)/gateway-and-routing/meta.json rename to content/docs/(guide)/models-and-routing/meta.json index 5254e50..cdb143e 100644 --- a/content/docs/(guide)/gateway-and-routing/meta.json +++ b/content/docs/(guide)/models-and-routing/meta.json @@ -1,5 +1,5 @@ { - "title": "Gateway & Routing", + "title": "Models & Routing", "icon": "Route", "collapsible": false, "pages": [ @@ -8,6 +8,8 @@ "virtual-model", "model-variants", "bring-your-own-model", - "bring-your-own-provider" + "bring-your-own-provider", + "structured-outputs", + "guardrails" ] } diff --git a/content/docs/(guide)/gateway-and-routing/model-fallback.mdx b/content/docs/(guide)/models-and-routing/model-fallback.mdx similarity index 93% rename from content/docs/(guide)/gateway-and-routing/model-fallback.mdx rename to content/docs/(guide)/models-and-routing/model-fallback.mdx index 7bd21be..2008bbe 100644 --- a/content/docs/(guide)/gateway-and-routing/model-fallback.mdx +++ b/content/docs/(guide)/models-and-routing/model-fallback.mdx @@ -67,7 +67,7 @@ Each fallback attempt is a fresh upstream request. Practical advice: - Lowest expected latency: order by **most reliable first**, accept higher per-token cost. - For long-running agent loops: bias toward reliability. The cost of a stalled loop is much higher than the marginal cost difference between two frontier models. -For declarative cost or latency optimization across providers of a single model, see [Provider Selection](/docs/gateway-and-routing/provider-selection). Fallback and provider selection compose: BitRouter picks the best provider for each model in your `models` array, falling through to the next model only after the chosen provider for the current one has exhausted its retry budget. +For declarative cost or latency optimization across providers of a single model, see [Provider Selection](/docs/models-and-routing/provider-selection). Fallback and provider selection compose: BitRouter picks the best provider for each model in your `models` array, falling through to the next model only after the chosen provider for the current one has exhausted its retry budget. ## Anthropic and Google surfaces diff --git a/content/docs/(guide)/gateway-and-routing/model-variants.mdx b/content/docs/(guide)/models-and-routing/model-variants.mdx similarity index 84% rename from content/docs/(guide)/gateway-and-routing/model-variants.mdx rename to content/docs/(guide)/models-and-routing/model-variants.mdx index c3df680..a25a3db 100644 --- a/content/docs/(guide)/gateway-and-routing/model-variants.mdx +++ b/content/docs/(guide)/models-and-routing/model-variants.mdx @@ -16,7 +16,7 @@ The suffix is part of the `model` string itself, so it needs no body fields and | `openai/gpt-4o:latency` | Lowest p50 time-to-first-token. | | `openai/gpt-4o:throughput` | Highest output tokens/sec. | -These are the same three axes described in [Provider Selection](/docs/gateway-and-routing/provider-selection), exposed as an inline shorthand. A bare model id behaves exactly like `:balanced`. +These are the same three axes described in [Provider Selection](/docs/models-and-routing/provider-selection), exposed as an inline shorthand. A bare model id behaves exactly like `:balanced`. ## Quick example @@ -46,8 +46,8 @@ The suffix behaves identically on `/v1/messages` (Anthropic) and `/v1beta/models The profile affects provider *ranking* only. Everything else keys off the base model id: -- [Guardrail](/docs/gateway-and-routing/guardrails) model allowlists/denylists and BYOK rules judge `anthropic/claude-sonnet-4.6:cost` exactly as `anthropic/claude-sonnet-4.6` — a profile can never widen or bypass a policy. -- [BYOK](/docs/gateway-and-routing/bring-your-own-provider) providers still rank ahead of platform providers; the profile orders providers *within* each tier. +- [Guardrail](/docs/models-and-routing/guardrails) model allowlists/denylists and BYOK rules judge `anthropic/claude-sonnet-4.6:cost` exactly as `anthropic/claude-sonnet-4.6` — a profile can never widen or bypass a policy. +- [BYOK](/docs/models-and-routing/bring-your-own-provider) providers still rank ahead of platform providers; the profile orders providers *within* each tier. - Billing is unchanged — you pay the selected provider's rate for the base model. ## Seeing which profile a request used @@ -56,4 +56,4 @@ The selected profile is recorded on every request and returned in your usage his ## Relationship to `provider.sort` -The model-id suffix is the supported way to choose a routing profile today. A request-body equivalent — `provider.sort` — is described in [Provider Selection](/docs/gateway-and-routing/provider-selection) but is **not yet active**; until it ships, use the suffix. +The model-id suffix is the supported way to choose a routing profile today. A request-body equivalent — `provider.sort` — is described in [Provider Selection](/docs/models-and-routing/provider-selection) but is **not yet active**; until it ships, use the suffix. diff --git a/content/docs/(guide)/gateway-and-routing/provider-selection.mdx b/content/docs/(guide)/models-and-routing/provider-selection.mdx similarity index 85% rename from content/docs/(guide)/gateway-and-routing/provider-selection.mdx rename to content/docs/(guide)/models-and-routing/provider-selection.mdx index 752d195..0cee197 100644 --- a/content/docs/(guide)/gateway-and-routing/provider-selection.mdx +++ b/content/docs/(guide)/models-and-routing/provider-selection.mdx @@ -6,7 +6,7 @@ description: Choose how BitRouter ranks providers when a model is served by more Most models on BitRouter are served by more than one provider. When you request `openai/gpt-4o`, BitRouter has to pick which registered endpoint to send the request to. By default it uses a balanced score; with the `provider.sort` field, you choose the policy explicitly. -**Today, choose a policy with the [`model:` suffix](/docs/gateway-and-routing/model-variants)** — e.g. `openai/gpt-4o:latency`. The `provider.sort` request-body field described on this page is planned and **not yet active**; the suffix is the supported surface. +**Today, choose a policy with the [`model:` suffix](/docs/models-and-routing/model-variants)** — e.g. `openai/gpt-4o:latency`. The `provider.sort` request-body field described on this page is planned and **not yet active**; the suffix is the supported surface. There are three policies. Pick whichever matters most for the request. @@ -37,7 +37,7 @@ The same `provider.sort` field works on `/v1/messages` (Anthropic) and `/v1beta/ ## BYOK providers come first -If you've [added an external key](/docs/gateway-and-routing/bring-your-own-provider) for a provider, BitRouter prefers that provider for any model it can serve — ahead of every non-BYOK provider, regardless of `provider.sort`. Your BYOK key bills against your own account at upstream list price with no rev share, and you opted into that provider explicitly; honoring that opt-in by default is the only choice that doesn't surprise you later. +If you've [added an external key](/docs/models-and-routing/bring-your-own-provider) for a provider, BitRouter prefers that provider for any model it can serve — ahead of every non-BYOK provider, regardless of `provider.sort`. Your BYOK key bills against your own account at upstream list price with no rev share, and you opted into that provider explicitly; honoring that opt-in by default is the only choice that doesn't surprise you later. Within the BYOK-eligible set, the `provider.sort` policy still applies. So `provider.sort: "latency"` plus BYOK keys for OpenAI and Anthropic ranks those two by TTFT first, and falls back to non-BYOK providers (also ranked by latency) only if both BYOK paths fail. @@ -53,7 +53,7 @@ When `provider` is not set, BitRouter ranks by a **balanced score** — a weight ## How selection composes with fallback -[Model fallback](/docs/gateway-and-routing/model-fallback) and provider selection are independent layers: +[Model fallback](/docs/models-and-routing/model-fallback) and provider selection are independent layers: 1. For each model in your `models` list (or the single `model` if no fallback), BitRouter applies your `provider.sort` policy to pick the best provider. 2. If the chosen provider fails in a way that doesn't surface to the caller (rate limit, 5xx), BitRouter retries on the **next-ranked provider of the same model** before falling through to the next model in the list. diff --git a/content/docs/(guide)/gateway-and-routing/structured-outputs.mdx b/content/docs/(guide)/models-and-routing/structured-outputs.mdx similarity index 98% rename from content/docs/(guide)/gateway-and-routing/structured-outputs.mdx rename to content/docs/(guide)/models-and-routing/structured-outputs.mdx index 5ef3f0b..bc56bb3 100644 --- a/content/docs/(guide)/gateway-and-routing/structured-outputs.mdx +++ b/content/docs/(guide)/models-and-routing/structured-outputs.mdx @@ -362,5 +362,5 @@ response_format: { ## See also - [Model discovery](/docs/reference/discovery/listModels) — Check which models support structured outputs -- [Provider selection](/docs/gateway-and-routing/provider-selection) — Route to providers with structured output support +- [Provider selection](/docs/models-and-routing/provider-selection) — Route to providers with structured output support - [API Reference](/docs/reference) — Complete API documentation diff --git a/content/docs/(guide)/gateway-and-routing/virtual-model.mdx b/content/docs/(guide)/models-and-routing/virtual-model.mdx similarity index 88% rename from content/docs/(guide)/gateway-and-routing/virtual-model.mdx rename to content/docs/(guide)/models-and-routing/virtual-model.mdx index f2a2eb1..5f114a7 100644 --- a/content/docs/(guide)/gateway-and-routing/virtual-model.mdx +++ b/content/docs/(guide)/models-and-routing/virtual-model.mdx @@ -3,7 +3,7 @@ title: Virtual Model description: Define a named model of your own — a saved bundle of base model, system prompt, params, and routing rules — and invoke it inline with @name. --- -A **virtual model** is a model that doesn't exist upstream: a name you define once and invoke inline by putting `@` in the `model` field. Where a [model variant](/docs/gateway-and-routing/model-variants) (`:cost`) only re-ranks providers for one request, a virtual model can also **substitute the base model**, **prepend a system prompt**, **set default generation params**, and **restrict which providers are eligible** — all behind a single short token. +A **virtual model** is a model that doesn't exist upstream: a name you define once and invoke inline by putting `@` in the `model` field. Where a [model variant](/docs/models-and-routing/model-variants) (`:cost`) only re-ranks providers for one request, a virtual model can also **substitute the base model**, **prepend a system prompt**, **set default generation params**, and **restrict which providers are eligible** — all behind a single short token. Like a variant, the token lives in the `model` string itself, so it needs no body fields and no SDK — it works the same on the OpenAI, Anthropic, and Google surfaces. A request that uses `@fast` looks exactly like any other request; the virtual model is resolved server-side before routing. @@ -18,7 +18,7 @@ Put `@` where you would normally put a model id. The grammar is `@[/ | `model` value | Resolves to | | --- | --- | | `@fast` | The virtual model `fast`; its saved base model and overrides apply. | -| `@fast:cost` | The virtual model `fast`, with the [`:cost` variant](/docs/gateway-and-routing/model-variants) overriding its own `sort`. | +| `@fast:cost` | The virtual model `fast`, with the [`:cost` variant](/docs/models-and-routing/model-variants) overriding its own `sort`. | | `@fast/openai/gpt-5` | The virtual model `fast`, but routed to `openai/gpt-5` instead of its saved model. | A bare model id with no leading `@` — `anthropic/claude-sonnet-4.6` — is untouched and routes exactly as it does today. Virtual models are purely additive. @@ -32,7 +32,7 @@ Every field is optional. An empty definition is valid (it just resolves to its b | `model` | The base model to route to (e.g. `openai/gpt-5-mini`). If omitted, the request must supply a base inline (`@name/`). | | `system_prompt` | A system prompt applied when the request doesn't already set one. | | `params` | Default generation params (`temperature`, `max_tokens`, `top_p`, …), merged in for keys the request didn't set. | -| `routing.sort` | A default routing profile (`balanced` / `cost` / `latency` / `throughput`) — the same axes as [model variants](/docs/gateway-and-routing/model-variants). | +| `routing.sort` | A default routing profile (`balanced` / `cost` / `latency` / `throughput`) — the same axes as [model variants](/docs/models-and-routing/model-variants). | | `routing.only` | A provider allow-list. Routing is restricted to these `provider_name`s. | | `routing.ignore` | A provider deny-list. These providers are dropped from the chain. | @@ -114,14 +114,14 @@ models: service_id: gpt-4o ``` -Requests for `smart` route to Anthropic first and fall back to OpenAI. This composes with [bring your own model](/docs/gateway-and-routing/bring-your-own-model) — list your own endpoint first and a hosted model second, and you get free local inference with a hosted safety net behind one name. +Requests for `smart` route to Anthropic first and fall back to OpenAI. This composes with [bring your own model](/docs/models-and-routing/bring-your-own-model) — list your own endpoint first and a hosted model second, and you get free local inference with a hosted safety net behind one name. ## Virtual models never change authorization Resolution happens *before* policy enforcement, and a virtual model can only ever **narrow** what a key could already do — never widen it: - Guardrail model allow/deny lists and BYOK rules judge the **resolved base model**, so substituting `openai/gpt-5` is checked exactly as if you had asked for `openai/gpt-5` directly. A virtual model can't smuggle a request past a model denylist. -- `routing.only` / `routing.ignore` can only *remove* providers from the eligible set — they can never add a provider the request wasn't already allowed to reach. [Your own provider keys](/docs/gateway-and-routing/bring-your-own-provider) still rank ahead of platform ones. +- `routing.only` / `routing.ignore` can only *remove* providers from the eligible set — they can never add a provider the request wasn't already allowed to reach. [Your own provider keys](/docs/models-and-routing/bring-your-own-provider) still rank ahead of platform ones. - Billing is unchanged — you pay the selected provider's rate for the resolved base model. ## Errors @@ -137,7 +137,7 @@ Resolution happens *before* policy enforcement, and a virtual model can only eve The two features overlap deliberately — reach for whichever fits: -- A [**model variant**](/docs/gateway-and-routing/model-variants) (`openai/gpt-4o:cost`) is anonymous and zero-setup: it re-ranks providers along one axis for a single request and nothing else. +- A [**model variant**](/docs/models-and-routing/model-variants) (`openai/gpt-4o:cost`) is anonymous and zero-setup: it re-ranks providers along one axis for a single request and nothing else. - A **virtual model** (`@fast`) is named and saved: it captures a base model, a prompt, params, and provider constraints once, so callers invoke a tested configuration by name instead of repeating it. They compose — `@fast:cost` resolves the virtual model and then overrides its routing profile with the inline variant. diff --git a/content/docs/(guide)/overview/bitrouter-vs-litellm.mdx b/content/docs/(guide)/overview/bitrouter-vs-litellm.mdx index 644d74f..322a90f 100644 --- a/content/docs/(guide)/overview/bitrouter-vs-litellm.mdx +++ b/content/docs/(guide)/overview/bitrouter-vs-litellm.mdx @@ -11,7 +11,7 @@ So the useful question isn't which is better. It's whether you want a box with e LiteLLM's bet is coverage: every provider, every gateway feature, in one proxy you configure. It works. Ours is the opposite, because we don't think the interesting problem is feature count — it's that routers don't learn. Every gateway on the market forwards your thousandth call exactly the way it forwarded your first. BitRouter wraps your agent loop in a second one — [act → observe → evaluate → learn](/docs/overview/what-is-bitrouter) — and folds what it observes back into the routing policy. Cheaper paths that still reached the goal get promoted; ones that didn't get escalated back. -"Minimal" here means minimal to *operate*, not minimal in ambition. An MCP gateway, an ACP gateway for sub-agents, KYA identity, and x402 payments are all in the box — but they serve that one loop, and it's still one binary and one `bitrouter.yaml`. Anything we don't ship, you add: the [provider registry](/docs/gateway-and-routing/provider-selection) takes a YAML file and a PR. +"Minimal" here means minimal to *operate*, not minimal in ambition. An MCP gateway, an ACP gateway for sub-agents, KYA identity, and x402 payments are all in the box — but they serve that one loop, and it's still one binary and one `bitrouter.yaml`. Anything we don't ship, you add: the [provider registry](/docs/models-and-routing/provider-selection) takes a YAML file and a PR. @@ -44,5 +44,5 @@ Already running LiteLLM and want to try the other shape? The [migration guide](/ - + diff --git a/content/docs/(guide)/overview/bitrouter-vs-openrouter.mdx b/content/docs/(guide)/overview/bitrouter-vs-openrouter.mdx index 22fb517..37fd0bb 100644 --- a/content/docs/(guide)/overview/bitrouter-vs-openrouter.mdx +++ b/content/docs/(guide)/overview/bitrouter-vs-openrouter.mdx @@ -19,7 +19,7 @@ We're not trying to out-catalog them. BitRouter is a bet that the interesting pr ## When OpenRouter is the better call -**You want everything.** We host roughly 50 models, deliberately — the SOTA tier for agentic and coding work. OpenRouter carries hundreds, including the long tail we don't. You can always [bring your own model](/docs/gateway-and-routing/bring-your-own-model), local or cloud, and we don't charge for it — where OpenRouter takes a cut of BYOK traffic. +**You want everything.** We host roughly 50 models, deliberately — the SOTA tier for agentic and coding work. OpenRouter carries hundreds, including the long tail we don't. You can always [bring your own model](/docs/models-and-routing/bring-your-own-model), local or cloud, and we don't charge for it — where OpenRouter takes a cut of BYOK traffic. **You want free models.** OpenRouter has a free tier on some models; we don't. We're focused on making production agent workflows reliable and cheap, and free tiers come with the rate limits and quantization that production loops can't live with. @@ -30,5 +30,5 @@ We're not trying to out-catalog them. BitRouter is a bet that the interesting pr - + diff --git a/content/docs/(guide)/overview/quickstart.mdx b/content/docs/(guide)/overview/quickstart.mdx index ded6a55..c7a1c32 100644 --- a/content/docs/(guide)/overview/quickstart.mdx +++ b/content/docs/(guide)/overview/quickstart.mdx @@ -85,7 +85,7 @@ npx skills add bitrouter/bitrouter # via the generic skills CLI Then ask your agent: *"Set up BitRouter for me."* — the agent runs the wizard, picks Cloud by default, and verifies the connection autonomously. -The `/bitrouter` skill *drives* BitRouter; the [AgentSkills gateway](/docs/gateway-and-routing/mcp-gateway) is the opposite direction — BitRouter *serving* skills as governed, routable resources to the agents behind it. +The `/bitrouter` skill *drives* BitRouter; the [AgentSkills gateway](/docs/mcp-and-tool-calling/mcp-gateway) is the opposite direction — BitRouter *serving* skills as governed, routable resources to the agents behind it. ## Onboard via the CLI wizard @@ -123,7 +123,7 @@ bitrouter start # Proxy running at http://127.0.0.1:4356 ``` -BitRouter auto-detects any key set in the environment — no config file needed. Any provider whose key is present is immediately available. See [BYOK](/docs/gateway-and-routing/bring-your-own-provider) for the full list of recognized variables, or [local & private models](/docs/integrations/models) to point BitRouter at Ollama, vLLM, or LM Studio for free. +BitRouter auto-detects any key set in the environment — no config file needed. Any provider whose key is present is immediately available. See [BYOK](/docs/models-and-routing/bring-your-own-provider) for the full list of recognized variables, or [local & private models](/docs/integrations/models) to point BitRouter at Ollama, vLLM, or LM Studio for free. For advanced routing rules, guardrails, or multi-account failover, scaffold a config file: @@ -189,7 +189,7 @@ Each request is fingerprinted by loop step (`opening`, `after_`, `midstrea ### Learning from live traffic -With `adequacy` enabled, every request through a policy-bound route is classified by outcome and recorded against its fingerprint — deterministically, with [no LLM judge in the path](/docs/observability/evaluation). Two halves act on that signal: +With `adequacy` enabled, every request through a policy-bound route is classified by outcome and recorded against its fingerprint — deterministically, with [no LLM judge in the path](/docs/evals-and-tracing/evaluation). Two halves act on that signal: - **Escalation (the safety half)** — a downgraded fingerprint that hard-fails `escalation_threshold` consecutive times is pinned up to the strong tier. Pins decay after a cooldown. - **Exploration (the aggressive half)** — with `explore_enabled`, roughly 1-in-`explore_interval` candidate requests is trialed on the economy tier; `explore_threshold` consecutive adequate trials qualify that fingerprint for the cheap tier. A failed trial escalates and stops. @@ -209,7 +209,7 @@ adequacy: The evidence rule is asymmetric: negative evidence escalates immediately, while a cheaper route needs repeated success before it becomes effective. A policy with `adequacy` off behaves exactly like its deterministic table. -The signal itself — the outcome classes it records, the per-request cost metering alongside it, and the objective-scored eval engine landing on top — is [Evaluation](/docs/observability/evaluation). +The signal itself — the outcome classes it records, the per-request cost metering alongside it, and the objective-scored eval engine landing on top — is [Evaluation](/docs/evals-and-tracing/evaluation). ### Publishing what it learns @@ -227,14 +227,14 @@ bitrouter policy lock # forbid programmatic writes again `evolve --apply` only **adds** qualified routes — it never overwrites or removes anything you or Git wrote, and a detected intervening edit aborts the publish instead of clobbering it. Commit the result and the improved table is in Git, where a policy belongs. -`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/gateway-and-routing/guardrails). +`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/models-and-routing/guardrails). ## Next steps - - + + diff --git a/content/docs/(guide)/overview/supported-models.mdx b/content/docs/(guide)/overview/supported-models.mdx index b061dfa..f4190b0 100644 --- a/content/docs/(guide)/overview/supported-models.mdx +++ b/content/docs/(guide)/overview/supported-models.mdx @@ -3,7 +3,7 @@ title: Supported Models description: The full catalog of models any BitRouter account can call — with pricing, reachable over your own keys or one hosted BitRouter Cloud account. --- -Every model BitRouter can route to is listed below. Reach any of them over your own provider keys ([BYOK](/docs/gateway-and-routing/bring-your-own-provider), paid to the providers at their list price) or one [BitRouter Cloud](/docs/overview/quickstart) account — one sign-in, no upstream keys, billed per request with failed requests not charged. Running your own model? See [local & private models](/docs/integrations/models) (free). +Every model BitRouter can route to is listed below. Reach any of them over your own provider keys ([BYOK](/docs/models-and-routing/bring-your-own-provider), paid to the providers at their list price) or one [BitRouter Cloud](/docs/overview/quickstart) account — one sign-in, no upstream keys, billed per request with failed requests not charged. Running your own model? See [local & private models](/docs/integrations/models) (free). Prices are USD per **million tokens** — what a BitRouter Cloud request costs today, from the cheapest provider actually serving that model (`—` means no per-token provider is currently serving it). A provider listed in the [registry](https://github.com/bitrouter/bitrouter/tree/main/registry) but not currently reachable isn't priced here, so bringing your own key to one of them can beat these rates. Every model is served by one or more registered providers — membership lives in the public, open-source [registry](https://github.com/bitrouter/bitrouter/tree/main/registry), and anyone can [register a provider](/docs/guides/register-as-a-provider). @@ -11,7 +11,7 @@ Prices are USD per **million tokens** — what a BitRouter Cloud request costs t On BitRouter a "model" is not a single endpoint. It's an **aggregate**: one logical model — say `openai/gpt-4o` or `anthropic/claude-sonnet-4.6` — that can be served by many providers at once. You address it by the stable **model id** in the catalog below, and BitRouter decides which underlying provider endpoint actually answers each request. That indirection is the point: you write your agent against `anthropic/claude-sonnet-4.6`, and the set of providers behind it can grow, shrink, or re-price without you changing a line of code. -Because a model is an aggregate, requesting one kicks off a [provider selection](/docs/gateway-and-routing/provider-selection) step — BitRouter ranks the eligible providers on a blend of cost, latency, throughput, and uptime, and sends your request to the best one. A transient failure falls through to the next-ranked provider, or to the next model you listed via [fallback](/docs/gateway-and-routing/model-fallback). Append a [variant](/docs/gateway-and-routing/model-variants) suffix — `:cost`, `:latency`, `:throughput` — to re-rank the eligible providers along one axis for a single request; a bare id is the balanced default. +Because a model is an aggregate, requesting one kicks off a [provider selection](/docs/models-and-routing/provider-selection) step — BitRouter ranks the eligible providers on a blend of cost, latency, throughput, and uptime, and sends your request to the best one. A transient failure falls through to the next-ranked provider, or to the next model you listed via [fallback](/docs/models-and-routing/model-fallback). Append a [variant](/docs/models-and-routing/model-variants) suffix — `:cost`, `:latency`, `:throughput` — to re-rank the eligible providers along one axis for a single request; a bare id is the balanced default. ### Four protocols in @@ -33,50 +33,53 @@ Pick the one your SDK is already wired for — you don't adopt a new client. And | `anthropic/claude-opus-4.6` | Anthropic: Claude Opus 4.6 | 200K | text, image | — | $5 | $25 | | `anthropic/claude-opus-4.7` | Anthropic: Claude Opus 4.7 | 200K | text, image | — | $4.5 | $22.5 | | `anthropic/claude-opus-4.8` | Anthropic: Claude Opus 4.8 | 1M | text, image | — | $5 | $25 | +| `anthropic/claude-opus-5` | Anthropic: Claude Opus 5 | 1M | text, image | — | $5 | $25 | | `anthropic/claude-sonnet-4.6` | Anthropic: Claude Sonnet 4.6 | 1M | text, image | — | $3 | $15 | | `anthropic/claude-sonnet-5` | Anthropic: Claude Sonnet 5 | 1M | text, image | — | $2 | $10 | -| `deepseek/deepseek-v3.2` | DeepSeek: DeepSeek V3.2 | 128K | text | ✅ | $0.21 | $0.315 | -| `deepseek/deepseek-v4-flash` | DeepSeek: DeepSeek V4 Flash | 256K | text | ✅ | $0.0983 | $0.1966 | -| `deepseek/deepseek-v4-pro` | DeepSeek: DeepSeek V4 Pro | 256K | text | ✅ | $1.305 | $2.61 | +| `deepseek/deepseek-v3.2` | DeepSeek: DeepSeek V3.2 | 128K | text | ✅ | $0.252 | $0.378 | +| `deepseek/deepseek-v4-flash` | DeepSeek: DeepSeek V4 Flash | 256K | text | ✅ | $0.112 | $0.224 | +| `deepseek/deepseek-v4-flash-0731` | DeepSeek: DeepSeek V4 Flash 0731 | 1M | text | ✅ | $0.14 | $0.28 | +| `deepseek/deepseek-v4-pro` | DeepSeek: DeepSeek V4 Pro | 256K | text | ✅ | $0.435 | $0.87 | | `google/gemini-3.1-flash-lite-preview` | Google: Gemini 3.1 Flash Lite Preview | 1M | text, image | — | $0.25 | $1.5 | | `google/gemini-3.1-pro-preview` | Google: Gemini 3.1 Pro Preview | 2M | text, image | — | $2 | $12 | | `google/gemini-3.5-flash` | Google: Gemini 3.5 Flash | 1M | text, image, audio | — | $1.5 | $9 | | `google/gemma-4-31b` | Google: Gemma 4 31B | 128K | text, image | ✅ | $0.13 | $0.4 | | `meituan/longcat-2.0` | LongCat 2.0 | 1M | text | ✅ | $0.75 | $2.95 | -| `minimax/minimax-m2.5` | MiniMax: M2.5 | 192K | text | ✅ | $0.225 | $0.9 | -| `minimax/minimax-m2.7` | MiniMax: M2.7 | 192K | text | ✅ | $0.225 | $0.9 | +| `minimax/minimax-m2.5` | MiniMax: M2.5 | 192K | text | ✅ | $0.15 | $1.2 | +| `minimax/minimax-m2.7` | MiniMax: M2.7 | 192K | text | ✅ | $0.3 | $1.2 | | `minimax/minimax-m3` | MiniMax: M3 | 1M | text, image | ✅ | $0.3 | $1.2 | | `moonshotai/kimi-k2.5` | Kimi: K2.5 | 256K | text, image | ✅ | $0.44 | $2 | -| `moonshotai/kimi-k2.6` | Kimi: K2.6 | 256K | text | ✅ | $0.7125 | $3 | -| `moonshotai/kimi-k2.7-code` | Kimi: K2.7 Code | 256K | text, image | ✅ | $0.7125 | $3 | +| `moonshotai/kimi-k2.6` | Kimi: K2.6 | 256K | text | ✅ | $0.66 | $3.5 | +| `moonshotai/kimi-k2.7-code` | Kimi: K2.7 Code | 256K | text, image | ✅ | $0.73 | $3.5 | | `moonshotai/kimi-k3` | Kimi: K3 | 1M | text, image | ✅ | $3 | $15 | | `openai/gpt-5.4` | OpenAI: GPT-5.4 | 128K | text, image | — | $2.5 | $15 | | `openai/gpt-5.4-mini` | OpenAI: GPT-5.4 Mini | 128K | text, image | — | $0.75 | $4.5 | | `openai/gpt-5.5` | OpenAI: GPT-5.5 | 128K | text, image | — | $5 | $30 | -| `openai/gpt-5.6-luna` | OpenAI: GPT-5.6 Luna | 400K | text, image | — | $1 | $6 | +| `openai/gpt-5.6-luna` | OpenAI: GPT-5.6 Luna | 400K | text, image | — | $0.2 | $1.2 | | `openai/gpt-5.6-sol` | OpenAI: GPT-5.6 Sol | 1M | text, image | — | $5 | $30 | -| `openai/gpt-5.6-terra` | OpenAI: GPT-5.6 Terra | 1M | text, image | — | $2.5 | $15 | +| `openai/gpt-5.6-terra` | OpenAI: GPT-5.6 Terra | 1M | text, image | — | $2 | $12 | | `qwen/qwen3.5-122b-a10b` | Qwen: Qwen3.5 122B-A10B | 256K | text, image | ✅ | $0.26 | $2.08 | | `qwen/qwen3.5-27b` | Qwen: Qwen3.5 27B | 256K | text, image | ✅ | $0.25 | $2 | | `qwen/qwen3.6-27b` | Qwen: Qwen3.6 27B | 256K | text, image | ✅ | $0.3 | $3.2 | | `qwen/qwen3.6-35b-a3b` | Qwen: Qwen3.6 35B-A3B | 256K | text, image | ✅ | $0.248 | $1.485 | | `qwen/qwen3.6-flash` | Qwen: Qwen3.6 Flash | 1M | text, image | — | $0.1875 | $1.125 | -| `qwen/qwen3.7-max` | Qwen: Qwen3.7 Max | 1M | text | — | $1.875 | $5.625 | +| `qwen/qwen3.7-max` | Qwen: Qwen3.7 Max | 1M | text | — | $2.5 | $7.5 | | `qwen/qwen3.7-plus` | Qwen: Qwen3.7 Plus | 1M | text, image | — | $0.4 | $1.6 | -| `stepfun/step-3.5-flash` | StepFun: Step 3.5 Flash | 256K | text | ✅ | $0.072 | $0.216 | -| `stepfun/step-3.7-flash` | StepFun: Step 3.7 Flash | 256K | text, image | ✅ | $0.15 | $0.8625 | +| `qwen/qwen3.8-max` | Qwen: Qwen3.8 Max | 1M | text, image, video | — | $2 | $6 | +| `stepfun/step-3.5-flash` | StepFun: Step 3.5 Flash | 256K | text | ✅ | $0.1 | $0.3 | +| `stepfun/step-3.7-flash` | StepFun: Step 3.7 Flash | 256K | text, image | ✅ | $0.185 | $1.11 | | `tencent/hy3` | Hunyuan 3 | 256K | text | ✅ | $0.066 | $0.26 | | `x-ai/grok-4.20` | xAI: Grok 4.20 | 128K | text, image | — | $1.25 | $2.5 | | `x-ai/grok-4.20-multi-agent` | xAI: Grok 4.20 Multi-Agent | 1M | text, image | — | $1.25 | $2.5 | | `x-ai/grok-4.3` | xAI: Grok 4.3 | 1M | text, image | — | $1.25 | $2.5 | | `x-ai/grok-4.5` | xAI: Grok 4.5 | 500K | text, image | — | $2 | $6 | | `x-ai/grok-build-0.1` | xAI: Grok Build 0.1 | 256K | text | — | $1 | $2 | -| `xiaomi/mimo-v2.5` | Xiaomi: MiMo V2.5 | 256K | text | ✅ | $0.3 | $1.5 | -| `xiaomi/mimo-v2.5-pro` | Xiaomi: MiMo V2.5 Pro | 256K | text | ✅ | $0.75 | $2.25 | +| `xiaomi/mimo-v2.5` | Xiaomi: MiMo V2.5 | 256K | text | ✅ | $0.14 | $0.28 | +| `xiaomi/mimo-v2.5-pro` | Xiaomi: MiMo V2.5 Pro | 256K | text | ✅ | $0.435 | $0.87 | | `z-ai/glm-4.7` | Zhipu: GLM-4.7 | 200K | text | ✅ | $0.6 | $2.2 | | `z-ai/glm-5` | Zhipu: GLM-5 | 198K | text | ✅ | $0.6 | $1.92 | | `z-ai/glm-5.1` | Zhipu: GLM-5.1 | 128K | text | ✅ | $0.98 | $3.08 | -| `z-ai/glm-5.2` | Zhipu: GLM-5.2 | 1M | text | ✅ | $0.97 | $3.07 | +| `z-ai/glm-5.2` | Zhipu: GLM-5.2 | 1M | text | ✅ | $0.979 | $3.08 | ## Using BitRouter Cloud diff --git a/content/docs/(guide)/overview/what-is-bitrouter.mdx b/content/docs/(guide)/overview/what-is-bitrouter.mdx index 39f9f7c..89a3d56 100644 --- a/content/docs/(guide)/overview/what-is-bitrouter.mdx +++ b/content/docs/(guide)/overview/what-is-bitrouter.mdx @@ -13,9 +13,9 @@ It runs anywhere your agent runs, with no dependencies to install, and operates Our bet is simple: routing is a learning problem. BitRouter wraps your agentic loop in a **second loop**. Each loop gets its own [policy spec](/docs/overview/quickstart#adaptive-routing) — a config file that declares how its calls, tools, and agents should route — and against that spec BitRouter runs a continuous **act → observe → evaluate → learn** cycle. Every step is a component it already ships: -- **Act — the router.** Each model, tool, and agent call is rewritten to a chosen route: policy-table routing, cross-protocol translation, multi-account failover. See [Provider selection](/docs/gateway-and-routing/provider-selection). -- **Observe — telemetry.** Every hop is attributed with cost, tokens, latency, and outcome, exported over OTLP to any backend you run. See [OpenTelemetry](/docs/observability/opentelemetry). -- **Evaluate — the adequacy signal.** Each served request is scored against the route that served it — did the cheaper path still reach the goal? — and every request is cost-metered. Run-level, objective-scored evals are the next milestone. See [Evaluation](/docs/observability/evaluation). +- **Act — the router.** Each model, tool, and agent call is rewritten to a chosen route: policy-table routing, cross-protocol translation, multi-account failover. See [Provider selection](/docs/models-and-routing/provider-selection). +- **Observe — telemetry.** Every hop is attributed with cost, tokens, latency, and outcome, exported over OTLP to any backend you run. See [OpenTelemetry](/docs/evals-and-tracing/opentelemetry). +- **Evaluate — the adequacy signal.** Each served request is scored against the route that served it — did the cheaper path still reach the goal? — and every request is cost-metered. Run-level, objective-scored evals are the next milestone. See [Evaluation](/docs/evals-and-tracing/evaluation). - **Learn — the policy engine.** The observed signal folds back into the policy spec: proven downgrades materialize into the table, failed ones escalate back. The next turn of the loop acts on the improved spec. See [Adaptive routing](/docs/overview/quickstart#adaptive-routing). You choose what the loop optimizes for, and it improves the longer it runs in production. We call this recursive self-improvement applied to infrastructure: the router gets better at routing your loop every time the loop runs. @@ -25,8 +25,8 @@ You choose what the loop optimizes for, and it improves the longer it runs in pr Here's something we noticed early: an agentic loop consumes three things, and most routers govern only one. We built BitRouter to make all three routable, observable, and governed: - **Models** — route LLM calls across providers, accounts, and wire protocols (OpenAI, Anthropic, Google). See [Models](/docs/overview/supported-models#how-model-ids-work). -- **Capabilities** — an **MCP gateway** and an **AgentSkills gateway**: tools and skills become governed, routable resources, not hardcoded endpoints. See [Tools](/docs/gateway-and-routing/mcp-gateway). -- **Agents** — an **ACP gateway**: sub-agents are first-class routable primitives, so a task can go to the sub-agent that best fits the objective — just as a call routes to the best-fit model. See [Agents](/docs/gateway-and-routing/acp-gateway). +- **Capabilities** — an **MCP gateway** and an **AgentSkills gateway**: tools and skills become governed, routable resources, not hardcoded endpoints. See [Tools](/docs/mcp-and-tool-calling/mcp-gateway). +- **Agents** — an **ACP gateway**: sub-agents are first-class routable primitives, so a task can go to the sub-agent that best fits the objective — just as a call routes to the best-fit model. See [Agents](/docs/mcp-and-tool-calling/acp-gateway). Optimizing a loop isn't just model selection — it's the model, the tool, *and* the sub-agent that best serve the loop's objective. @@ -36,4 +36,4 @@ Optimizing a loop isn't just model selection — it's the model, the tool, *and* ## Next steps -BitRouter is a drop-in proxy for any runtime that supports a custom OpenAI or Anthropic base URL. The [Quickstart](/docs/overview/quickstart) gets you routing in under a minute; [Gateway & Routing](/docs/gateway-and-routing/provider-selection) covers models, tools, and agents in depth. Per-runtime recipes (Claude Code, OpenClaw, Codex, and more) live in [Integrations](/docs/integrations), and end-to-end walkthroughs in [Guides](/docs/guides/cloud-api). +BitRouter is a drop-in proxy for any runtime that supports a custom OpenAI or Anthropic base URL. The [Quickstart](/docs/overview/quickstart) gets you routing in under a minute; [Models & Routing](/docs/models-and-routing/provider-selection) and [MCP & Tool Calling](/docs/mcp-and-tool-calling/mcp-gateway) cover models, tools, and agents in depth. Per-runtime recipes (Claude Code, OpenClaw, Codex, and more) live in [Integrations](/docs/integrations), and end-to-end walkthroughs in [Guides](/docs/guides/cloud-api). diff --git a/content/docs/(guide)/usage/cli.mdx b/content/docs/(guide)/usage/cli.mdx index 7f272a1..a83b953 100644 --- a/content/docs/(guide)/usage/cli.mdx +++ b/content/docs/(guide)/usage/cli.mdx @@ -21,11 +21,11 @@ Every command below is **generated from the binary's own `--help`**, so the flag | Variable | Effect | | --- | --- | -| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_ZEN_API_KEY` | Zero-config BYOK — auto-enables the provider. See [BYOK](/docs/gateway-and-routing/bring-your-own-provider) | +| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_ZEN_API_KEY` | Zero-config BYOK — auto-enables the provider. See [BYOK](/docs/models-and-routing/bring-your-own-provider) | | `BITROUTER_API_KEY` | Cloud API key; enables the managed `bitrouter` provider | | `BITROUTER_HOME` | Config discovery override (see above) | | `BITROUTER_OAUTH_AS` | Override the OAuth authorization server for self-hosted Cloud | -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Opt in to OTLP export. See [OpenTelemetry](/docs/observability/opentelemetry) | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Opt in to OTLP export. See [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) | ## Command map @@ -255,11 +255,11 @@ Report the OTel exporter's current state (endpoint, sampler, cardinality usage, | `--socket ` | Explicit control socket path. Overrides the config-derived path | -Reports the OTel exporter's live state — endpoint, sampler, cardinality usage, in-flight spans. The verification step for [OpenTelemetry](/docs/observability/opentelemetry). +Reports the OTel exporter's live state — endpoint, sampler, cardinality usage, in-flight spans. The verification step for [OpenTelemetry](/docs/evals-and-tracing/opentelemetry). ## Providers -Two ways a provider becomes available: **BYOK** (its API key in the environment — see [BYOK](/docs/gateway-and-routing/bring-your-own-provider)) and **`providers login`** (OAuth against subscription providers such as Claude or Codex subscriptions — see [Integrations](/docs/integrations)). `providers list` shows the catalog and which providers are active in the current config. +Two ways a provider becomes available: **BYOK** (its API key in the environment — see [BYOK](/docs/models-and-routing/bring-your-own-provider)) and **`providers login`** (OAuth against subscription providers such as Claude or Codex subscriptions — see [Integrations](/docs/integrations)). `providers list` shows the catalog and which providers are active in the current config. ### `bitrouter providers` @@ -319,7 +319,7 @@ Log out of an upstream provider — clears every stored credential for it. For t Routing policies are the artifact the [self-improving loop](/docs/overview/what-is-bitrouter) learns into: `init` scaffolds `policy-lock.yaml` and binds it to a preset, live traffic teaches the adequacy ledger, and `evolve --apply` folds proven downgrades back into the file. The walkthrough, table, and ledger semantics are in [Adaptive routing](/docs/overview/quickstart#adaptive-routing). -`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-virtual-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/gateway-and-routing/guardrails). +`bitrouter policy create` + `bitrouter key sign` are a **different surface** — per-virtual-key access control (allowed models, budgets, rate limits), not routing. See [Guardrails](/docs/models-and-routing/guardrails). ### `bitrouter policy` @@ -989,7 +989,7 @@ Remove a BYOK row by provider id ## Tools, agents, and ACP -The command surfaces behind the [Tools](/docs/gateway-and-routing/mcp-gateway) and [Agents](/docs/gateway-and-routing/acp-gateway) gateways: `tools` introspects the MCP upstreams declared under `mcp_servers`, `agents` manages the ACP agent catalog, and `acp` runs per-session headless agent sessions. +The command surfaces behind the [Tools](/docs/mcp-and-tool-calling/mcp-gateway) and [Agents](/docs/mcp-and-tool-calling/acp-gateway) gateways: `tools` introspects the MCP upstreams declared under `mcp_servers`, `agents` manages the ACP agent catalog, and `acp` runs per-session headless agent sessions. ### `bitrouter tools` @@ -1380,7 +1380,7 @@ Spawn an ACP-compatible harness as a headless *sub-agent*, routed through the Bi bitrouter spawn -p "summarize the diff" --model @coding ``` -Spawns an ACP-compatible harness as a headless sub-agent, routed through the daemon by default. This is the mechanism behind the [Subagent](/docs/gateway-and-routing/subagent) feature. +Spawns an ACP-compatible harness as a headless sub-agent, routed through the daemon by default. This is the mechanism behind the [Subagent](/docs/mcp-and-tool-calling/subagent) feature. ## Key, workflow-state, and update @@ -1403,7 +1403,7 @@ Mint a new `brvk_` virtual key for a user. v1 does not sign a JWT — it creates | `--policy ` | Optional policy id to bind to the key (the `policy_id` column) | -Mints a **virtual key** bound to an access-control policy — the per-key guardrails surface (allowed models, budgets, rate limits), distinct from routing policies. See [Guardrails](/docs/gateway-and-routing/guardrails). +Mints a **virtual key** bound to an access-control policy — the per-key guardrails surface (allowed models, budgets, rate limits), distinct from routing policies. See [Guardrails](/docs/models-and-routing/guardrails). ```bash bitrouter key sign --user ci --policy nightly-cap diff --git a/content/docs/(guide)/usage/configuration.mdx b/content/docs/(guide)/usage/configuration.mdx index cce37ca..5e80b27 100644 --- a/content/docs/(guide)/usage/configuration.mdx +++ b/content/docs/(guide)/usage/configuration.mdx @@ -81,20 +81,20 @@ Every block is optional and defaults to something sensible. An empty file is val | Block | What it configures | | --- | --- | -| `providers` | Upstream providers and their keys. See [BYOK](/docs/gateway-and-routing/bring-your-own-provider) | -| `presets` | `@name` definitions — model substitution, system prompt, params, routing. See [Virtual models](/docs/gateway-and-routing/virtual-model) | -| `variants` | `:name` definitions — routing modifiers only. See [Model variants](/docs/gateway-and-routing/model-variants) | -| `models` | Named models over an ordered endpoint chain. See [Model fallback](/docs/gateway-and-routing/model-fallback) | +| `providers` | Upstream providers and their keys. See [BYOK](/docs/models-and-routing/bring-your-own-provider) | +| `presets` | `@name` definitions — model substitution, system prompt, params, routing. See [Virtual models](/docs/models-and-routing/virtual-model) | +| `variants` | `:name` definitions — routing modifiers only. See [Model variants](/docs/models-and-routing/model-variants) | +| `models` | Named models over an ordered endpoint chain. See [Model fallback](/docs/models-and-routing/model-fallback) | | `policy_table` | Tiered per-request routing by request shape. See [The policy table](#the-policy-table) | | `policy` | Where the policy lock lives and whether it may self-update. See [The adaptive loop](#the-adaptive-loop) | | `registry` | Public-registry integration and the provider-class priority ladder | | `server` | Listen address and HTTP server settings | | `upstream` | Outbound HTTP client settings (timeouts, retries) | | `database` | Database connection | -| `mcp` | MCP gateway aggregation and caching. See [MCP gateway](/docs/gateway-and-routing/mcp-gateway) | +| `mcp` | MCP gateway aggregation and caching. See [MCP gateway](/docs/mcp-and-tool-calling/mcp-gateway) | | `mcp_servers` | Upstream MCP servers, keyed by id | -| `server_tools` | MCP server ids whose tools BitRouter injects and executes itself. See [Server tools](/docs/gateway-and-routing/server-tools) | -| `agents` | Upstream ACP agents. See [ACP gateway](/docs/gateway-and-routing/acp-gateway) | +| `server_tools` | MCP server ids whose tools BitRouter injects and executes itself. See [Server tools](/docs/mcp-and-tool-calling/server-tools) | +| `agents` | Upstream ACP agents. See [ACP gateway](/docs/mcp-and-tool-calling/acp-gateway) | | `plugins` | Plugin config, keyed by plugin or bundle id | | `worktrees` | Worktree isolation for orchestrator-spawned subagents | | `tui` | Terminal console settings | @@ -134,7 +134,7 @@ A request for `@fast` gets the substituted model and the overrides; `@careful:ch **Presets work self-hosted, not just on Cloud.** The `@name` grammar is often described as a Cloud namespace feature, but the local binary resolves `@name` straight from this `presets:` block. `bitrouter route "@fast"` shows you the resolution without sending a request. -Semantics — precedence, the `@name/base-model` form, what happens on an unknown name — are covered on [Virtual models](/docs/gateway-and-routing/virtual-model) and [Model variants](/docs/gateway-and-routing/model-variants). This page only shows the file. +Semantics — precedence, the `@name/base-model` form, what happens on an unknown name — are covered on [Virtual models](/docs/models-and-routing/virtual-model) and [Model variants](/docs/models-and-routing/model-variants). This page only shows the file. ### The policy table @@ -258,7 +258,7 @@ If you want unset variables to be fatal in a deploy job rather than a PR check, ## See also - [CLI reference](/docs/usage/cli) — `config validate`, `route`, `policy` -- [Virtual models](/docs/gateway-and-routing/virtual-model) and [Model variants](/docs/gateway-and-routing/model-variants) — what `presets:` and `variants:` mean -- [Model fallback](/docs/gateway-and-routing/model-fallback) — what `models:` means -- [BYOK](/docs/gateway-and-routing/bring-your-own-provider) — the `providers:` block +- [Virtual models](/docs/models-and-routing/virtual-model) and [Model variants](/docs/models-and-routing/model-variants) — what `presets:` and `variants:` mean +- [Model fallback](/docs/models-and-routing/model-fallback) — what `models:` means +- [BYOK](/docs/models-and-routing/bring-your-own-provider) — the `providers:` block - [Self-hosting](/docs/guides/self-host) — running the binary you just configured diff --git a/content/docs/(guide)/usage/mcp.mdx b/content/docs/(guide)/usage/mcp.mdx index 06f34bc..b41006f 100644 --- a/content/docs/(guide)/usage/mcp.mdx +++ b/content/docs/(guide)/usage/mcp.mdx @@ -72,6 +72,6 @@ Keep the BitRouter-and-MCP roles distinct: - **The origin server.** BitRouter *is* the tool. A client calls `complete` / `list_models` / `status` to drive the router. - **The docs server.** BitRouter's documentation is the tool. A client calls `search_docs` / `get_doc` / `lookup_model` to read about the router. -- **The [MCP gateway](/docs/gateway-and-routing/mcp-gateway).** BitRouter sits *in front of* your own MCP servers, proxying their tools to agents with auth, access control, and identity forwarding. There BitRouter is the middle, not the endpoint. +- **The [MCP gateway](/docs/mcp-and-tool-calling/mcp-gateway).** BitRouter sits *in front of* your own MCP servers, proxying their tools to agents with auth, access control, and identity forwarding. There BitRouter is the middle, not the endpoint. -The first two are how you reach BitRouter; the gateway is how BitRouter reaches your tools. See [Tools](/docs/gateway-and-routing/mcp-gateway) for the gateway, and [Agent Skills](/docs/usage/skills) for the third way an agent drives BitRouter. +The first two are how you reach BitRouter; the gateway is how BitRouter reaches your tools. See [Tools](/docs/mcp-and-tool-calling/mcp-gateway) for the gateway, and [Agent Skills](/docs/usage/skills) for the third way an agent drives BitRouter. diff --git a/content/docs/(guide)/usage/tui.mdx b/content/docs/(guide)/usage/tui.mdx index 4e29755..3dca9e4 100644 --- a/content/docs/(guide)/usage/tui.mdx +++ b/content/docs/(guide)/usage/tui.mdx @@ -210,4 +210,4 @@ Everything else you'd configure — worktree bootstrap, port pool, verification - [`bitrouter launch`](/docs/usage/cli#bitrouter-launch) — one harness, no console - [`bitrouter spawn`](/docs/usage/cli#bitrouter-spawn) — a headless ACP subagent - [MCP Server](/docs/usage/mcp) — the `fleet` backend the orchestrator drives -- [Subagent](/docs/gateway-and-routing/subagent) — the routing feature underneath +- [Subagent](/docs/mcp-and-tool-calling/subagent) — the routing feature underneath diff --git a/content/docs/guides/build-a-plugin.mdx b/content/docs/guides/build-a-plugin.mdx index 9b7ed53..5d7a7b1 100644 --- a/content/docs/guides/build-a-plugin.mdx +++ b/content/docs/guides/build-a-plugin.mdx @@ -267,7 +267,7 @@ observability) is what ships as a plugin. - - + + diff --git a/content/docs/guides/migrate-from-litellm.mdx b/content/docs/guides/migrate-from-litellm.mdx index 583698c..e0675cd 100644 --- a/content/docs/guides/migrate-from-litellm.mdx +++ b/content/docs/guides/migrate-from-litellm.mdx @@ -31,10 +31,10 @@ This matters when your agent should *pay per request* without you provisioning k LiteLLM has shipped MCP, A2A, Skills, and a CLI alongside its horizontal LLM gateway — virtual keys, team budgets, spend dashboards, and an admin UI all included. BitRouter inverts the emphasis: agent primitives *are* the product, and the team-admin stack is intentionally minimal. What you get on the BitRouter surface: -- [MCP gateway](/docs/gateway-and-routing/mcp-gateway) — proxy MCP servers so agents discover tools across hosts. -- [ACP gateway](/docs/gateway-and-routing/acp-gateway) — first-class support for the Agent Client Protocol used by Claude Code, Codex, OpenCode, and others. -- [Guardrails](/docs/gateway-and-routing/guardrails) — regex rules on the proxy hop that redact or block matching content inline. -- [Cloud Tracing](/docs/observability/tracing) — built-in spend and request tracing, no external collector required. +- [MCP gateway](/docs/mcp-and-tool-calling/mcp-gateway) — proxy MCP servers so agents discover tools across hosts. +- [ACP gateway](/docs/mcp-and-tool-calling/acp-gateway) — first-class support for the Agent Client Protocol used by Claude Code, Codex, OpenCode, and others. +- [Guardrails](/docs/models-and-routing/guardrails) — regex rules on the proxy hop that redact or block matching content inline. +- [Cloud Tracing](/docs/evals-and-tracing/tracing) — built-in spend and request tracing, no external collector required. - Agent Skills gateway (coming soon) — install and route capabilities by skill, not by raw model name. - [Headless CLI](/docs/usage/cli) — TUI wizard plus scriptable commands for setup and ops. - **Agentic auth & payment** — x402 / MPP so an agent can pay per request without you provisioning a key for it. LiteLLM has no equivalent. @@ -78,7 +78,7 @@ response = client.chat.completions.create( -Fallbacks and provider selection that you'd configure with `litellm.Router` move into BitRouter's [virtual models](/docs/gateway-and-routing/virtual-model) and [model fallback rules](/docs/gateway-and-routing/model-fallback) — declared once in [`bitrouter.yaml`](/docs/usage/configuration), not per call site. +Fallbacks and provider selection that you'd configure with `litellm.Router` move into BitRouter's [virtual models](/docs/models-and-routing/virtual-model) and [model fallback rules](/docs/models-and-routing/model-fallback) — declared once in [`bitrouter.yaml`](/docs/usage/configuration), not per call site. ### From the LiteLLM Proxy @@ -115,15 +115,15 @@ To skip the local proxy entirely, point clients at `https://api.bitrouter.ai/v1` | LiteLLM concept | BitRouter equivalent | Docs | |---|---|---| | `model_list` in `config.yaml` | `providers:` + `presets:` in `bitrouter.yaml` | [Configuration](/docs/usage/configuration) | -| `router_settings` (retries, fallback) | Model fallback rules | [Model fallback](/docs/gateway-and-routing/model-fallback) | -| `routing_strategy` (least-busy, latency) | Provider selection | [Provider selection](/docs/gateway-and-routing/provider-selection) | +| `router_settings` (retries, fallback) | Model fallback rules | [Model fallback](/docs/models-and-routing/model-fallback) | +| `routing_strategy` (least-busy, latency) | Provider selection | [Provider selection](/docs/models-and-routing/provider-selection) | | `cache` (Redis/DynamoDB backed) | Not built into the proxy — handle in app/edge if needed | — | -| Virtual keys + budgets + admin UI | Workspace keys (cloud); env-var keys (local) | [BYOK](/docs/gateway-and-routing/bring-your-own-provider) | -| Guardrails / PII / content filter | Agent firewall on the proxy hop | [Guardrails](/docs/gateway-and-routing/guardrails) | -| Callbacks (Langfuse, Datadog, etc.) | Built-in spend + request logs; OTLP export | [OpenTelemetry](/docs/observability/opentelemetry) | -| MCP Gateway | MCP gateway | [MCP](/docs/gateway-and-routing/mcp-gateway) | -| A2A Agent Gateway | ACP gateway | [ACP](/docs/gateway-and-routing/acp-gateway) | -| Skills Gateway / `/skills` endpoint | Skills gateway with [agentskills.io](https://agentskills.io) registry | [Agent Skills](/docs/gateway-and-routing/mcp-gateway) | +| Virtual keys + budgets + admin UI | Workspace keys (cloud); env-var keys (local) | [BYOK](/docs/models-and-routing/bring-your-own-provider) | +| Guardrails / PII / content filter | Agent firewall on the proxy hop | [Guardrails](/docs/models-and-routing/guardrails) | +| Callbacks (Langfuse, Datadog, etc.) | Built-in spend + request logs; OTLP export | [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) | +| MCP Gateway | MCP gateway | [MCP](/docs/mcp-and-tool-calling/mcp-gateway) | +| A2A Agent Gateway | ACP gateway | [ACP](/docs/mcp-and-tool-calling/acp-gateway) | +| Skills Gateway / `/skills` endpoint | Skills gateway with [agentskills.io](https://agentskills.io) registry | [Agent Skills](/docs/mcp-and-tool-calling/mcp-gateway) | | LiteLLM Proxy CLI | `bitrouter` CLI / TUI | [Headless CLI](/docs/usage/cli) | | — (no equivalent) | Autonomous agent payment (x402 / MPP) | x402 / MPP | @@ -131,7 +131,7 @@ To skip the local proxy entirely, point clients at `https://api.bitrouter.ai/v1` To set expectations honestly, two gaps are worth checking before you start. -**Non-chat endpoints.** LiteLLM covers embeddings, rerank, audio, and image endpoints across 100+ providers out of the box. BitRouter ships deep support for SOTA-tier chat models and extends by PR to the [provider registry](/docs/gateway-and-routing/provider-selection). If your workload leans on embeddings or rerank today, either add them to the registry first or keep those calls on LiteLLM. +**Non-chat endpoints.** LiteLLM covers embeddings, rerank, audio, and image endpoints across 100+ providers out of the box. BitRouter ships deep support for SOTA-tier chat models and extends by PR to the [provider registry](/docs/models-and-routing/provider-selection). If your workload leans on embeddings or rerank today, either add them to the registry first or keep those calls on LiteLLM. **Team administration.** BitRouter does not ship a built-in admin UI for team/user budgets, virtual-key generation by API, or a spend analytics dashboard at parity with LiteLLM Enterprise. Per-workspace key scoping in cloud mode and env-var-scoped keys in local mode cover the common cases, but if your migration depends on per-user virtual keys with quotas enforced inside the proxy, plan for that gap or stay on LiteLLM for those workloads. @@ -140,7 +140,7 @@ To set expectations honestly, two gaps are worth checking before you start. **Before migration** - [ ] List the providers and models you actually use (skip the rest) -- [ ] Note any custom callbacks/middleware — see if a [guardrail rule](/docs/gateway-and-routing/guardrails) covers it +- [ ] Note any custom callbacks/middleware — see if a [guardrail rule](/docs/models-and-routing/guardrails) covers it - [ ] Decide cloud vs. local (or both — they share the endpoint) @@ -158,7 +158,7 @@ To set expectations honestly, two gaps are worth checking before you start. - + diff --git a/content/docs/guides/migrate-from-openrouter.mdx b/content/docs/guides/migrate-from-openrouter.mdx index e7df29a..e322e36 100644 --- a/content/docs/guides/migrate-from-openrouter.mdx +++ b/content/docs/guides/migrate-from-openrouter.mdx @@ -105,7 +105,7 @@ If your OpenRouter integration sets any of these headers, you can safely drop th - + diff --git a/content/docs/guides/migrate-from-tensorzero.mdx b/content/docs/guides/migrate-from-tensorzero.mdx index 81c998c..3cbcaf0 100644 --- a/content/docs/guides/migrate-from-tensorzero.mdx +++ b/content/docs/guides/migrate-from-tensorzero.mdx @@ -28,13 +28,13 @@ This guide is for teams who adopted TensorZero mainly as a **gateway** — unifi TensorZero is built around a feedback loop: route inference, store every call and its metrics in ClickHouse, then evaluate, fine-tune, and A/B test against that history. That's powerful if you run that loop — and it's why TensorZero needs a database and a typed config of functions and variants. -BitRouter deliberately stops at the gateway. There's no ClickHouse to operate — [OpenTelemetry](/docs/observability/opentelemetry) gives you spans and metrics for every request (the same OTLP export TensorZero offers), but they go to a backend you already run, not a warehouse the proxy manages. +BitRouter deliberately stops at the gateway. There's no ClickHouse to operate — [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) gives you spans and metrics for every request (the same OTLP export TensorZero offers), but they go to a backend you already run, not a warehouse the proxy manages. Configuration is the other difference, and it's one of degree rather than kind. BitRouter is also configured as code — [`bitrouter.yaml`](/docs/usage/configuration) holds providers, routing policy, and gateways, with a published JSON Schema and a `validate` command for CI. What it doesn't ask you to declare is the *shape of your application*: there are no functions to define and no variants to enumerate before you can route a request. You can run on provider keys alone and add config only where you want policy under review. ### 2. Agent-native, and cloud/local share one surface -TensorZero's gateway is provider-facing — it unifies the upstreams. BitRouter adds the **agent-facing** half: an [MCP gateway](/docs/gateway-and-routing/mcp-gateway) for tools, an [ACP gateway](/docs/gateway-and-routing/acp-gateway) for agent identity and dispatch, a [server-tool loop](/docs/gateway-and-routing/server-tools), and agentic payment so an agent can pay per request without you provisioning a key for it. +TensorZero's gateway is provider-facing — it unifies the upstreams. BitRouter adds the **agent-facing** half: an [MCP gateway](/docs/mcp-and-tool-calling/mcp-gateway) for tools, an [ACP gateway](/docs/mcp-and-tool-calling/acp-gateway) for agent identity and dispatch, a [server-tool loop](/docs/mcp-and-tool-calling/server-tools), and agentic payment so an agent can pay per request without you provisioning a key for it. And **the hosted cloud and local binary expose the same OpenAI-compatible endpoint** — start local during development, point at `api.bitrouter.ai` for production (or vice versa) without changing client code. See the [Quick Start](/docs/overview/quickstart) for both flows. @@ -80,7 +80,7 @@ response = client.chat.completions.create( -A TensorZero **function** (a named prompt template + schema with one or more variants) has no single equivalent — the routing half maps to BitRouter, the templating/variant half stays in your app or moves to a [preset](/docs/gateway-and-routing/virtual-model). See the [feature mapping](#feature-mapping) below. +A TensorZero **function** (a named prompt template + schema with one or more variants) has no single equivalent — the routing half maps to BitRouter, the templating/variant half stays in your app or moves to a [preset](/docs/models-and-routing/virtual-model). See the [feature mapping](#feature-mapping) below. ### From the gateway + ClickHouse stack @@ -117,17 +117,17 @@ To skip the local proxy entirely, point clients at `https://api.bitrouter.ai/v1` | TensorZero concept | BitRouter equivalent | Docs | |---|---|---| -| `[models.*]` + `[models.*.providers.*]` in `tensorzero.toml` | Provider keys (auto-detected) + the model registry | [BYOK](/docs/gateway-and-routing/bring-your-own-provider), [Models](/docs/overview/supported-models#how-model-ids-work) | -| `[functions.*]` (named prompt + schema) | App-side, or a routing [preset](/docs/gateway-and-routing/virtual-model) | [Virtual models](/docs/gateway-and-routing/virtual-model) | -| `[functions.*.variants.*]` (per-variant model) | Routing preset variants / model ids | [Virtual models](/docs/gateway-and-routing/virtual-model) | -| `routing` / `retries` / `fallbacks` | Model fallback rules | [Model fallback](/docs/gateway-and-routing/model-fallback) | -| `load_balancing` across providers | Provider selection | [Provider selection](/docs/gateway-and-routing/provider-selection) | +| `[models.*]` + `[models.*.providers.*]` in `tensorzero.toml` | Provider keys (auto-detected) + the model registry | [BYOK](/docs/models-and-routing/bring-your-own-provider), [Models](/docs/overview/supported-models#how-model-ids-work) | +| `[functions.*]` (named prompt + schema) | App-side, or a routing [preset](/docs/models-and-routing/virtual-model) | [Virtual models](/docs/models-and-routing/virtual-model) | +| `[functions.*.variants.*]` (per-variant model) | Routing preset variants / model ids | [Virtual models](/docs/models-and-routing/virtual-model) | +| `routing` / `retries` / `fallbacks` | Model fallback rules | [Model fallback](/docs/models-and-routing/model-fallback) | +| `load_balancing` across providers | Provider selection | [Provider selection](/docs/models-and-routing/provider-selection) | | OpenAI-compatible `/openai/v1` endpoint | OpenAI-compatible `/v1` endpoint | [API Reference](/docs/reference/openai-compatible/createChatCompletion) | | Native `POST /inference` endpoint | OpenAI-, Anthropic-, and Google-compatible protocols | [API Reference](/docs/reference) | -| ClickHouse observability + UI | OTLP traces & metrics to your own backend, or hosted Activity on Cloud | [OpenTelemetry](/docs/observability/opentelemetry), [Cloud Tracing](/docs/observability/tracing) | -| OpenTelemetry (OTLP) export | OpenTelemetry (OTLP) export | [OpenTelemetry](/docs/observability/opentelemetry) | -| Embedded structured outputs (JSON functions) | Structured outputs across all providers | [Structured outputs](/docs/gateway-and-routing/structured-outputs) | -| — (no equivalent) | MCP / ACP / Skills agent gateways | [Tools](/docs/gateway-and-routing/mcp-gateway), [Agents](/docs/gateway-and-routing/acp-gateway) | +| ClickHouse observability + UI | OTLP traces & metrics to your own backend, or hosted Activity on Cloud | [OpenTelemetry](/docs/evals-and-tracing/opentelemetry), [Cloud Tracing](/docs/evals-and-tracing/tracing) | +| OpenTelemetry (OTLP) export | OpenTelemetry (OTLP) export | [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) | +| Embedded structured outputs (JSON functions) | Structured outputs across all providers | [Structured outputs](/docs/models-and-routing/structured-outputs) | +| — (no equivalent) | MCP / ACP / Skills agent gateways | [Tools](/docs/mcp-and-tool-calling/mcp-gateway), [Agents](/docs/mcp-and-tool-calling/acp-gateway) | | — (no equivalent) | Autonomous agent payment (x402 / MPP) | x402 / MPP | ## What BitRouter intentionally doesn't ship @@ -142,7 +142,7 @@ If your workflow depends on that closed feedback loop — collect inferences and **Before migration** - [ ] List the providers and models you actually route through TensorZero (skip the rest) - [ ] Separate gateway use from platform use — are you using evals / optimization / experimentation, or just routing? -- [ ] Note where `[functions.*]` templates and schemas live; plan to keep them app-side or move them to a [preset](/docs/gateway-and-routing/virtual-model) +- [ ] Note where `[functions.*]` templates and schemas live; plan to keep them app-side or move them to a [preset](/docs/models-and-routing/virtual-model) - [ ] Decide cloud vs. local (or both — they share the endpoint) @@ -152,7 +152,7 @@ If your workflow depends on that closed feedback loop — collect inferences and - [ ] Export provider keys, or paste them into the cloud dashboard (sealed-box encrypted) - [ ] Update client `base_url` to `http://127.0.0.1:4356/v1` (local) or `https://api.bitrouter.ai/v1` (cloud) - [ ] Replace `tensorzero::…` model strings with `provider/model` ids -- [ ] Re-point OTLP export at your backend ([OpenTelemetry](/docs/observability/opentelemetry)) +- [ ] Re-point OTLP export at your backend ([OpenTelemetry](/docs/evals-and-tracing/opentelemetry)) - [ ] Verify with a sample request - [ ] Decommission the gateway container and ClickHouse if you no longer need the platform loop @@ -162,7 +162,7 @@ If your workflow depends on that closed feedback loop — collect inferences and - + diff --git a/content/docs/guides/self-host.mdx b/content/docs/guides/self-host.mdx index 7916e6f..9eccbeb 100644 --- a/content/docs/guides/self-host.mdx +++ b/content/docs/guides/self-host.mdx @@ -188,7 +188,7 @@ name resolves before it ever hits an upstream: bitrouter route gpt-4o # print the full fallback chain for a model ``` -See [OpenTelemetry](/docs/observability/opentelemetry) for the span model, +See [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) for the span model, per-request attribution, and per-backend export configs. ## 5. Basic hardening @@ -200,7 +200,7 @@ per-request attribution, and per-backend export configs. committed `bitrouter.yaml`; the config redacts `api_key` in debug output. - **Validate in CI.** Run `bitrouter config validate -c bitrouter.yaml` on every change, and pin the `# yaml-language-server` schema URL to your version. -- **Add a content firewall** with [Guardrails](/docs/gateway-and-routing/guardrails) to +- **Add a content firewall** with [Guardrails](/docs/models-and-routing/guardrails) to block or redact request/response content. - **Reload, don't restart, for config changes** so in-flight requests aren't dropped. @@ -210,6 +210,6 @@ per-request attribution, and per-backend export configs. - - + + diff --git a/content/docs/integrations/claude-code.mdx b/content/docs/integrations/claude-code.mdx index 9adbabc..29c973b 100644 --- a/content/docs/integrations/claude-code.mdx +++ b/content/docs/integrations/claude-code.mdx @@ -54,5 +54,5 @@ Launch `claude`, ask it anything, and confirm the response. To see which provide ## Learn more - [Claude Code — LLM gateway config](https://code.claude.com/docs/en/llm-gateway) -- [Model fallback](/docs/gateway-and-routing/model-fallback) — pass an ordered model list and walk it on failure. -- [OpenTelemetry](/docs/observability/opentelemetry) — trace every Claude Code request. +- [Model fallback](/docs/models-and-routing/model-fallback) — pass an ordered model list and walk it on failure. +- [OpenTelemetry](/docs/evals-and-tracing/opentelemetry) — trace every Claude Code request. diff --git a/content/docs/integrations/claude-subscription.mdx b/content/docs/integrations/claude-subscription.mdx index 66f08af..e162d0e 100644 --- a/content/docs/integrations/claude-subscription.mdx +++ b/content/docs/integrations/claude-subscription.mdx @@ -87,4 +87,4 @@ Genuine Claude Code traffic — recognised by its `anthropic-beta: claude-code-* - [Claude Code](/docs/integrations/claude-code) — point the Claude Code CLI at BitRouter (a harness), distinct from using your plan as a model source above. - [Models](/docs/overview/supported-models#how-model-ids-work) — the full `provider/model` id scheme. -- [Model fallback](/docs/gateway-and-routing/model-fallback) — fail over from your subscription to a hosted model on overload. +- [Model fallback](/docs/models-and-routing/model-fallback) — fail over from your subscription to a hosted model on overload. diff --git a/content/docs/integrations/codex-subscription.mdx b/content/docs/integrations/codex-subscription.mdx index e2b4c6a..abe4a98 100644 --- a/content/docs/integrations/codex-subscription.mdx +++ b/content/docs/integrations/codex-subscription.mdx @@ -60,4 +60,4 @@ Then [start BitRouter and send a request](/docs/integrations/models#start-bitrou ## Learn more - [Codex](/docs/integrations/codex) — point the Codex *CLI* at BitRouter (a harness), distinct from using your plan as a model source here. -- [Model fallback](/docs/gateway-and-routing/model-fallback) — fail over from your subscription to another source on overload. +- [Model fallback](/docs/models-and-routing/model-fallback) — fail over from your subscription to another source on overload. diff --git a/content/docs/integrations/codex.mdx b/content/docs/integrations/codex.mdx index e67cc69..fa1cdc1 100644 --- a/content/docs/integrations/codex.mdx +++ b/content/docs/integrations/codex.mdx @@ -77,4 +77,4 @@ Run `codex` and issue a prompt; check BitRouter's `request finished` log line (` ## Learn more - [Codex — configuration reference](https://developers.openai.com/codex/config-reference) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/content/docs/integrations/harnesses.mdx b/content/docs/integrations/harnesses.mdx index 1f85983..ca674f8 100644 --- a/content/docs/integrations/harnesses.mdx +++ b/content/docs/integrations/harnesses.mdx @@ -3,7 +3,7 @@ title: Overview description: Point a coding agent or runtime at BitRouter — Claude Code, Codex, OpenCode, Hermes, OpenClaw, Pi — and run it on any model in the registry. --- -A **harness** is the agent runtime that drives the loop — the CLI or service that reads your prompt, calls tools, and edits files. Each one already speaks some model API; the move is always the same: point it at BitRouter's endpoint (local proxy at `http://127.0.0.1:4356`, or Cloud at `https://api.bitrouter.ai`) instead of the vendor's, and address models by their `provider/model` id. From there the same harness can run on Anthropic, OpenAI, Google, or an open model — with [provider selection](/docs/gateway-and-routing/provider-selection) and [fallback](/docs/gateway-and-routing/model-fallback) underneath. +A **harness** is the agent runtime that drives the loop — the CLI or service that reads your prompt, calls tools, and edits files. Each one already speaks some model API; the move is always the same: point it at BitRouter's endpoint (local proxy at `http://127.0.0.1:4356`, or Cloud at `https://api.bitrouter.ai`) instead of the vendor's, and address models by their `provider/model` id. From there the same harness can run on Anthropic, OpenAI, Google, or an open model — with [provider selection](/docs/models-and-routing/provider-selection) and [fallback](/docs/models-and-routing/model-fallback) underneath. diff --git a/content/docs/integrations/hermes.mdx b/content/docs/integrations/hermes.mdx index 878ebf4..c6ffee2 100644 --- a/content/docs/integrations/hermes.mdx +++ b/content/docs/integrations/hermes.mdx @@ -43,4 +43,4 @@ The `model` field takes any registry id in `provider/model` form, optionally wit ## Learn more - [Hermes — configuration](https://github.com/NousResearch/hermes-agent/blob/main/website/docs/user-guide/configuration.md) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/content/docs/integrations/index.mdx b/content/docs/integrations/index.mdx index c96f2e7..4a1d3b6 100644 --- a/content/docs/integrations/index.mdx +++ b/content/docs/integrations/index.mdx @@ -3,7 +3,7 @@ title: Integrations description: Plug models and agent harnesses into BitRouter. --- -Every integration is the same move: point something at BitRouter's endpoint (local proxy at `http://127.0.0.1:4356`, or Cloud at `https://api.bitrouter.ai`) and address models by their `provider/model` id. From there you get the whole [registry](/docs/overview/supported-models#how-model-ids-work), provider selection, and [fallback](/docs/gateway-and-routing/model-fallback) underneath. New to BitRouter? Start with the [Quick Start](/docs/overview/quickstart). +Every integration is the same move: point something at BitRouter's endpoint (local proxy at `http://127.0.0.1:4356`, or Cloud at `https://api.bitrouter.ai`) and address models by their `provider/model` id. From there you get the whole [registry](/docs/overview/supported-models#how-model-ids-work), provider selection, and [fallback](/docs/models-and-routing/model-fallback) underneath. New to BitRouter? Start with the [Quick Start](/docs/overview/quickstart). Integrations come in two kinds: diff --git a/content/docs/integrations/models.mdx b/content/docs/integrations/models.mdx index ef5b313..350fe75 100644 --- a/content/docs/integrations/models.mdx +++ b/content/docs/integrations/models.mdx @@ -78,7 +78,7 @@ curl http://localhost:4356/v1/chat/completions \ The bare model name also works — BitRouter auto-cascades it to whichever active source declares it. The provider-qualified form (`openrouter:openai/gpt-4o`) pins the request to that exact source. -**Mix sources freely.** Declare a [virtual model](/docs/gateway-and-routing/virtual-model) whose endpoints list a local source first and a hosted one second: requests run on your own hardware for free and fail over to the hosted model on error or overload — one model name, automatic failover. +**Mix sources freely.** Declare a [virtual model](/docs/models-and-routing/virtual-model) whose endpoints list a local source first and a hosted one second: requests run on your own hardware for free and fail over to the hosted model on error or overload — one model name, automatic failover. -For the concepts behind this — provider selection, fallback, and registry detection — see [Models](/docs/overview/supported-models#how-model-ids-work). To serve models yourself, see the local-server integrations — [Ollama](/docs/integrations/ollama), [vLLM](/docs/integrations/vllm), and [Unsloth](/docs/integrations/unsloth) — or [bring your own model](/docs/gateway-and-routing/bring-your-own-model) for the general shape. +For the concepts behind this — provider selection, fallback, and registry detection — see [Models](/docs/overview/supported-models#how-model-ids-work). To serve models yourself, see the local-server integrations — [Ollama](/docs/integrations/ollama), [vLLM](/docs/integrations/vllm), and [Unsloth](/docs/integrations/unsloth) — or [bring your own model](/docs/models-and-routing/bring-your-own-model) for the general shape. diff --git a/content/docs/integrations/ollama.mdx b/content/docs/integrations/ollama.mdx index 3dca588..650e18d 100644 --- a/content/docs/integrations/ollama.mdx +++ b/content/docs/integrations/ollama.mdx @@ -45,4 +45,4 @@ Then [start BitRouter and send a request](/docs/integrations/models#start-bitrou ## Learn more - [Ollama — OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility) -- [Model fallback](/docs/gateway-and-routing/model-fallback) — fail over from local Ollama to a hosted model. +- [Model fallback](/docs/models-and-routing/model-fallback) — fail over from local Ollama to a hosted model. diff --git a/content/docs/integrations/openclaw.mdx b/content/docs/integrations/openclaw.mdx index 5167147..970832a 100644 --- a/content/docs/integrations/openclaw.mdx +++ b/content/docs/integrations/openclaw.mdx @@ -51,4 +51,4 @@ Each provider model `id` is a registry id in `provider/model` form (`openai/gpt- ## Learn more - [OpenClaw — model providers](https://docs.openclaw.ai/concepts/model-providers) -- [Model fallback](/docs/gateway-and-routing/model-fallback) +- [Model fallback](/docs/models-and-routing/model-fallback) diff --git a/content/docs/integrations/opencode.mdx b/content/docs/integrations/opencode.mdx index b6747fb..eb69ecf 100644 --- a/content/docs/integrations/opencode.mdx +++ b/content/docs/integrations/opencode.mdx @@ -54,4 +54,4 @@ Each key under `models` is a registry id in `provider/model` form, optionally wi ## Learn more - [OpenCode — providers](https://opencode.ai/docs/providers/) · [config](https://opencode.ai/docs/config/) -- [Model fallback](/docs/gateway-and-routing/model-fallback) +- [Model fallback](/docs/models-and-routing/model-fallback) diff --git a/content/docs/integrations/pi.mdx b/content/docs/integrations/pi.mdx index df21581..fb75501 100644 --- a/content/docs/integrations/pi.mdx +++ b/content/docs/integrations/pi.mdx @@ -47,4 +47,4 @@ Each `models[].id` is a registry id in `provider/model` form, optionally with a ## Learn more - [Pi — custom providers](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md) -- [Model fallback](/docs/gateway-and-routing/model-fallback) +- [Model fallback](/docs/models-and-routing/model-fallback) diff --git a/content/docs/integrations/unsloth.mdx b/content/docs/integrations/unsloth.mdx index a37bad1..2fe53a4 100644 --- a/content/docs/integrations/unsloth.mdx +++ b/content/docs/integrations/unsloth.mdx @@ -68,5 +68,5 @@ Then [start BitRouter and send a request](/docs/integrations/models#start-bitrou - [Unsloth — API endpoint guide](https://unsloth.ai/docs/basics/api) - [Unsloth — llama-server & OpenAI endpoint](https://unsloth.ai/docs/basics/inference-and-deployment/llama-server-and-openai-endpoint) -- [Bring your own model](/docs/gateway-and-routing/bring-your-own-model) — the general shape, for any endpoint you serve. -- [Model fallback](/docs/gateway-and-routing/model-fallback) — fail over from your own machine to a hosted model. +- [Bring your own model](/docs/models-and-routing/bring-your-own-model) — the general shape, for any endpoint you serve. +- [Model fallback](/docs/models-and-routing/model-fallback) — fail over from your own machine to a hosted model. diff --git a/content/docs/integrations/vllm.mdx b/content/docs/integrations/vllm.mdx index f9327d7..f1f5a0a 100644 --- a/content/docs/integrations/vllm.mdx +++ b/content/docs/integrations/vllm.mdx @@ -44,4 +44,4 @@ Then [start BitRouter and send a request](/docs/integrations/models#start-bitrou ## Learn more - [vLLM — OpenAI-compatible server](https://docs.vllm.ai/en/stable/serving/openai_compatible_server/) -- [Model fallback](/docs/gateway-and-routing/model-fallback) · [Provider selection](/docs/gateway-and-routing/provider-selection) +- [Model fallback](/docs/models-and-routing/model-fallback) · [Provider selection](/docs/models-and-routing/provider-selection) diff --git a/lib/llms-txt.ts b/lib/llms-txt.ts index 713bf99..ce445fc 100644 --- a/lib/llms-txt.ts +++ b/lib/llms-txt.ts @@ -29,21 +29,32 @@ References: - [Agent Skills](https://github.com/bitrouter/agent-skills): Drop-in skills that teach an agent to install and use BitRouter - [BitRouter CLI](https://github.com/bitrouter/bitrouter): \`cargo install bitrouter\` — the Rust binary, setup wizard, and TUI dashboard -## Gateway & Routing +## Models & Routing -- [Model Fallbacks](${BASE_URL}/docs/gateway-and-routing/model-fallback): Automatic fallback across models when an upstream fails -- [Provider Selection](${BASE_URL}/docs/gateway-and-routing/provider-selection): How models resolve to upstream providers, with cost and performance policies -- [Virtual Model](${BASE_URL}/docs/gateway-and-routing/virtual-model): Define a named model of your own — base model, prompt, params, and routing rules behind \`@name\` -- [Model Variants](${BASE_URL}/docs/gateway-and-routing/model-variants): Append \`:cost\`, \`:latency\`, or \`:throughput\` to a model id to pick a ranking axis inline -- [Bring Your Own Model](${BASE_URL}/docs/gateway-and-routing/bring-your-own-model): Put a model you serve yourself behind BitRouter and route to it like any hosted model -- [Bring Your Own Provider](${BASE_URL}/docs/gateway-and-routing/bring-your-own-provider): Route through your own provider account at list price, with no rev share or per-token fee +- [Model Fallbacks](${BASE_URL}/docs/models-and-routing/model-fallback): Automatic fallback across models when an upstream fails +- [Provider Selection](${BASE_URL}/docs/models-and-routing/provider-selection): How models resolve to upstream providers, with cost and performance policies +- [Virtual Model](${BASE_URL}/docs/models-and-routing/virtual-model): Define a named model of your own — base model, prompt, params, and routing rules behind \`@name\` +- [Model Variants](${BASE_URL}/docs/models-and-routing/model-variants): Append \`:cost\`, \`:latency\`, or \`:throughput\` to a model id to pick a ranking axis inline +- [Bring Your Own Model](${BASE_URL}/docs/models-and-routing/bring-your-own-model): Put a model you serve yourself behind BitRouter and route to it like any hosted model +- [Bring Your Own Provider](${BASE_URL}/docs/models-and-routing/bring-your-own-provider): Route through your own provider account at list price, with no rev share or per-token fee +- [Structured Outputs](${BASE_URL}/docs/models-and-routing/structured-outputs): Enforce a JSON schema across every provider, with the protocol translation handled for you +- [Guardrails](${BASE_URL}/docs/models-and-routing/guardrails): Named regex rules that block or redact matching content in requests and responses -## Features +## MCP & Tool Calling -- [Workspaces](${BASE_URL}/docs/cloud/workspaces): Per-team routing tables, keys, and observability -- [OpenTelemetry](${BASE_URL}/docs/observability/opentelemetry): Self-run OTLP export — traces and metrics of every request, pushed to a Collector, Honeycomb, Grafana, or Datadog -- [Cloud Tracing](${BASE_URL}/docs/cloud/tracing): Hosted Activity view — spend, token, and latency KPIs plus a per-request log, nothing to operate -- [Guardrails](${BASE_URL}/docs/gateway-and-routing/guardrails): Inspect, warn, redact, or block risky content at the proxy layer +- [MCP Gateway](${BASE_URL}/docs/mcp-and-tool-calling/mcp-gateway): One endpoint in front of many MCP servers and Agent Skills — uniform auth, merged discovery, one policy point +- [Server Tools](${BASE_URL}/docs/mcp-and-tool-calling/server-tools): Move the tool-calling loop into BitRouter — declare tools, and the router executes and re-calls until the model is done +- [Advisor](${BASE_URL}/docs/mcp-and-tool-calling/advisor): Let a fast model escalate one hard sub-question to a stronger model mid-generation +- [Sub-agent](${BASE_URL}/docs/mcp-and-tool-calling/subagent): Delegate a self-contained task to a cheaper worker model that returns only its result +- [Fusion](${BASE_URL}/docs/mcp-and-tool-calling/fusion): A panel of models answers in parallel, a judge compares them, and your model writes the final reply +- [Web Search](${BASE_URL}/docs/mcp-and-tool-calling/websearch): A built-in \`web_search\` server tool that gives any routed model a search, on a backend you bring keys for +- [Web Fetch](${BASE_URL}/docs/mcp-and-tool-calling/web-fetch): A built-in \`web_fetch\` server tool that turns a URL into clean page content for any routed model + +## Evals & Tracing + +- [OpenTelemetry](${BASE_URL}/docs/evals-and-tracing/opentelemetry): Self-run OTLP export — traces and metrics of every request, pushed to a Collector, Honeycomb, Grafana, or Datadog +- [Cloud Tracing](${BASE_URL}/docs/evals-and-tracing/tracing): Hosted Activity view — spend, token, and latency KPIs plus a per-request log, nothing to operate +- [Evaluation](${BASE_URL}/docs/evals-and-tracing/evaluation): Per-request outcome signals and cost metering today, with an objective-scored eval engine landing on top ## API Reference @@ -51,6 +62,7 @@ References: - [OpenAI-Compatible](${BASE_URL}/docs/reference/openai-compatible/createChatCompletion): \`/v1/chat/completions\` — drop-in for any OpenAI SDK - [Anthropic-Compatible](${BASE_URL}/docs/reference/anthropic-compatible/createMessage): \`/v1/messages\` — drop-in for the Anthropic SDK - [Discovery](${BASE_URL}/docs/reference/discovery/listModels): List models, providers, and routing tables +- [Management](${BASE_URL}/docs/reference/management/listNamespaces): Workspaces — per-team routing tables, keys, and usage - [BYOK](${BASE_URL}/docs/reference/byok/getEncryptionPubkey): Encrypted upload of upstream provider keys - [Billing](${BASE_URL}/docs/reference/billing/createCheckoutSession): Stripe checkout for prepaid credits - [Webhooks](${BASE_URL}/docs/reference/webhooks/stripeWebhook): Stripe webhook receiver diff --git a/lib/mcp/format.test.ts b/lib/mcp/format.test.ts index b247eee..74cefaa 100644 --- a/lib/mcp/format.test.ts +++ b/lib/mcp/format.test.ts @@ -28,8 +28,8 @@ describe("pathToSlug", () => { ]); }); it("strips a #hash and a full origin", () => { - expect(pathToSlug("https://bitrouter.ai/docs/gateway-and-routing/advisor#usage")).toEqual([ - "gateway-and-routing", "advisor", + expect(pathToSlug("https://bitrouter.ai/docs/mcp-and-tool-calling/advisor#usage")).toEqual([ + "mcp-and-tool-calling", "advisor", ]); }); it("accepts a bare slug path", () => { @@ -41,7 +41,7 @@ describe("formatSearchResults", () => { const raw: RawSearchResult[] = [ { id: "1", url: "/docs/guides/routing/model-fallback", type: "page", content: "Model Fallback" }, { id: "2", url: "/docs/guides/routing/model-fallback#auto", type: "heading", content: "Automatic fallback" }, - { id: "3", url: "/docs/gateway-and-routing/bring-your-own-provider", type: "page", content: "BYOK" }, + { id: "3", url: "/docs/models-and-routing/bring-your-own-provider", type: "page", content: "BYOK" }, ]; it("dedups by page and caps to the limit", () => { const hits = formatSearchResults(raw, 1); @@ -57,7 +57,7 @@ describe("formatSearchResults", () => { }); it("strips fumadocs highlight tags from the title", () => { const hits = formatSearchResults( - [{ id: "1", url: "/docs/gateway-and-routing/model-fallback", type: "page", content: "Model Fallback" }], + [{ id: "1", url: "/docs/models-and-routing/model-fallback", type: "page", content: "Model Fallback" }], 5, ); expect(hits[0].title).toBe("Model Fallback"); diff --git a/next.config.ts b/next.config.ts index 00c078a..8643c15 100644 --- a/next.config.ts +++ b/next.config.ts @@ -6,15 +6,15 @@ const finalPath = { // get-started (dissolved 2026-08 → overview/quickstart) installation: "/docs/overview/quickstart", quickstart: "/docs/overview/quickstart", comparison: "/docs/overview/bitrouter-vs-openrouter", "self-host-vs-cloud": "/docs/overview/quickstart#self-host-or-cloud", - // gateway & routing - "provider-selection":"/docs/gateway-and-routing/provider-selection","model-fallback":"/docs/gateway-and-routing/model-fallback", - "model-variants":"/docs/gateway-and-routing/model-variants","presets":"/docs/gateway-and-routing/virtual-model", - "structured-outputs":"/docs/gateway-and-routing/structured-outputs","byok":"/docs/gateway-and-routing/bring-your-own-provider", - "local-models":"/docs/integrations/models","guardrails":"/docs/gateway-and-routing/guardrails", - "observability":"/docs/observability/opentelemetry","opentelemetry":"/docs/observability/opentelemetry", - "tracing":"/docs/observability/tracing","telemetry":"/docs/observability/opentelemetry", - "mcp":"/docs/gateway-and-routing/mcp-gateway","acp":"/docs/gateway-and-routing/acp-gateway", - "agentskills":"/docs/gateway-and-routing/mcp-gateway", + // models & routing + "provider-selection":"/docs/models-and-routing/provider-selection","model-fallback":"/docs/models-and-routing/model-fallback", + "model-variants":"/docs/models-and-routing/model-variants","presets":"/docs/models-and-routing/virtual-model", + "structured-outputs":"/docs/models-and-routing/structured-outputs","byok":"/docs/models-and-routing/bring-your-own-provider", + "local-models":"/docs/integrations/models","guardrails":"/docs/models-and-routing/guardrails", + "observability":"/docs/evals-and-tracing/opentelemetry","opentelemetry":"/docs/evals-and-tracing/opentelemetry", + "tracing":"/docs/evals-and-tracing/tracing","telemetry":"/docs/evals-and-tracing/opentelemetry", + "mcp":"/docs/mcp-and-tool-calling/mcp-gateway","acp":"/docs/mcp-and-tool-calling/acp-gateway", + "agentskills":"/docs/mcp-and-tool-calling/mcp-gateway", // bitrouter cloud (was: infrastructure) "managed-provider":"/docs/overview/supported-models","discounted-models":"/docs/overview/supported-models", "payment":"/docs/overview/quickstart#self-host-or-cloud","workspaces":"/docs/reference/management/listNamespaces", @@ -43,18 +43,18 @@ pairs.push( ["/docs/get-started/introduction", "/docs/overview/what-is-bitrouter"], ["/docs/get-started/supported-models", "/docs/overview/supported-models"], ["/docs/get-started/supported-providers", "/docs/overview/supported-models"], - ["/docs/features/provider-selection", "/docs/gateway-and-routing/provider-selection"], - ["/docs/features/model-fallback", "/docs/gateway-and-routing/model-fallback"], - ["/docs/features/model-variants", "/docs/gateway-and-routing/model-variants"], - ["/docs/features/presets", "/docs/gateway-and-routing/virtual-model"], - ["/docs/features/structured-outputs", "/docs/gateway-and-routing/structured-outputs"], - ["/docs/features/byok", "/docs/gateway-and-routing/bring-your-own-provider"], + ["/docs/features/provider-selection", "/docs/models-and-routing/provider-selection"], + ["/docs/features/model-fallback", "/docs/models-and-routing/model-fallback"], + ["/docs/features/model-variants", "/docs/models-and-routing/model-variants"], + ["/docs/features/presets", "/docs/models-and-routing/virtual-model"], + ["/docs/features/structured-outputs", "/docs/models-and-routing/structured-outputs"], + ["/docs/features/byok", "/docs/models-and-routing/bring-your-own-provider"], // concepts/ section dissolved (2026-07 reorg) → pages land next to their features ["/docs/concepts", "/docs/overview/what-is-bitrouter"], ["/docs/concepts/models", "/docs/overview/supported-models#how-model-ids-work"], ["/docs/concepts/policy", "/docs/overview/quickstart#adaptive-routing"], - ["/docs/concepts/tools", "/docs/gateway-and-routing/mcp-gateway"], - ["/docs/concepts/agents", "/docs/gateway-and-routing/acp-gateway"], + ["/docs/concepts/tools", "/docs/mcp-and-tool-calling/mcp-gateway"], + ["/docs/concepts/agents", "/docs/mcp-and-tool-calling/acp-gateway"], ["/docs/concepts/cli", "/docs/usage/cli"], ["/docs/concepts/mcp", "/docs/usage/mcp"], ["/docs/concepts/agent-skill", "/docs/overview/quickstart"], @@ -73,9 +73,9 @@ pairs.push( ["/docs/get-started/quickstart", "/docs/overview/quickstart"], ["/docs/get-started/installation", "/docs/overview/quickstart"], ["/docs/get-started/comparison", "/docs/overview/bitrouter-vs-openrouter"], - ["/docs/get-started/set-up-routing", "/docs/gateway-and-routing/provider-selection"], - ["/docs/get-started/set-up-tracing", "/docs/observability/opentelemetry"], - ["/docs/get-started/set-up-evaling", "/docs/observability/evaluation"], + ["/docs/get-started/set-up-routing", "/docs/models-and-routing/provider-selection"], + ["/docs/get-started/set-up-tracing", "/docs/evals-and-tracing/opentelemetry"], + ["/docs/get-started/set-up-evaling", "/docs/evals-and-tracing/evaluation"], ["/docs/get-started/set-up-looping", "/docs/overview/quickstart#adaptive-routing"], // infrastructure → bitrouter cloud (folder renamed; pages merged/moved) ["/docs/infrastructure/managed-provider", "/docs/overview/supported-models"], @@ -87,8 +87,8 @@ pairs.push( ["/docs/cloud", "/docs/overview/quickstart#self-host-or-cloud"], ["/docs/cloud/overview", "/docs/overview/quickstart#self-host-or-cloud"], ["/docs/cloud/get-started", "/docs/overview/quickstart#self-host-or-cloud"], - ["/docs/cloud/byok", "/docs/gateway-and-routing/bring-your-own-provider"], - ["/docs/cloud/tracing", "/docs/observability/tracing"], + ["/docs/cloud/byok", "/docs/models-and-routing/bring-your-own-provider"], + ["/docs/cloud/tracing", "/docs/evals-and-tracing/tracing"], ["/docs/cloud/managed-models", "/docs/overview/supported-models"], ["/docs/cloud/workspaces", "/docs/reference/management/listNamespaces"], ["/docs/cloud/payment", "/docs/overview/quickstart#self-host-or-cloud"], @@ -123,15 +123,15 @@ pairs.push( ["/docs/changelog/:slug*", "/docs/reference/changelog/:slug*"], ["/docs/changelog", "/docs/reference/changelog"], // moved/removed pages (2026-06 refactor) → live destinations - ["/docs/features/observability", "/docs/observability/opentelemetry"], - ["/docs/features/tracing", "/docs/observability/tracing"], - ["/docs/features/telemetry", "/docs/observability/opentelemetry"], + ["/docs/features/observability", "/docs/evals-and-tracing/opentelemetry"], + ["/docs/features/tracing", "/docs/evals-and-tracing/tracing"], + ["/docs/features/telemetry", "/docs/evals-and-tracing/opentelemetry"], // observability & evaluation split out of features/ (2026-08); the single // opentelemetry page was two pages welded together — OSS export vs hosted view - ["/docs/features/opentelemetry", "/docs/observability/opentelemetry"], + ["/docs/features/opentelemetry", "/docs/evals-and-tracing/opentelemetry"], ["/docs/features/local-models", "/docs/integrations/models"], - ["/docs/features/toolsets", "/docs/gateway-and-routing/server-tools"], - ["/docs/guides/export-telemetry", "/docs/observability/opentelemetry"], + ["/docs/features/toolsets", "/docs/mcp-and-tool-calling/server-tools"], + ["/docs/guides/export-telemetry", "/docs/evals-and-tracing/opentelemetry"], ["/docs/cloud/managed-tools", "/docs/overview/quickstart#self-host-or-cloud"], ["/docs/cloud/managed-agents", "/docs/overview/quickstart#self-host-or-cloud"], // integrations + cookbook history @@ -144,47 +144,66 @@ pairs.push( ["/docs/integrations/migrate/openrouter", "/docs/guides/migrate-from-openrouter"], ["/docs/cookbook/migration/litellm", "/docs/guides/migrate-from-litellm"], ["/docs/cookbook/migration/openrouter", "/docs/guides/migrate-from-openrouter"], - // gateway pages consolidated out of features/ and the section renamed - // models-and-routing → gateway-and-routing (2026-08) - ["/docs/models-and-routing/provider-selection", "/docs/gateway-and-routing/provider-selection"], - ["/docs/models-and-routing/model-fallback", "/docs/gateway-and-routing/model-fallback"], - ["/docs/models-and-routing/model-variants", "/docs/gateway-and-routing/model-variants"], - ["/docs/models-and-routing/presets", "/docs/gateway-and-routing/virtual-model"], - ["/docs/models-and-routing/structured-outputs", "/docs/gateway-and-routing/structured-outputs"], - ["/docs/models-and-routing/byok", "/docs/gateway-and-routing/bring-your-own-provider"], - ["/docs/models-and-routing", "/docs/gateway-and-routing/provider-selection"], + // The section was models-and-routing → gateway-and-routing (2026-08) → back to + // models-and-routing (2026-09), so most of its own slugs are live URLs again and + // need no redirect. Only the two renamed pages and the index still do. + ["/docs/models-and-routing/presets", "/docs/models-and-routing/virtual-model"], + ["/docs/models-and-routing/byok", "/docs/models-and-routing/bring-your-own-provider"], + ["/docs/models-and-routing", "/docs/models-and-routing/provider-selection"], + // gateway-and-routing/ split (2026-09): the routing pages went back to + // models-and-routing/, the tool-calling pages to mcp-and-tool-calling/. + ["/docs/gateway-and-routing/model-fallback", "/docs/models-and-routing/model-fallback"], + ["/docs/gateway-and-routing/provider-selection", "/docs/models-and-routing/provider-selection"], + ["/docs/gateway-and-routing/virtual-model", "/docs/models-and-routing/virtual-model"], + ["/docs/gateway-and-routing/model-variants", "/docs/models-and-routing/model-variants"], + ["/docs/gateway-and-routing/bring-your-own-model", "/docs/models-and-routing/bring-your-own-model"], + ["/docs/gateway-and-routing/bring-your-own-provider", "/docs/models-and-routing/bring-your-own-provider"], + ["/docs/gateway-and-routing/structured-outputs", "/docs/models-and-routing/structured-outputs"], + ["/docs/gateway-and-routing/guardrails", "/docs/models-and-routing/guardrails"], + ["/docs/gateway-and-routing/mcp-gateway", "/docs/mcp-and-tool-calling/mcp-gateway"], + ["/docs/gateway-and-routing/server-tools", "/docs/mcp-and-tool-calling/server-tools"], + ["/docs/gateway-and-routing/advisor", "/docs/mcp-and-tool-calling/advisor"], + ["/docs/gateway-and-routing/subagent", "/docs/mcp-and-tool-calling/subagent"], + ["/docs/gateway-and-routing/fusion", "/docs/mcp-and-tool-calling/fusion"], + ["/docs/gateway-and-routing/websearch", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/gateway-and-routing/web-fetch", "/docs/mcp-and-tool-calling/web-fetch"], + ["/docs/gateway-and-routing/acp-gateway", "/docs/mcp-and-tool-calling/acp-gateway"], + ["/docs/gateway-and-routing", "/docs/models-and-routing/provider-selection"], + // observability/ → evals-and-tracing/ (2026-09) + ["/docs/observability/:slug*", "/docs/evals-and-tracing/:slug*"], + ["/docs/observability", "/docs/evals-and-tracing/opentelemetry"], // tools/agents pages retitled to name their protocol; features/ dissolved — // guardrails moved, namespaces and payment retired (2026-08) - ["/docs/gateway-and-routing/tools", "/docs/gateway-and-routing/mcp-gateway"], - ["/docs/gateway-and-routing/agents", "/docs/gateway-and-routing/acp-gateway"], - ["/docs/features", "/docs/gateway-and-routing/guardrails"], - ["/docs/features/guardrails", "/docs/gateway-and-routing/guardrails"], + ["/docs/gateway-and-routing/tools", "/docs/mcp-and-tool-calling/mcp-gateway"], + ["/docs/gateway-and-routing/agents", "/docs/mcp-and-tool-calling/acp-gateway"], + ["/docs/features", "/docs/models-and-routing/guardrails"], + ["/docs/features/guardrails", "/docs/models-and-routing/guardrails"], ["/docs/features/namespaces", "/docs/reference/management/listNamespaces"], ["/docs/features/payment", "/docs/overview/quickstart#self-host-or-cloud"], - ["/docs/features/tools", "/docs/gateway-and-routing/mcp-gateway"], - ["/docs/features/server-tools", "/docs/gateway-and-routing/server-tools"], - ["/docs/features/websearch", "/docs/gateway-and-routing/websearch"], - ["/docs/features/web-fetch", "/docs/gateway-and-routing/web-fetch"], - ["/docs/features/agents", "/docs/gateway-and-routing/acp-gateway"], - ["/docs/features/subagent", "/docs/gateway-and-routing/subagent"], - ["/docs/features/advisor", "/docs/gateway-and-routing/advisor"], - ["/docs/features/fusion", "/docs/gateway-and-routing/fusion"], + ["/docs/features/tools", "/docs/mcp-and-tool-calling/mcp-gateway"], + ["/docs/features/server-tools", "/docs/mcp-and-tool-calling/server-tools"], + ["/docs/features/websearch", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/features/web-fetch", "/docs/mcp-and-tool-calling/web-fetch"], + ["/docs/features/agents", "/docs/mcp-and-tool-calling/acp-gateway"], + ["/docs/features/subagent", "/docs/mcp-and-tool-calling/subagent"], + ["/docs/features/advisor", "/docs/mcp-and-tool-calling/advisor"], + ["/docs/features/fusion", "/docs/mcp-and-tool-calling/fusion"], // pages retired (2026-08): the provider directory and the models concept page // folded into the model catalog, policy semantics into the quickstart, and the // search-provider integrations into the web search feature page. ["/docs/overview/supported-providers", "/docs/overview/supported-models"], ["/docs/gateway-and-routing/models", "/docs/overview/supported-models#how-model-ids-work"], ["/docs/gateway-and-routing/policy", "/docs/overview/quickstart#adaptive-routing"], - ["/docs/integrations/tools", "/docs/gateway-and-routing/websearch"], - ["/docs/integrations/exa", "/docs/gateway-and-routing/websearch"], - ["/docs/integrations/parallel", "/docs/gateway-and-routing/websearch"], - ["/docs/integrations/firecrawl", "/docs/gateway-and-routing/websearch"], - ["/docs/integrations/tavily", "/docs/gateway-and-routing/websearch"], + ["/docs/integrations/tools", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/integrations/exa", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/integrations/parallel", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/integrations/firecrawl", "/docs/mcp-and-tool-calling/websearch"], + ["/docs/integrations/tavily", "/docs/mcp-and-tool-calling/websearch"], // gateway pages renamed for what they are, not what the field is called // (2026-08): presets → virtual model, external providers (BYOK) → bring your // own provider. The API keeps `routing-presets` and `byok`; the docs don't. - ["/docs/gateway-and-routing/presets", "/docs/gateway-and-routing/virtual-model"], - ["/docs/gateway-and-routing/byok", "/docs/gateway-and-routing/bring-your-own-provider"], + ["/docs/gateway-and-routing/presets", "/docs/models-and-routing/virtual-model"], + ["/docs/gateway-and-routing/byok", "/docs/models-and-routing/bring-your-own-provider"], // the OpenRouter page was unpublished (2026-08); the aggregator provider block // it documented is the worked example on the model-sources page. The // migrate-from-openrouter guide is unaffected. diff --git a/scripts/check-docs.mjs b/scripts/check-docs.mjs index 03b8876..10156e9 100644 --- a/scripts/check-docs.mjs +++ b/scripts/check-docs.mjs @@ -27,8 +27,9 @@ import { COMPONENT_WHITELIST } from "../lib/docs-sync/constants.mjs"; const SECTIONS = [ "(guide)/overview", "(guide)/usage", - "(guide)/gateway-and-routing", - "(guide)/observability", + "(guide)/models-and-routing", + "(guide)/mcp-and-tool-calling", + "(guide)/evals-and-tracing", "integrations", "guides", ]; From e0cd50d14bdd6cbfdfc87a94f0158d60b3357bf9 Mon Sep 17 00:00:00 2001 From: Spikel Date: Fri, 7 Aug 2026 12:30:08 +0800 Subject: [PATCH 2/2] Fix two dead docs redirects surfaced by the audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both predate the nav rename; the audit in the previous commit found them. /docs/changelog pointed at /docs/reference/changelog, which has never existed — the changelog is a top-level route (app/changelog), not a docs section. Retargeted it and its :slug* wildcard to /changelog. /docs/cookbook/local-models pointed at /docs/integrations/local-models, a page unpublished in 2026-08 when the model catalog absorbed it. It now lands on /docs/integrations/models, matching the two other local-models redirects. Added the same 301 for /docs/integrations/local-models, which was a live URL until the page was unpublished and has 404'd since. Co-Authored-By: Claude Opus 5 --- next.config.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/next.config.ts b/next.config.ts index 8643c15..ae865e2 100644 --- a/next.config.ts +++ b/next.config.ts @@ -120,8 +120,10 @@ pairs.push( // reference wildcards (api-reference unwrapped into /docs/reference) ["/docs/api-reference/:slug*", "/docs/reference/:slug*"], ["/docs/reference/api-reference/:slug*", "/docs/reference/:slug*"], - ["/docs/changelog/:slug*", "/docs/reference/changelog/:slug*"], - ["/docs/changelog", "/docs/reference/changelog"], + // The changelog is a top-level route (app/changelog), not a docs section — + // /docs/reference/changelog has never existed. + ["/docs/changelog/:slug*", "/changelog/:slug*"], + ["/docs/changelog", "/changelog"], // moved/removed pages (2026-06 refactor) → live destinations ["/docs/features/observability", "/docs/evals-and-tracing/opentelemetry"], ["/docs/features/tracing", "/docs/evals-and-tracing/tracing"], @@ -137,7 +139,9 @@ pairs.push( // integrations + cookbook history ["/docs/integrations/harnesses/:slug*", "/docs/integrations/:slug*"], ["/docs/cookbook/integration/:slug*", "/docs/integrations/:slug*"], - ["/docs/cookbook/local-models", "/docs/integrations/local-models"], + // the local-models page was unpublished; the model catalog absorbed it + ["/docs/cookbook/local-models", "/docs/integrations/models"], + ["/docs/integrations/local-models", "/docs/integrations/models"], ["/docs/cookbook", "/docs/integrations"], // migration history → guides ["/docs/integrations/migrate/litellm", "/docs/guides/migrate-from-litellm"],