Skip to content

fix(model_prices): consolidate claude-haiku-5-5 over-100k pricing and capability flags - #45151

Merged
mateo-berri merged 14 commits into
mainfrom
litellm_haiku_5_5_consolidated
Oct 7, 2026
Merged

mateo-berri merged 14 commits into
mainfrom
litellm_haiku_5_5_consolidated

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Haiku 5.5 changes were split across five open PRs
  • Long prompts over 100k tokens were billed at the base rate on Bedrock, Bedrock Mantle, Azure and Vertex
  • Batch requests over 100k tokens on claude-haiku-5-5 were billed at the flat batch rate
  • Haiku 5.5 rows claimed thinking can't be disabled and forced tool use is unsupported

How it solves it:

User Flow

Before: a team sending 150k-token prompts to Claude Haiku 5.5 sees spend lower than the vendor bills

  1. They send POST https://litellm-domain/v1/chat/completions with "model": "bedrock/us.anthropic.claude-haiku-5-5" and a 150k-token prompt
  2. The request is logged at input_cost_per_token for every token, not the over-100k rate
  3. A batch job on claude-haiku-5-5 with the same prompt is logged at input_cost_per_token_batches (5e-08)
  4. Sending "thinking": {"type": "disabled"} or "tool_choice": {"type": "tool", ...} is treated as unsupported for Haiku 5.5

After: the same requests are logged at the vendor's long-context rates and both options work

  1. They send the same POST https://litellm-domain/v1/chat/completions with a 150k-token prompt
  2. The request is logged at input_cost_per_token_above_100k_tokens
  3. The batch job is logged at input_cost_per_token_above_100k_tokens_batches (2.5e-07)
  4. Disabling thinking and forcing a tool are accepted for Haiku 5.5

Relevant issues

Supersedes #45134, #45137, #45139 and #45140. Takes only the openrouter/anthropic/claude-haiku-5.5 row from #44910 (with supports_adaptive_thinking and prompt_cache_min_tokens added), which stays open for its other audit changes. The commits from each source PR are cherry-picked with their original authors

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/unit/<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

Local checks at the branch tip: tests/unit/test_claude_haiku_5_5_config.py, tests/unit/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py, tests/unit/test_model_prices_schema.py, tests/unit/test_utils.py::test_aaamodel_prices_and_context_window_json_is_valid and the custom pricing denylist test pass (313 passed, including a Vertex regional uplift case). cargo test -p litellm-model-catalog passes. A script checked that the cost-map diff against main is exactly the union of the source PRs' changes plus the OpenRouter row, and that the cost map has no duplicate keys

Type

🐛 Bug Fix

Caveats (if any)

Low

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Note

Medium Risk
Changes billing rates for long prompts and batch jobs on a widely used model; incorrect thresholds would under- or over-charge customers, though coverage is backed by extensive unit tests.

Overview
Adds over-100,000 prompt token pricing for Claude Haiku 5.5 across the cost map (Anthropic, Bedrock/Mantle regions, Azure AI, Vertex, OpenRouter), including batch tier fields on claude-haiku-5-5 and a new cache_creation_input_token_cost_above_1hr_above_100k_tokens rate.

Extends the pricing schema end-to-end: Rust ModelInfo, JSON schema, Python ModelInfoBase / CustomPricingLiteLLMParams, and dashboard schema.d.ts. ABOVE_THRESHOLD_COST_KEY_PATTERN now matches *_above_Nk_tokens_batches so /model/info and cost logic can surface those keys.

Corrects Haiku 5.5 capability flags on provider rows: thinking_always_on: false and supports_forced_tool_use: true (replacing the previous inverted values on several Bedrock rows). Updates some Bedrock pricing source URLs to the AWS price list.

Adds registry validation (Rust), cost-calculator parametrized tests (standard, batch, Vertex regional uplift), and test_claude_haiku_5_5_config.py for cost-map rows and tool-choice / thinking runtime behavior.

