Repository navigation
Smart routing with dated model names - #48
Merged
Merged
Conversation
o-ba
force-pushed
the
bugfix/smart-routing-dated-model-names
branch
from
October 27, 2026 08:22
d6c2d9c to
a666972
Compare
bmack
approved these changes
Oct 27, 2026
o-ba
force-pushed
the
bugfix/smart-routing-dated-model-names
branch
2 times, most recently
from
October 27, 2026 21:06
ac22150 to
c7acb36
Compare
Providers report a dated snapshot (gpt-4o-mini-2024-07-18) or the target of an alias (claude-sonnet-4-20250514 for claude-sonnet-4-0), and the request log stored only that name, while smart routing and the auto model switch compare the history with the model a configuration names. Smart routing therefore never found enough history to downgrade a request to OpenAI or Anthropic. The request log now records the model of the configuration a request ran on (model_configured), and the performance profile is keyed by it. A rerouted request keeps the model it was routed away from in model_requested, so model_configured is the only place its target is known. Entries logged before the column existed keep counting under the reported name. Smart routing also tries the next cheaper model when no configuration takes the cheapest one in the history, instead of giving up. The profile query sums in SQL instead of multiplying averages back. Signed-off-by: Oliver Bartsch <bo@cedev.de>
o-ba
force-pushed
the
bugfix/smart-routing-dated-model-names
branch
from
October 27, 2026 21:17
c7acb36 to
bb6cf78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Providers report dated model names (gpt-4o-mini-2024-07-18), and the request log stores them, but configurations use the undated name (gpt-4o-mini). Because of that, smart routing never found enough history to switch to a cheaper model for OpenAI or Anthropic, and the automatic model switch missed failed or cost entries. History is now grouped by the undated name. Two new tests in SmartRoutingDispatchTest reproduce the bug.