Skip to content

fix(pricing): replace nonexistent apac.amazon.nova-2-lite-v1:0 with jp geo id (salvage of #33218, credit @vakudo) - #33776

Closed
Bartok9 wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
Bartok9:salvage-pricing-nova2-jp-geo-credit-vakudo
Closed

Bartok9 wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
Bartok9:salvage-pricing-nova2-jp-geo-credit-vakudo

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 17, 2026

Copy link
Copy Markdown

Successor of #33470. Salvage #33218 credit @vakudo. Pricing map apac→jp for nova-2-lite.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codecov

codecov Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects a single model key in both pricing JSON files, replacing the non-existent apac.amazon.nova-2-lite-v1:0 with the actual AWS Bedrock Japan geo-routing identifier jp.amazon.nova-2-lite-v1:0. Pricing data (input cost, cache cost, token limits, capability flags) is unchanged.

  • The _is_nova_2_model helper in converse_transformation.py only strips us., eu., and apac. regional prefixes; the new jp. prefix is not listed, so jp.amazon.nova-2-lite-v1:0 will not be recognized as a Nova 2 model and reasoning-config mapping will be skipped for Japan-region callers.
  • Three test sites (test_converse_transformation_nova_2.py lines 209/302 and test_converse_transformation.py line 3314) still reference the old apac.amazon.nova-2-lite-v1:0 model string, and the docstring example on line 296 of converse_transformation.py also lists the old prefix.

Confidence Score: 3/5

The pricing key rename is correct, but the matching _is_nova_2_model logic and test coverage were not updated to reflect the new jp. prefix, leaving Japan-region reasoning calls broken.

The pricing JSON fix is the right change, but the _is_nova_2_model helper in converse_transformation.py does not strip the jp. prefix, so jp.amazon.nova-2-lite-v1:0 would fall through without being identified as a Nova 2 model. This means reasoning parameters would silently not be mapped for callers in the Japan region. The companion test files and docstring still reference the removed apac. model ID, leaving the test suite inconsistent with the intended behaviour.

litellm/llms/bedrock/chat/converse_transformation.py needs jp. added to the regional prefix strip list; tests/test_litellm/llms/bedrock/chat/test_converse_transformation_nova_2.py and test_converse_transformation.py need their apac. model references updated.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Renames model key from apac.amazon.nova-2-lite-v1:0 to jp.amazon.nova-2-lite-v1:0 to match the actual AWS Bedrock geo-routing prefix; the pricing data itself is unchanged.
litellm/model_prices_and_context_window_backup.json Same single-key rename as the primary pricing file to keep the two files in sync; no content changes beyond the key name.

Reviews (1): Last reviewed commit: "fix(pricing): replace nonexistent apac.a..." | Re-trigger Greptile

"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_video_input": true,

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.

P1 jp. prefix not stripped in _is_nova_2_model

AmazonConverseConfig._is_nova_2_model (in litellm/llms/bedrock/chat/converse_transformation.py, line 326) only strips us., eu., and apac. regional prefixes before checking whether a model name starts with amazon.nova-2-. After this rename, a user who calls with model jp.amazon.nova-2-lite-v1:0 hits the stripping logic, finds no match, and the function returns False — so reasoning parameters (reasoning_effort) are silently not mapped for Japan-region callers. The same gap affects the docstring example on line 296 (still shows apac.) and the tests in test_converse_transformation_nova_2.py (lines 209/302) and test_converse_transformation.py (line 3314) that still assert on the non-existent apac. model. The converse_transformation.py prefix list and all three test files should be updated alongside this pricing change.

@Bartok9

Bartok9 commented Jul 17, 2026

Copy link
Copy Markdown
Author

Thanks @greptile-apps — good catch. The code-side fix was orphaned when the base PR #33469 was closed after a rebase left its diff stuck. I've folded it into this successor:

  • _is_nova_2_model now strips jp. and global. geo prefixes, so the renamed jp.amazon.nova-2-lite-v1:0 key is detected and reasoning-config mapping applies for JP/global callers.
  • Docstring updated to list jp./global. variants.
  • The two apac.amazon.nova-2-lite-v1:0 test fixtures were repointed to a valid apac. Nova 2 SKU (apac.amazon.nova-2-pro-preview-...) so legacy apac. prefix stripping keeps coverage; _is_nova_2_model unit test now asserts jp. + global. positives.

Pricing-map rename stays the core of this PR (salvage of #33218, credit @vakudo).

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (546 files found, 500 file limit)

@Bartok9
Bartok9 changed the base branch from main to litellm_oss_daily_2026_07_17 July 17, 2026 21:10
@Bartok9
Bartok9 requested a review from a team July 17, 2026 21:10
@Bartok9
Bartok9 force-pushed the salvage-pricing-nova2-jp-geo-credit-vakudo branch 2 times, most recently from b674acf to 50858bb Compare July 17, 2026 21:12
@Bartok9

Bartok9 commented Jul 17, 2026

Copy link
Copy Markdown
Author

Retargeted this PR to the current daily OSS branch (litellm_oss_daily_2026_07_17) and rebased so it carries only the two intended commits — the pricing key rename plus the _is_nova_2_model jp./global. prefix fix and aligned tests. The earlier ~500-file diff was base drift from being cut against main; it's now a clean 5-file change and mergeable. osv-scan is a pre-existing base lockfile (ddtrace) finding, unrelated to this diff.

@codspeed

codspeed Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing Bartok9:salvage-pricing-nova2-jp-geo-credit-vakudo (5dfcbcb) with litellm_internal_staging (f6b9518)

Open in CodSpeed

@Bartok9
Bartok9 changed the base branch from litellm_oss_daily_2026_07_17 to litellm_oss_daily_2026_07_20 July 20, 2026 20:55
@Bartok9
Bartok9 force-pushed the salvage-pricing-nova2-jp-geo-credit-vakudo branch 2 times, most recently from 783c00f to a59279f Compare July 24, 2026 12:45
@Bartok9
Bartok9 changed the base branch from litellm_oss_daily_2026_07_20 to litellm_internal_staging July 24, 2026 12:45
@Bartok9
Bartok9 force-pushed the salvage-pricing-nova2-jp-geo-credit-vakudo branch from a59279f to 8d8794d Compare July 24, 2026 12:48
@Bartok9
Bartok9 changed the base branch from litellm_internal_staging to litellm_oss_daily_2026_07_20 July 24, 2026 12:48
@Bartok9
Bartok9 force-pushed the salvage-pricing-nova2-jp-geo-credit-vakudo branch from 8d8794d to 8ff44d8 Compare August 9, 2026 23:53
@Bartok9
Bartok9 changed the base branch from litellm_oss_daily_2026_07_20 to main August 9, 2026 23:53
…p geo id (salvage of BerriAI#33218, credit @vakudo)

Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
@Bartok9
Bartok9 force-pushed the salvage-pricing-nova2-jp-geo-credit-vakudo branch from 8ff44d8 to e007ae5 Compare August 9, 2026 23:57
@Bartok9
Bartok9 changed the base branch from main to litellm_internal_staging August 9, 2026 23:57
Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

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.

2 participants