Skip to content

feat: route on the input modalities a request requires - #42

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/29-modality-routing
Oct 4, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/29-modality-routing

Conversation

@Yash-Chindam

Copy link
Copy Markdown
Owner

What

Adds the last routing feature the spec lists that was missing (§7.2, "Required modality").

How

  • routing.modalities declares the inputs a request needs (text, image, audio; default text).
  • Model cards carry modalities (default text), which flows through the catalog to the router and into the MLflow record.
  • The router applies it as a hard capability restriction before scoring, next to structured output and privacy: a model that lacks a required modality is never a candidate, whatever it would have scored. With no capable model the request is refused with 422.

Tests

Three tests in tests/unit/test_routing_features.py: a higher-scoring text-only model is skipped for an image request; a modality no model accepts is refused and an empty requirement is invalid; the card's modalities reach the router.

Local: ruff and mypy clean, 479 tests pass, Playwright 9/9.

Limits

This is a routing restriction only. Every model in the committed catalog is text-only and message content is still text, so the gateway does not yet accept image or audio content itself.

🤖 Generated with Claude Code

A request declares the modalities it needs and a model whose card does not
list them all is never a candidate, as a deterministic capability
restriction applied before scoring. The committed catalog stays text-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation area/api area/tests labels Oct 4, 2026
@github-actions
github-actions Bot merged commit 9ee8cb2 into main Oct 4, 2026
6 checks passed
@github-actions
github-actions Bot deleted the feat/29-modality-routing branch October 4, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api area/tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant