fix(observability)!: attribute ATIF steps to effective response model#399
Draft
bbednarski9 wants to merge 1 commit into
Draft
fix(observability)!: attribute ATIF steps to effective response model#399bbednarski9 wants to merge 1 commit into
bbednarski9 wants to merge 1 commit into
Conversation
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2 tasks
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.
Warning
BREAKING CHANGE: [Behavioral] ATIF LLM steps now prefer the model reported by the normalized provider response over the requested or profile model. Consumers that group, compare, or price trajectories by
step.model_namemay observe a different model for routed or cross-protocol calls. When no effective response model is available, the existing attribution fallback remains unchanged.Overview
Correct ATIF model attribution for LLM calls whose effective provider model differs from the model requested at the beginning of the Relay lifecycle.
This generic exporter fix is intentionally independent of the Switchyard plugin. Any router, proxy, or provider translation layer that records the effective model in
AnnotatedLlmResponsereceives the same ATIF behavior.Details
ATIF previously preferred the model recorded on the LLM start event. For routed requests, that value can be a client alias, profile model, or originally requested model rather than the backend that actually produced the response. The normalized end response already contains the effective model, but ATIF did not use it for
step.model_name.This PR:
qwen3:4bbut the normalized response is produced byqwen3.6:35b.No ATOF event, provider response, routing decision, cost calculation, or plugin behavior changes. Only exported ATIF
step.model_nameattribution changes.Validation:
cargo fmt --all -- --checkcargo test -p nemo-relay test_exporter_prefers_effective_response_model_over_requested_profile_modelcargo test -p nemo-relay observability::atif::tests— 88 passed.cargo clippy -p nemo-relay --all-targets -- -D warningsgit diff --checkWhere should the reviewer start?
crates/core/src/observability/atif.rs— model selection and fallback behavior.crates/core/tests/unit/atif_tests.rs— routed-model regression fixture.The central design decision is that ATIF describes the model that produced the response, while the requested model remains available in the original ATOF lifecycle input and optimization metadata.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)