From 9412cfd5ab92b8a61ddcaa013c50825fa3d83938 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Fri, 23 Oct 2026 21:46:41 +0000 Subject: [PATCH 1/2] feat(router-docs): render alt-provider leg limits on model pages and the providers matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A leg's `limits` object on `x-comfy-router-alt-providers` now renders as indented sub-bullets under its Serving providers row (accepted formats, duration, aspect ratios, current price from the rate snapshot, rejected inputs, fallback). The providers matrix marks such a cell `✓*` with a footnote. A malformed `limits` is dropped and the leg row is unchanged. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/snippets/README.md | 18 +- .../scripts/snippets/gen-code-pages.test.ts | 180 +++++++++++++ .github/scripts/snippets/gen-code-pages.ts | 250 +++++++++++++++++- .../scripts/snippets/gen-router-pricing.ts | 2 +- 4 files changed, 434 insertions(+), 16 deletions(-) diff --git a/.github/scripts/snippets/README.md b/.github/scripts/snippets/README.md index 2a5337c049..3c03e43927 100644 --- a/.github/scripts/snippets/README.md +++ b/.github/scripts/snippets/README.md @@ -76,7 +76,7 @@ provider renders sanely without a code change. Some models can be served by more than one provider. Router publishes the relationship on the schema documents themselves: a **native** document lists its -legs in `x-comfy-router-alt-providers` (`[{provider, model_id}]`), and each leg +legs in `x-comfy-router-alt-providers` (`[{provider, model_id?, limits?}]`), and each leg also has an **alias** document of its own carrying `x-comfy-router-alias-of` (the native model id) and `x-comfy-router-alias-provider` (the provider serving it). @@ -96,12 +96,26 @@ The generator reads both and organises the docs by model rather than by route: per leg with the provider's label, the leg's alias model id, and the same call on the same endpoint with `?model_provider=` added. A native model with no leg renders no section. +- A leg whose entry carries a **`limits`** object (a leg materially narrower + than its native model) gets indented sub-bullets under its row: what it + accepts (resolution, audio, duration range, aspect ratios), its price, the + inputs it rejects and with which error, and its fallback. The price comes + from `router-pricing/metronome-rates.json`, keyed on the native model id and + the provider label, current rows only, with credits rounded to 2 decimals. + With no matching row the price line is omitted. The lines are indented + because `gen-router-pricing.ts` counts a page's providers from its column-0 + `- **