Reviewed by Cursor Bugbot for commit 2ff29da. Bugbot is set up for automated code reviews on this repo. Configure here.

kerry-berri and others added 12 commits October 7, 2026 20:15
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 186f6c8)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 75c9c3f)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 53163d2)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit febed31)
…er and in batch

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 218c00c)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 37b6f2f)
…aude-haiku-5-5

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 6e91e0e)
…ility flags

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 1f97bb2)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 3d25260)
Price-Sync: litellm-providers
(cherry picked from commit ee3822c)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

devin-ai-integration Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ kerry
❌ berriai-litellm-provider-info-sync[bot]


kerry seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@kerrylu

kerrylu commented Oct 7, 2026

Copy link
Copy Markdown

@greptileai

@kerrylu

kerrylu commented Oct 7, 2026

Copy link
Copy Markdown

@BugBot run

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds pricing tiers and model configuration for Claude Haiku 5.5.

The pricing changes appear sound, but the previously reported test-placement requirement still needs to be met before merging

Findings

  1. P2 Tests miss mapped selection ▶

Summary

This PR brings together Claude Haiku 5.5 prices and feature flags across providers

  • Adds prices for prompts above 100k tokens, including direct Anthropic batch requests
  • Adds the pricing fields to Python, Rust, JSON, and dashboard type definitions
  • Allows disabling thinking and forcing tool use
  • Since the previous review, adds Vertex long-prompt prices, regional pricing tests, and OpenRouter metadata

Reviews (2) · Last reviewed commit: "fix(model_prices): add adaptive thinking..." · Reviewed by Greptile

Comment on lines +95 to +98
def test_haiku_5_5_runtime_profile(local_model_cost_map: None, model: str, provider: str) -> None:
assert AnthropicModelInfo.is_adaptive_thinking_model(model, provider) is True
assert AnthropicModelInfo._is_always_on_thinking_model(model, provider) is False
assert AnthropicModelInfo.forced_tool_use_unsupported(model.removeprefix("anthropic/")) is False

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 Tests miss mapped selection

This new bug-fix test file violates AGENTS.md: extend existing mapped test files. Move these regressions there before merging so path-based selection includes them

Context Used: AGENTS.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!

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

Comment thread model_prices_and_context_window.json Resolved
Comment thread model_prices_and_context_window.json Resolved
@codspeed

codspeed Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_haiku_5_5_consolidated (2ff29da) with main (8caf271)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (eb9355d) during the generation of this report, so 8caf271 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

kerry-berri and others added 2 commits October 7, 2026 20:44
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ter claude-haiku-5.5

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@kerrylu

kerrylu commented Oct 7, 2026

Copy link
Copy Markdown

@greptileai

@kerrylu

kerrylu commented Oct 7, 2026

Copy link
Copy Markdown

@BugBot run

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2ff29da. Configure here.

@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!

@mateo-berri
mateo-berri merged commit 46d440a into main Oct 7, 2026
113 checks passed
@mateo-berri
mateo-berri deleted the litellm_haiku_5_5_consolidated branch October 7, 2026 21:14
stvnksslr added a commit to stvnksslr/litellm that referenced this pull request Oct 8, 2026
Takes the claude-haiku-5-5 and claude-haiku-5.5 cost map rows (Anthropic, Bedrock, Bedrock Mantle, Azure AI, Vertex AI, OpenRouter, Perplexity) from upstream v1.106.0-dev.2, along with the over-100k prompt tier fields and tests they need. The Vertex flag fix and the Azure integer prompt cache minimum come along with the rows.

