Skip to content

Route unmatched namespaced ids to OpenRouter instead of NRP - #155

Merged
cboettig merged 1 commit into
mainfrom
namespaced-passthrough
Oct 21, 2026
Merged

cboettig merged 1 commit into
mainfrom
namespaced-passthrough

Conversation

@cboettig

Copy link
Copy Markdown
Member

Closes #154. Part of #142 and #120 (shape 2 from #154).

Change

get_provider_for_model() gains one tier between declared prefixes and default_provider:

  1. exact models (unchanged; nimbus qwen still wins)
  2. declared model_prefixes (unchanged; ~ floating aliases, claude-)
  3. new: an id containing / goes to namespaced_default_provider. That defaults to openrouter when configured. With no usable value it is a 400 naming the setting, never a fallback to default_provider.
  4. bare ids go to default_provider (nrp, unchanged)

NRP serves no slash-namespaced ids. In the last 60 days of logs the only namespaced id routed to NRP was the #142 repro (google/gemini-3.7-flash), and it failed there. So no working route changes. reflection/…, meta/… and google/… now reach OpenRouter without a prefix edit.

GET /v1/models is filtered through the router, so it now lists OpenRouter's whole catalog, not only the declared vendors.

Not changed

Tests

66 pass. Two are new: unlisted vendors route to OpenRouter while bare, exact and claude- ids are unchanged; and with no namespaced fallback the id raises UnknownModelError and does not reach NRP. The discovery-listing test was updated for the intended change.

@cboettig
cboettig merged commit 0078608 into main Oct 21, 2026
1 check passed
@cboettig
cboettig deleted the namespaced-passthrough branch October 21, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Namespaced model ids fall back to NRP when their prefix is not listed

1 participant