[docs]: add Model Router section to v3 models page

Merged
MI
4mo ago
+93-1

why

model: "auto" shipped in #2328 but is undocumented. This adds a Model Router section to /v3/configuration/models, nested under Model Gateway right after Setup, plus a launch callout at the top of the page.

what changed

packages/docs/v3/configuration/models.mdx only — no code, so no changeset.

  • (NEW) Model Router callout at the top of the page, above the Model Gateway one, linking to #model-router. Dropped (NEW) from the Model Gateway callout so only one feature is flagged as new.
  • ### Model Router subsection: what it does, basic usage, Model Gateway billing (market-price tokens on your Browserbase key), and the 30–40% cost reduction vs. pinning one frontier model.
  • #### Requirements table covering the four API-only constraints the constructor enforces (env: "BROWSERBASE", disableAPI: false, experimental: false, no llmClient), plus a warning that "auto" has no local fallback if the API is unavailable at init.
  • #### Per-call routing: { model: "auto" } as a per-primitive override on top of a concrete default, including the object form ({ modelName: "auto", temperature: 0.5 }) and the note that overrides don't inherit the session provider/API key.
  • Agent support: works in default dom/hybrid, not with mode: "cua" ("auto" isn't in AVAILABLE_CUA_MODELS, so it throws CuaModelRequiredError).
  • Caching: local replay is skipped for "auto" sessions; the API's server-side cache handles it.
  • Troubleshooting accordion for both auto-specific errors, and an env-var table row.

Behavior claims were taken from modelUtils.ts, v3.ts, api.ts, AgentCache.ts, and tests/unit/auto-model.test.ts. The routing heuristic itself is server-side and not in this repo, so the copy deliberately stays general about how a model gets picked — nothing here goes stale when the router changes.

open question

Should omitting model entirely also route through Model Router?

Today it doesn't — resolveModelConfiguration() falls back to DEFAULT_MODEL_NAME = "openai/gpt-4.1-mini" (packages/core/lib/v3/v3.ts:101,115), so an omitted model pins gpt-4.1-mini (run through Model Gateway if only a Browserbase key is set). That's a fixed model, not per-call routing. I left the omit path out of the docs for now. If the default should become "auto", that's a core change and the docs can follow alongside it.

test plan

  • mintlify broken-links — no new broken links (the 5 reported are pre-existing and in other files)
  • JSX components balanced, code fences even, heading nesting verified, #model-router anchor resolves