Skip to content

fix(routing): refuse un-prefixed passthrough model ids - #125

Closed
robmsmt wants to merge 1 commit into
mainfrom
fix/refuse-bare-passthrough-ids
Closed

fix(routing): refuse un-prefixed passthrough model ids#125
robmsmt wants to merge 1 commit into
mainfrom
fix/refuse-bare-passthrough-ids

Conversation

@robmsmt

@robmsmt robmsmt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Bare upstream ids like swiss-ai/Apertus-8B-Instruct-2509 were still silently routing to the first registered passthrough provider that advertised them (CSCS L1 today) — which provider won was an accident of registration order, and clients had no signal they were on a deprecated path beyond a server-side log.

This closes the deprecation window:

  • resolve_model now returns None for un-prefixed ids, so they fall through to OpenTela and 404 under exactly the id the client sent — no silent rerouting, no cross-provider ambiguity.
  • The log-only scan remains: a bare id that matches a provider's advertised set logs Refusing un-prefixed passthrough model id ...; use CSCS-Inference/... so operators can chase unmigrated clients.
  • Prefixed ids (CSCS-Inference/..., RCP-AIaaS/...) and the platform namespace (SwissAI-Research/...) are unchanged.

Client impact

Anyone still calling with a bare id (e.g. the historical swiss-ai/Apertus-* curl) will now get a 404 and must switch to the prefixed id, e.g. CSCS-Inference/swiss-ai/Apertus-8B-Instruct-2509. These ids have been advertised via /v1/models since the prefix registry landed.

Tests

  • test_bare_upstream_id_does_not_route — bare id resolves to None and logs the migration target.
  • test_same_upstream_id_on_two_providers_lists_two_rows — same model on CSCS + RCP stays individually routable; the bare id routes to neither.
  • Full suite: 127 passed.

🤖 Generated with Claude Code

Bare upstream ids (e.g. swiss-ai/Apertus-8B-Instruct-2509) used to
silently route to the first registered provider that advertised them,
making the winner an accident of registration order. The deprecation
window is over: resolve_model now returns None for bare ids, so they
fall through to OpenTela and 404 under the id the client sent. A
warning log still names the prefixed id (CSCS-Inference/..., ...) so
operators can spot unmigrated clients.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@robmsmt

robmsmt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #127, which enforces the canonical 3-segment id shape at the request boundary for all model-forwarding endpoints (and removes the same back-compat loop this PR touched).

@robmsmt robmsmt closed this Aug 11, 2026
@robmsmt
robmsmt deleted the fix/refuse-bare-passthrough-ids branch August 11, 2026 12:51
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.

1 participant