test(batches): assert completed Vertex batch cost at batch rates - #37443
Open
harryzhou2000 wants to merge 1 commit into
Open
Conversation
Contributor
Author
This was referenced Aug 19, 2026
Contributor
Greptile SummaryThis PR corrects the completed Vertex batch test to assert costs using the model catalog’s batch-specific token rates.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/test_litellm/batches/test_batch_utils.py | The revised expectation matches the canonical Vertex batch rates and continues to validate the computed cost, usage totals, and returned models. |
Reviews (2): Last reviewed commit: "test(batches): assert completed Vertex b..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
harryzhou2000
marked this pull request as ready for review
August 19, 2026 05:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
test_handle_completed_vertex_batch_computes_cost_usage_and_modelsfails onlitellm_internal_stagingHow it solves it:
input_cost_per_token_batchesandoutput_cost_per_token_batchesUser Flow
Before: the staging branch's
miscCI shard fails on the completed Vertex batch cost assertion.tests/test_litellm/batches/test_batch_utils.pyAfter: the assertion matches the batch prices the model catalog advertises.
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito 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
Before (
8941f2a6)pytest -q tests/test_litellm/batches/test_batch_utils.py::test_handle_completed_vertex_batch_computes_cost_usage_and_modelsassert 3.9375e-05 == 7.875e-05failsAfter (
daf5c7e71c)1 passedType
✅ Test
QA runbook
tests/test_litellm/batches/test_batch_utils.py::test_handle_completed_vertex_batch_computes_cost_usage_and_models- the completed Vertex batch cost assertion now matches the batch rates in the model catalogvertex_ai/gemini-3.6-flashadvertisesinput_cost_per_token_batches: 3.75e-07andoutput_cost_per_token_batches: 1.875e-06inmodel_prices_and_context_window.jsonFinal Attestation