Skip to content

fix(prices): dedupe Nova cache_read_input_token_cost keys left by a text merge - #41496

Merged
yuneng-berri merged 1 commit into
mainfrom
litellm_/litellm-ci-failure-be9267
Sep 16, 2026
Merged

yuneng-berri merged 1 commit into
mainfrom
litellm_/litellm-ci-failure-be9267

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Six Nova price entries define cache_read_input_token_cost twice
  • test_price_map_has_no_duplicate_keys fails on main, so every PR's Unit Tests job is red

How it solves it:

  • Removes the trailing duplicate key from each of the six entries, in both price files
  • Both copies held the same value, so no price changes

User Flow

Before: a contributor pushes any branch against main and the Unit Tests workflow goes red on a file they never touched

  1. They open a PR against main, for example test(together_ai): move request-shape checks to the mapped file, drop the live ones #41360, which only edits Together AI test files
  2. GitHub Actions runs the Unit Tests workflow on the merge of main and their branch
  3. The misc / Run tests job fails with test_price_map_has_no_duplicate_keys[main] and [backup] reporting cache_read_input_token_cost listed twice, six times each

After: the same push goes green

  1. They open the same PR against main
  2. GitHub Actions runs the same workflow on the merge of main and their branch
  3. The misc / Run tests job passes: each Nova entry carries cache_read_input_token_cost once

Relevant issues

#41343 and #41112 both added cache_read_input_token_cost to amazon.nova-{micro,lite,pro}-v1:0 and us.amazon.nova-{micro,lite,pro}-v1:0, one at the top of each entry and one at the bottom. Neither branch had the duplicate on its own. Merging #41112 (6edb549) onto a main that already had #41343 kept both lines

Affected release

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

The duplicated lines carried the same value as the line they duplicated, so a request through the proxy prices identically before and after. The only observable is the schema gate itself

Before (f62f140)

  1. CI on test(together_ai): move request-shape checks to the mapped file, drop the live ones #41360, whose merge commit sits on this main: https://github.com/BerriAI/litellm/actions/runs/35152975610/job/104985926850
  2. PYTHONPATH=$PWD python -m pytest tests/test_litellm/test_model_prices_schema.py -k test_price_map_has_no_duplicate_keys -q
FAILED tests/test_litellm/test_model_prices_schema.py::test_price_map_has_no_duplicate_keys[backup]
FAILED tests/test_litellm/test_model_prices_schema.py::test_price_map_has_no_duplicate_keys[main]
2 failed, 39 deselected in 0.35s

After (a6b10ad)

  1. PYTHONPATH=$PWD python -m pytest tests/test_litellm/test_model_prices_schema.py -q
41 passed in 0.54s
  1. PYTHONPATH=$PWD python -m pytest tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py -k nova -q
28 passed, 272 deselected, 1 warning in 0.84s

Type

🐛 Bug Fix

Caveats (if any)

Low

…ext merge

PR #41343 and PR #41112 both added cache_read_input_token_cost to the six amazon.nova-{micro,lite,pro}-v1:0 and us.amazon.nova-* entries, one at the top of each entry and one at the bottom. The merge kept both, so every PR now fails test_price_map_has_no_duplicate_keys. Both copies carried the same value, so this only removes the trailing duplicate in both price files
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes six duplicate cache_read_input_token_cost keys from each pricing map without changing effective prices

  • Retains the existing values for Nova Lite, Micro, and Pro, including their US-prefixed entries
  • Keeps the primary and backup maps synchronized
  • Existing duplicate-key tests cover this fix in both files; tests were not independently run during this review

Confidence Score: 5/5

This PR appears safe to merge, with no actionable issues identified

The removed keys duplicate retained values, both pricing maps stay synchronized, and existing tests explicitly detect duplicate keys in both files

Important Files Changed
Filename Overview
model_prices_and_context_window.json Removes six trailing duplicate Nova cache-read keys while preserving their values and valid JSON punctuation
litellm/model_prices_and_context_window_backup.json Applies the identical duplicate-key cleanup to the backup map without changing fallback pricing

Reviews (1): Last reviewed commit: "fix(prices): dedupe Nova cache_read_inpu..." | Re-trigger Greptile

@codspeed

codspeed Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_/litellm-ci-failure-be9267 (a6b10ad) with main (a6e8752)

Open in CodSpeed

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

yuneng-berri added a commit that referenced this pull request Sep 16, 2026
…ext merge

Six Amazon Nova entries define cache_read_input_token_cost twice, which
is what a clean text merge of two branches that both added the field
looks like. JSON parsers keep the last occurrence, so this turned
test_price_map_has_no_duplicate_keys red on every open PR's merge commit,
including this one, which touches neither file.

Both occurrences in all six entries carry the same value, so dropping the
later one leaves every parsed price identical.

Same change as #41496, carried here so this branch is not blocked on it.
Identical deletions, so the two merge cleanly in either order.
@yuneng-berri yuneng-berri changed the title fix(prices): dedupe Nova cache_read_input_token_cost keys left by a text merge fix(ci): dedupe Nova price keys and repair two stale test suites on main Sep 16, 2026
@yuneng-berri
yuneng-berri force-pushed the litellm_/litellm-ci-failure-be9267 branch from 26390a0 to a6b10ad Compare September 16, 2026 22:35
@yuneng-berri yuneng-berri changed the title fix(ci): dedupe Nova price keys and repair two stale test suites on main fix(prices): dedupe Nova cache_read_input_token_cost keys left by a text merge Sep 16, 2026

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@yuneng-berri
yuneng-berri merged commit 680233f into main Sep 16, 2026
204 of 218 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/litellm-ci-failure-be9267 branch September 16, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants