Skip to content

fix: correct cache pricing for Claude 3 Haiku CRIS variants on Bedrock - #40368

Closed
truongsontung wants to merge 3 commits into
BerriAI:mainfrom
truongsontung:fix/claude3-haiku-cache-prices
Closed

truongsontung wants to merge 3 commits into
BerriAI:mainfrom
truongsontung:fix/claude3-haiku-cache-prices

Conversation

@truongsontung

Copy link
Copy Markdown

Fixes #40360

Four cross-region Bedrock keys for Claude 3 Haiku have wrong cache pricing derived from the generic 1.25x write / 0.1x read ratios instead of Anthropic's published non-round values ($0.30 write / $0.03 read per Mtok).

Keys fixed:

  • anthropic.claude-3-haiku-20240307-v1:0
  • apac.anthropic.claude-3-haiku-20240307-v1:0
  • eu.anthropic.claude-3-haiku-20240307-v1:0
  • us.anthropic.claude-3-haiku-20240307-v1:0

Changes:

  • cache_read_input_token_cost: 2.5e-08 → 3e-08 ($0.025 → $0.03)
  • cache_creation_input_token_cost: 3.125e-07 → 3e-07 ($0.3125 → $0.30)

This aligns the CRIS variants with the correct direct entry in the same file.

Four cross-region Bedrock keys for Claude 3 Haiku carry cache prices
derived from the generic 1.25x write / 0.1x read ratios, but Anthropic's
published prices are non-round values (/usr/bin/zsh.30 write / /usr/bin/zsh.03 read per Mtok).

Keys fixed:
- anthropic.claude-3-haiku-20240307-v1:0
- apac.anthropic.claude-3-haiku-20240307-v1:0
- eu.anthropic.claude-3-haiku-20240307-v1:0
- us.anthropic.claude-3-haiku-20240307-v1:0

Changes:
- cache_read_input_token_cost: 2.5e-08 → 3e-08 (/usr/bin/zsh.025 → /usr/bin/zsh.03)
- cache_creation_input_token_cost: 3.125e-07 → 3e-07 (/usr/bin/zsh.3125 → /usr/bin/zsh.30)

Impact: corrects cache-read costs understated by 16.7% and
cache-write costs overstated by 4.2% for these four keys.

Fixes BerriAI#40360
@truongsontung
truongsontung requested a review from a team September 9, 2026 05:50
@CLAassistant

CLAassistant commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Corrects cache-read and cache-creation token prices for four Claude 3 Haiku Bedrock cross-region model entries

  • Applies consistent cache prices to the base, APAC, EU, and US identifiers
  • Leaves model capabilities and standard input/output pricing unchanged
  • Needs focused regression coverage for the corrected values

Confidence Score: 4/5

The pricing changes look internally consistent, but the repository-required regression coverage should be added before merging

The corrected values match the existing direct model entry, but no test protects the four affected Bedrock keys from another pricing regression

Files Needing Attention: model_prices_and_context_window.json

Important Files Changed

Filename Overview
model_prices_and_context_window.json Updates eight cache-pricing constants across four Bedrock model entries, but adds no regression test

Reviews (1): Last reviewed commit: "fix: correct cache pricing for Claude 3 ..." | Re-trigger Greptile

Comment on lines 954 to 955
"supports_tool_choice": true,
"supports_vision": 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.

P2 Missing regression coverage

This pricing fix lacks tests for the four changed Bedrock keys. Repository rules require regression tests before merging bug fixes

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Verifies all 4 Bedrock cross-region entries have correct Anthropic-published
cache prices (write $0.30/M, read $0.03/M) matching the direct entry.
@codspeed

codspeed Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing truongsontung:fix/claude3-haiku-cache-prices (63d74a2) with litellm_internal_staging (802e526)

Open in CodSpeed

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@truongsontung

Copy link
Copy Markdown
Author

The test file (test_bedrock.py / test_pricing.py) already exists in the repo covering the Claude 3 Haiku CRIS variants. The review appears stale - could a maintainer re-review?

@truongsontung

Copy link
Copy Markdown
Author

Ping maintainers: CI tests pass, PR targets litellm_internal_staging. Awaiting review.

@yuneng-berri
yuneng-berri deleted the branch BerriAI:main September 13, 2026 04:51
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 23, 2026 14:38
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Registry disposition is recorded in #48188. Targeted retired keys are absent, and the proposed historical cache rates remain unverified

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.

[Bug]: Bedrock CRIS claude-3-haiku-20240307 entries use 1.25x/0.1x ratios instead of Anthropic's published $0.30/$0.03 cache prices

3 participants