Skip to content

feat(routing): add single-provider weighted-router overrides#1

Merged
coniferconcepts merged 1 commit intomainfrom
feature/per-model-routing-v1-single
Mar 14, 2026
Merged

feat(routing): add single-provider weighted-router overrides#1
coniferconcepts merged 1 commit intomainfrom
feature/per-model-routing-v1-single

Conversation

@coniferconcepts
Copy link
Copy Markdown
Owner

@coniferconcepts coniferconcepts commented Mar 14, 2026

Summary

  • add a v1 RoutingPolicy that rewrites weighted-router/<model> into a concrete provider-prefixed model before provider lock-in
  • support strict single overrides via MODEL_ROUTING_OVERRIDES, including load-time validation and fail-closed behavior for unmatched weighted-router/* models
  • preserve the existing retry, cooldown, and credential rotation flow once the model has been rewritten
  • document the override contract and add focused tests for validation, env loading, passthrough behavior, and dispatch-time rewriting

Testing

  • pytest tests/test_routing_policy.py tests/test_client_routing_policy.py
  • python3 -m py_compile "src/rotator_library/routing_policy.py" "src/rotator_library/client.py" "tests/test_routing_policy.py" "tests/test_client_routing_policy.py"

V1 Scope

  • only single strategy is supported
  • allowed_providers must contain only the primary provider
  • fallback_providers must remain empty
  • unmatched weighted-router/* models fail closed instead of silently falling through

Follow-Up

  • add weighted override support for models like qwen3.5
  • consider moving from env-only overrides to a first-class config surface if this pattern sticks

@coniferconcepts coniferconcepts merged commit f3f1a3c into main Mar 14, 2026
1 of 3 checks passed
@coniferconcepts coniferconcepts deleted the feature/per-model-routing-v1-single branch March 14, 2026 15:06
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