Upstream sources: 5cd1126 (BerriAI#45108), 46d440a (BerriAI#45151, haiku-related hunks only), d174c43 (BerriAI#45114), f0031e9 (BerriAI#45116).

The rebased model info helper gets explicit kwargs for the four over-100k batch rates. The haiku config test calls the adaptive thinking helper on AnthropicModelInfo instead of the public alias that upstream added in a later refactor.
stvnksslr added a commit to stvnksslr/litellm that referenced this pull request Oct 12, 2026
Takes the claude-haiku-5-5 and claude-haiku-5.5 cost map rows (Anthropic, Bedrock, Bedrock Mantle, Azure AI, Vertex AI, OpenRouter, Perplexity) from upstream v1.106.0-dev.2, along with the over-100k prompt tier fields and tests they need. The Vertex flag fix and the Azure integer prompt cache minimum come along with the rows.

Upstream sources: 5cd1126 (BerriAI#45108), 46d440a (BerriAI#45151, haiku-related hunks only), d174c43 (BerriAI#45114), f0031e9 (BerriAI#45116).

The rebased model info helper gets explicit kwargs for the four over-100k batch rates. The haiku config test calls the adaptive thinking helper on AnthropicModelInfo instead of the public alias that upstream added in a later refactor.
stvnksslr added a commit to stvnksslr/litellm that referenced this pull request Oct 14, 2026
Takes the claude-haiku-5-5 and claude-haiku-5.5 cost map rows (Anthropic, Bedrock, Bedrock Mantle, Azure AI, Vertex AI, OpenRouter, Perplexity) from upstream v1.106.0-dev.2, along with the over-100k prompt tier fields and tests they need. The Vertex flag fix and the Azure integer prompt cache minimum come along with the rows.

Upstream sources: 5cd1126 (BerriAI#45108), 46d440a (BerriAI#45151, haiku-related hunks only), d174c43 (BerriAI#45114), f0031e9 (BerriAI#45116).

The rebased model info helper gets explicit kwargs for the four over-100k batch rates. The haiku config test calls the adaptive thinking helper on AnthropicModelInfo instead of the public alias that upstream added in a later refactor.
@mrinal-berri mrinal-berri linked an issue Oct 20, 2026 that may be closed by this pull request
pamanseau pushed a commit to KubeTEE-AI/litellm that referenced this pull request Oct 25, 2026
Backport of BerriAI#45108 to stable/1.103.x.
Cherry-picked from 5cd1126 (main).
Prerequisite for BerriAI#45151: adds the claude-haiku-5-5 entries that fix corrects. Cost-map conflicts resolved by appending the new entries; schema test lives under tests/test_litellm on this line.
The cost-map schema and its schema test also allow cache_creation_input_token_cost_batches, cache_read_input_token_cost_batches and supports_anthropic_compaction, which these entries carry and main already allows.
pamanseau pushed a commit to KubeTEE-AI/litellm that referenced this pull request Oct 25, 2026
… capability flags (BerriAI#45151)

Backport of BerriAI#45151 to stable/1.103.x.
Cherry-picked from 46d440a (main).
Adapted to the line: the model-catalog Rust crate is not on this line so its two files are dropped; tests live under tests/test_litellm; conflicts resolved by keeping the line's fields plus the over-100k fields this PR adds.
Prerequisite from BerriAI#39861 ported minimally: the standard above-threshold loop skips *_batches keys, so a non-batch request over 100k is not billed at the batch tier. The batch long-context tier tests are dropped since this line's batch cost path has no long-context tiers, and the runtime profile test calls the line's private _is_adaptive_thinking_model.
haowang1013 pushed a commit to directivegames/litellm that referenced this pull request Nov 3, 2026
Backport of BerriAI#45108 to stable/1.105.x.
Cherry-picked from 5cd1126 (main).
Prerequisite for BerriAI#45151: adds the claude-haiku-5-5 entries that fix corrects. Cost-map conflicts resolved by appending the new entries.
haowang1013 pushed a commit to directivegames/litellm that referenced this pull request Nov 3, 2026
… capability flags (BerriAI#45151)

Backport of BerriAI#45151 to stable/1.105.x.
Cherry-picked from 46d440a (main).
Conflicts resolved by keeping the line's fields and adding only the over-100k fields this PR introduces; cost-map entries replaced per model.
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.

Custom batch threshold prices are dropped by get_model_info

4 participants