Skip to content

fix(model-catalog): declare above_32k cost fields on ModelInfo - #42856

Merged
kerry-berri merged 2 commits into
mainfrom
litellm_rust_model_info_above_32k
Sep 24, 2026
Merged

kerry-berri merged 2 commits into
mainfrom
litellm_rust_model_info_above_32k

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

  • Declares the four *_above_32k_tokens cost fields on the Rust ModelInfo

User Flow

Before: a contributor opening any PR against main sees the Rust check red for a change they did not make

  1. They push a branch and open a PR
  2. rust-test fails in spec_parity::every_entry_round_trips_through_model_info with openrouter/qwen/qwen3-coder-plus key difference: {"input_cost_per_token_above_32k_tokens", ...}

After: the same PR passes rust-test

  1. They push a branch and open a PR
  2. rust-test is green

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 existing spec_parity::every_entry_round_trips_through_model_info test is the regression test: it round-trips every registry entry through ModelInfo and fails on any dropped key. It fails on main at b2b0b6c and passes with this change (cargo test -p litellm-model-catalog --test spec_parity, 4 passed). Split out of #42779 at the pricing owner's request so the registry PR stays data only

Type

🐛 Bug Fix

Link to Devin session: https://app.devin.ai/sessions/2de281eeae484d7e92904c8feaa36330
Open in Devin Desktop: https://app.devin.ai/desktop/session/2de281eeae484d7e92904c8feaa36330?variant=devin

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 24, 2026 02:01
@devin-ai-integration

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 sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the model fields now preserve the newly supported pricing keys and the previous style finding is resolved.

Summary

This PR restores Rust model-catalog parity by declaring four optional above-32k-token pricing fields on ModelInfo.

  • Adds cache creation and cache read pricing fields.
  • Adds input and output token pricing fields.
  • Preserves absent-value behavior through serde defaults and conditional serialization.
  • Removes the redundant comments identified in the previous review.

Reviews (2) · Last reviewed commit: "fix(model-catalog): drop redundant comme..."

Comment thread litellm-rust/crates/model-catalog/src/model_info.rs Outdated
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yujonglee-berri
yujonglee-berri enabled auto-merge (squash) September 24, 2026 02:20
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
auto-merge was automatically disabled September 24, 2026 02:21

Head branch was modified

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@kerry-berri
kerry-berri merged commit b098063 into main Sep 24, 2026
101 checks passed
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