Commit 174e25a
Add sync-openrouter: slug-keyed OpenRouter alternates for carried models
Mirrors the Bedrock/Baseten pattern: OpenRouter serves many models we already
carry under a different `<vendor>/<model>` slug (e.g. openrouter `x-ai/grok-4.5`
== our `grok-4.5`). Rather than union `openrouter` onto the canonical entry, this
creates a SEPARATE entry keyed by the openrouter slug, `format: "openai"`,
`available_providers: ["openrouter"]`, with pricing/context/modality/reasoning
pulled from OpenRouter's public /api/v1/models directory.
- sync_models.ts: OpenRouter schemas + fetch, `openRouterCanonicalId` (strip
vendor prefix, reject :variant slugs), `convertOpenRouterToLocalModel`,
`applyOpenRouterPricing`, and `syncOpenRouterModelsCommand`. Bounded to models
we already carry; openrouter-only models and :free/:nitro variants are skipped.
Existing non-openrouter entries that share a slug (e.g. the multi-provider
`openai/gpt-oss-120b`) are never touched.
- Registered as the `sync-openrouter` yargs command.
- sync-models.yaml: daily "Sync OpenRouter alternates" step (public endpoint,
OPENROUTER_API_KEY optional).
- Tests for the canonical-id strip, converter, and pricing refresh.
- Generates 86 slug-keyed alternates (openai, google, mistralai, perplexity,
x-ai, cohere, anthropic, microsoft) + their index.ts ["openrouter"] mappings.
Routing note: the deployed Rust gateway (lingua) does not yet implement the
`openrouter` provider kind (router_builder returns "unsupported provider kind"),
so these resolve + find the org secret but cannot invoke until lingua adds it.
The catalog entries are correct regardless; routing needs that gateway change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent b2760c4 commit 174e25a
5 files changed
Lines changed: 1769 additions & 1 deletion
File tree
- .github/workflows
- packages/proxy
- schema
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
396 | 482 | | |
397 | 483 | | |
398 | 484 | | |
| |||
0 commit comments